query-38fb31d1d483c26ab8cfca452b2da410
MH en Occitanie vs Images
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?coord ?image ?layer WHERE {
{ ?item wdt:P1435 wd:Q10387575 . } UNION { ?item wdt:P1435 wd:Q10387684 . } #MH
?item wdt:P131/wdt:P131/wdt:P131 wd:Q18678265 . # en Occ
?item p:P380 []. #immeubles
?item wdt:P625 ?coord.
OPTIONAL { ?item wdt:P18 ?image. }
BIND(IF(BOUND(?image), "Avec image", "Sans image") AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?coord"):::projected
v3("?image"):::projected
v1("?item"):::projected
v4("?layer"):::projected
a3((" "))
a1((" "))
a2((" "))
c3(["wd:Q10387684"]):::iri
c2(["wd:Q10387575"]):::iri
c10(["bd:serviceParam"]):::iri
c5(["wd:Q18678265"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P1435"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P1435"--> c2
end
union0r <== or ==> union0l
end
v1 --"p:direct/P131"--> a1
a1 --"p:direct/P131"--> a2
a2 --"p:direct/P131"--> c5
v1 --"p:P380"--> a3
v1 --"p:direct/P625"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v3
end
bind0[/"if(bound(?image),'Avec image','Sans image')"/]
v3 --o bind0
bind0 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end