query-bf02ee4a3ba9299ad1a623ac12591429

rq turtle/ttl

List of Cemeteries on Wikidata, sorted by number of people buried in them

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?cemetery ?cemeteryLabel ?total (COUNT(?person) AS ?onWikidata) WHERE {   ?cemetery wdt:P31/wdt:P279* wd:Q39614.   MINUS { ?cemetery wdt:P361 [ wdt:P31 wd:Q39614 ].}   ?person wdt:P119/(wdt:P276|wdt:P361*) ?cemetery.   OPTIONAL { ?cemetery wdt:P2324 ?total. }   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?cemetery ?cemeteryLabel ?total ORDER BY DESC(?onWikidata)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?cemetery"):::projected v5("?onWikidata") v3("?person"):::projected v4("?total"):::projected a1((" ")) a2((" ")) a3((" ")) c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q39614"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; a2 --"wdt:P31"--> c3 v2 --"wdt:P361"--> a2 end v3 --"wdt:P119"--> a3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a3 --"wdt:P361"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a3 --"wdt:P276"--> v2 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2324".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind2[/"count(?person)"/] v3 --o bind2 bind2 --as--o v5