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 detailed information 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


Basic configuration is possible via environment variables, also possible via .env file. See lib/config.js for supported fields and default values.


Web Service

An instance is available at The service provides the following endpoints, aligned with JSKOS Server.


Look up Wikidata items as JSKOS Concepts by their entity URI or QID.

  • URL Params

    uri=[uri] URIs for concepts separated by |.

    language or languages: comma separated list of language codes.

  • Success Response

    JSON array of JSKOS Concepts


Look up Wikidata mapping statements as JSKOS Concept Mappings between Wikidata items (query parameter from) and external identifiers (query parameter to). At least one of both parameters must be given.

  • URL Params

    from=[uri|notation] specify the source URI or notation

    to=[uri|notation] specify the target URI or notation

    fromScheme=[uri|notation] only show mappings from this concept scheme (URI or notation)

    toScheme=[uri|notation] only show mappings to this concept scheme (URI or notation)

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

    mode=[mode] specify the mode for from, to, one of and (default) and or

    direction=forward|backward|both searches mappings from from to to (default), reverse, or in both directions

Concept Schemes are identified by BARTOC IDs (e.g. or just 430).

  • Success Response

    JSON array of JSKOS Concept Mappings

  • Examples



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


Look up Wikidata items with Wikidata properties for authority control as JSKOS Concept Schemes with used for mappings. 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).

Command Line Interface

The command line client wdjskos provides the same commands as accessible via the web service:

wdjskos concept

Look up Wikidata items as JSKOS Concepts.

wdjskos mappings

Look up JSKOS Concept Mappings.

wdjskos schemes

Look up JSKOS Concept Schemes with Wikidata properties for authority control.


Get mappings:

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

A single hyphen (-) 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

Mapping schemes are cached in the caching directory of wikidata-cli.


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: "", notation: [ "..." ] }

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(
// ...

// convert claims with mapping properties
jskos = wds.mapMappingClaims(claims)

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)



For debugging set environment variable DEBUG, also possible via file .env:


See lib/utils/debug.js for details.


MIT License