wikibase-sdk
javascript, Node.jsでwikidataを扱うことができるライブラリ
https://github.com/maxlath/wikibase-sdk
code:js
const WBK = require('wikibase-sdk');
const wdk = WBK({
instance: 'https://www.wikidata.org',
sparqlEndpoint: 'https://query.wikidata.org/sparql'
});
const fetch = require('node-fetch');
const url = wdk.getEntities({
ids:'P580', 'Q41655079', 'Q232595', 'Q41654707',
languages: 'ja',
props: 'labels', 'descriptions'
});
fetch(url)
.then(response => response.json())
.then(wdk.parse.wb.entities)
.then(entities => {
console.log(entities)
})
#wikidata
#wikibase
#maxlath