query-913d9f9f5111a621ad8a1fd6a94c99aa
cemeteries by grave density SELECT ?cemetery ?cemeteryLabel ?graves ?area (?graves/?area AS ?density) WHERE { ?cemetery wdt:P31/wdt:P279* wd:Q39614; wdt:P2351 ?graves; p:P2046 [ a wikibase:BestRank; psn:P2046/wikibase:quantityAmount ?area ]. FILTER(!wikibase:isSomeValue(?graves)) FILTER(!wikibase:isSomeValue(?area)) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?density)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# cemeteries by grave density
SELECT ?cemetery ?cemeteryLabel ?graves ?area (?graves/?area AS ?density) WHERE {
?cemetery wdt:P31/wdt:P279* wd:Q39614;
wdt:P2351 ?graves;
p:P2046 [ a wikibase:BestRank; psn:P2046/wikibase:quantityAmount ?area ].
FILTER(!wikibase:isSomeValue(?graves))
FILTER(!wikibase:isSomeValue(?area))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?density)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?area"):::projected
v4("?cemetery"):::projected
v5("?density")
v3("?graves"):::projected
a1((" "))
a2((" "))
a3((" "))
c6(["wikibase:BestRank"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q39614"]):::iri
f0[["not http://wikiba.se/ontology#isSomeValue(?area)"]]
f0 --> v2
f1[["not http://wikiba.se/ontology#isSomeValue(?graves)"]]
f1 --> v3
v4 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v4 --"p:direct/P2351"--> v3
a2 --"a"--> c6
a2 --"p:statement/value-normalized/P2046"--> a3
a3 --"wikibase:quantityAmount"--> v2
v4 --"p:P2046"--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind2[/"?graves / ?area"/]
v3 --o bind2
v2 --o bind2
bind2 --as--o v5