Skip to content
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.

Latest commit

 

History

History
11 lines (6 loc) · 870 Bytes

wikidata_batch_import_using_sparql_queries_results.md

File metadata and controls

11 lines (6 loc) · 870 Bytes

Wikidata batch import using SPARQL queries results

  • Write a SPARL query SELECTing only one variable (with no label) that should output the ids of the entities you would like to import. Save this query in the folder queries/sparql/${type}.rq with, type being the type you would like it to have in ElasticSearch.

  • Run the query: npm run update-query-results type-a type-b. This will save the corresponding ids into queries/results/${type}.json

  • Add the type name to the server type whitelist by adding it to ./config/default.coffee types list

  • After starting the server (see above), import the results: npm run import-query-results type-a type-b

Both commands can be passed all instead of a list of types to run all the queries in the queries/sparql folder, and import all the results from queries/results in ElasticSearch, via the server.