Skip to content

Instantly share code, notes, and snippets.

@jindrichmynarz
Created April 22, 2020 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jindrichmynarz/b649c7bdc9d2529aeca2f3163f5e5c16 to your computer and use it in GitHub Desktop.
Save jindrichmynarz/b649c7bdc9d2529aeca2f3163f5e5c16 to your computer and use it in GitHub Desktop.
Construct indirect Wikidata links used by DBpedia
# Run at the German DBpedia SPARQL endpoint: http://de.dbpedia.org/sparql
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?dbpedia
WHERE {
BIND (<http://www.wikidata.org/entity/Q1418856> AS ?wikidata)
BIND (strafter(str(?wikidata), "http://www.wikidata.org/entity/") AS ?qid)
BIND (iri(concat("http://wikidata.dbpedia.org/resource/", ?qid)) AS ?indirect_wikidata)
?dbpedia owl:sameAs ?indirect_wikidata .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment