Access Wikidata in JSKOS format
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Wikidata JSKOS

License Build Status standard-readme compliant

Access Wikidata in JSKOS format

This node module provides a web service, a command line client, and a library to access Wikidata in JSKOS format.

Table of Contents


Wikidata is a large knowledge base with detailled informatin about all kinds of entities. Mapping its data model to JSKOS data format allows simplified reuse of Wikidata as authority file. The mapping includes concordances between Wikidata and identifiers from other databases.

See Also


Clone and install dependencies

# clone the repository
git clone
cd wikidata-jskos

# install dependencies
npm install

Install webservice

For deployment there is a config file to use with pm2:

pm2 start ecosystem.config.json

For development serve with hot reload and auto reconnect at http://localhost:2013/:

npm run start


Web Service

An instance is available at The service provides the following endpoints:


Look up a Wikidata item as JSKOS Concept by its entity URI or QID.

Optional parameters:

  • language or languages: comma separated list of language codes


Look up JSKOS mappings between Wikidata items (query parameter from) and external identifiers (query parameter to). At least one of both parameters must be given:

  • from (e.g. ?from=
  • to (e.g. ?to=

The optional parameter toScheme can limit result of query with from to a selected concept scheme, identified by BARTOC URI (e.g. or just 430).

Mapping relation types (P4390) are respected, if given, see for example mapping from Wikidata to

Optional query parameter language or languages enables inclusion of entity labels. A comma separated list of language codes is used as preference list.


Return a list of supported concept schemes. These schemes need to have a BARTOC-ID (P2689), and be subject item (P1629) of an external identifier property with statements P1921 (URI template) and P1793 (regular expression).


The command line client wdjskos provides the same functionality as the web service (see usage as web service).


Get mappings:

wdjskos m Q42 | jq .to.memberSet[].uri
wdjskos m -

A single character (e.g. -) can be used to nullify argument from or to, respectively. Mappings can be limited to a target scheme. These are equivalent:

wdjskos --scheme P227 mappings Q42
wdjskos --scheme 430 mappings Q42
wdjskos --scheme mappings Q42


jskos = wds.mapEntity(entity)

Entity data can be retrieved via Wikidata API method wbgetentities and from Wikidata database dumps. See JavaScript libraries wikidata-sdk and wikidata-filter for easy access and processing.

Map selected parts of a Wikidata entity

All methods return a JSKOS item.

jskos = wds.mapIdentifier(
// { uri: "" }

jskos = wds.mapLabels(entity.labels)
// { prefLabel: { ... } }

jskos = wds.mapAliases(entity.aliases)
// { altLabel: { ... } }

jskos = wds.mapDescriptions(entity.descriptions)
// { scopeNote: { ... } }

jskos = wds.mapSitelinks(entity.sitelinks)
// ...

jskos = wds.mapClaims(
// ...

jskos = wds.mapInfo(entity)
// ...

Map simplified Wikidata entities

Each method has a counterpart to map simplified Wikidata entities.

jskos = wds.mapSimpleEntity(entity)
jskos = wds.mapSimpleIdentifier(
jskos = wds.mapSimpleLabels(entity.labels)




MIT License