Get started with wikibase-sdk CDN
MIT licensed
PHP SDK: Wikibase-sdk for Wikibase collaboration platform interaction.
Tags:- wikidata
- wikibase
- sdk
- api
- wdq
- sparql
- wbk
Stable version
Copied!
How to start using wikibase-sdk CDN
// Include the Wikibase SDK from the CDN
const Wikibase = await import('https://cdn.cdnhub.io/wikibase-sdk/10.0.2/wikibase-sdk.min.js');
// Initialize the SDK with your Wikidata site and API access token
const wikibase = new Wikibase({
site: 'wikidata.org',
apiToken: 'YOUR_API_TOKEN_HERE'
});
// Define a function to perform a query
async function query(queryString) {
try {
const queryResult = await wikibase.data.get(queryString);
console.log('Query result:', queryResult);
} catch (error) {
console.error('Error:', error);
}
}
// Perform a query for items with the label "Eiffel Tower"
query('SELECT ?itemLabel WHERE { wd:Q185 wdt:P31 wd:Q2795 . ?item wdt:P31 wd:Q279 . ?item wdt:P361 ?property . ?property p:Label ?itemLabel FILTER(lang(?itemLabel)="en") }');
All versions
10.0.0
10.0.1
10.0.2
10.0.3
10.1.0
10.1.1
10.2.0
*** 10.2.1
7.1.4
7.1.5
7.1.6
7.10.0
7.11.0
7.11.1
7.11.2
7.12.0
7.13.0
7.13.1
7.14.0
7.14.1
7.14.2
7.14.3
7.14.4
7.15.0
7.2.1
7.3.0
7.3.1
7.4.1
7.4.2
7.4.3
7.4.4
7.4.5
7.4.6
7.5.0
7.6.0
7.6.1
7.6.2
7.7.0
7.7.1
7.8.0
7.9.0
7.9.1
8.0.0
8.0.1
8.0.2
8.0.3
8.0.4
8.0.5
8.1.0
8.1.1
9.0.0
9.0.1
9.0.2
9.0.3
9.0.4
9.0.5
9.0.6
9.1.0
9.1.1
9.1.2
9.1.3
9.2.0
9.2.1
9.2.2
9.2.3
9.2.4
9.2.5