query-21ff7508614e0bc4f69ec9109838cfd9
Toscana
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#>
#defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?inst ?coord ?img ?com ?gmp ?tra ?layer
WHERE {
?item (wdt:P131)* wd:Q1273 .
?item wdt:P31 ?inst .
{ ?item (wdt:P31/wdt:P279*) wd:Q33506 . } UNION { ?item wdt:P31 wd:Q839954 . }
?item wdt:P625 ?coord .
OPTIONAL {?item wdt:P18 ?img}
OPTIONAL {?item wdt:P373 ?com}
OPTIONAL {?item wdt:P3749 ?gmp}
OPTIONAL {?item wdt:P3134 ?tra}
BIND(IF(BOUND(?gmp) && BOUND(?tra),"gmp & tra exist",IF(BOUND(?tra),"tra exists",IF(BOUND(?gmp),"gmp exists","none"))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?com"):::projected
v3("?coord"):::projected
v6("?gmp"):::projected
v4("?img"):::projected
v2("?inst"):::projected
v1("?item"):::projected
v8("?layer"):::projected
v7("?tra"):::projected
a1((" "))
c15(["#91;AUTO_LANGUAGE#93;,it,en"]):::literal
c5(["wd:Q33506"]):::iri
c6(["wd:Q839954"]):::iri
c13(["bd:serviceParam"]):::iri
c2(["wd:Q1273"]):::iri
v1 --"wdt:P131"--> c2
v1 --"wdt:P31"--> v2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c6
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c5
end
union0r <== or ==> union0l
end
v1 --"wdt:P625"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P373".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3749".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3134".-> v7
end
bind0[/"if(bound(?gmp)bound(?tra),'gmp & tra exist',if(bound(?tra),'tra exists',if(bound(?gmp),'gmp exists','none')))"/]
v6 --o bind0
v7 --o bind0
bind0 --as--o v8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end