query-b91df4f1a99d7dcf5d0c5eb4ef020884
Archivi in Toscana - tutti SELECT DISTINCT ?i ?iLabel ?iDescription ?coord ?inst ?instLabel ?instcoord ?indir ?pea WHERE { ?i wdt:P31 wd:Q166118 . ?i (wdt:P131)* wd:Q1273 . ?i wdt:P131 ?inst . #?inst wdt:P625 ?instcoord . OPTIONAL { ?i wdt:P6375 ?indir . } OPTIONAL { ?i wdt:P7764 ?pea . } OPTIONAL { ?i wdt:P625 ?coord . } BIND(IF(BOUND(?coord),'archiv','comune') AS ?layer) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". } } ORDER BY ?instLabel
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 bd: <http://www.bigdata.com/rdf#>
#Archivi in Toscana - tutti
SELECT DISTINCT ?i ?iLabel ?iDescription ?coord ?inst ?instLabel ?instcoord ?indir ?pea
WHERE {
?i wdt:P31 wd:Q166118 .
?i (wdt:P131)* wd:Q1273 .
?i wdt:P131 ?inst .
#?inst wdt:P625 ?instcoord .
OPTIONAL { ?i wdt:P6375 ?indir . }
OPTIONAL { ?i wdt:P7764 ?pea . }
OPTIONAL { ?i wdt:P625 ?coord . }
BIND(IF(BOUND(?coord),'archiv','comune') AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
ORDER BY ?instLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coord"):::projected
v2("?i"):::projected
v4("?indir"):::projected
v3("?inst"):::projected
v1("?instLabel"):::projected
v7("?layer")
v5("?pea"):::projected
c11(["#91;AUTO_LANGUAGE#93;,it,en"]):::literal
c2(["wd:Q166118"]):::iri
c9(["bd:serviceParam"]):::iri
c4(["wd:Q1273"]):::iri
v2 --"wdt:P31"--> c2
v2 --"wdt:P131"--> c4
v2 --"wdt:P131"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P6375".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P7764".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v6
end
bind0[/"if(bound(?coord),'archiv','comune')"/]
v6 --o bind0
bind0 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end