Skip to content

Instantly share code, notes, and snippets.

@netsensei
Created January 28, 2016 20:05
Show Gist options
  • Save netsensei/52c202ed7187cafdcc6b to your computer and use it in GitHub Desktop.
Save netsensei/52c202ed7187cafdcc6b to your computer and use it in GitHub Desktop.
SPARQL query against wikidata example.
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?c ?cLabel (substr(?dod, 0, 4) as ?t)
WHERE
{
?p wdt:P195 wd:Q2365880 .
?p wdt:P170 ?c .
?c wdt:P570 ?dod .
FILTER (?dod > "1946-01-01T00:00:00Z"^^xsd:dateTime)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "nl,en" .
}
} ORDER BY ?cLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment