dimid
dimid

Reputation: 7631

How to create a local Wikidata query service?

I'm trying to run a SPARQL query on Wikidata, but it times out. I'd like to download a dump and index it in some database, so I can run local SPARQL queries using HTTP requests. I also need to support Wikidata-specific extensions like SERVICE wikibase:label. I've downloaded an RDF dump. What are the next steps?

Upvotes: 3

Views: 3494

Answers (2)

D063520
D063520

Reputation: 153

You can try to use qEndpoint. There are two options:

  1. if you want to set up the endpoint as fast as possible you can use this docker image:

https://hub.docker.com/r/qacompany/qendpoint-wikidata

this will basically install qEndpoint and download the index for whole wikidata. With a good internet connection you should have it in 3 hours.

  1. You can index the latest dump by yourself. Here are some instructions:

https://github.com/the-qa-company/qEndpoint/wiki/Use-qEndpoint-to-index-a-dataset#start-the-endpoint

PS: SPARQL 1.1 is supported and also the SERVICE wikibase:label clause.

Upvotes: 0

Vincent Cloutier
Vincent Cloutier

Reputation: 331

Wikimedia has documentation on how to run your own SPARQL endpoint from one of their dumps. They also have an updater that streams updates from their servers, to keep your endpoint up-to-date.

You won't need to do anything special to support their extensions, it is included by default.

I recommend using a reverse proxy (like nginx or apache) with http auth in production, the admin dashboard is accessible by default.

Upvotes: 8

Related Questions