query-fd9e175920956523ea69348f75758d96
Propertiesinstance of (P31)image (P18)located in the administrative territorial entity (P131)location (P276)country (P17)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#defaultView:Table
SELECT DISTINCT ?socLabel ?soc ?socURI ?socLoc WHERE {
{ {?soc wdt:P31 wd:Q12160242 } } .
optional {?soc rdfs:label ?socLabel. FILTER(LANG(?socLabel) = "en").}.
optional { ?soc wdt:P18 ?socURI } .
optional { ?soc wdt:P131 ?socLocAQ. ?socLocAQ rdfs:label ?socLocA. FILTER(LANG(?socLocA) = "en"). } .
optional { ?soc wdt:P276 ?socLocPQ. ?socLocPQ rdfs:label ?socLocP. FILTER(LANG(?socLocP) = "en"). } .
optional { ?soc wdt:P17 ?socCountryQ. ?socCountryQ rdfs:label ?socCountry. FILTER(LANG(?socCountry) = "en"). } .
BIND(IF(BOUND(?socLocP),?socLocP,?socLocA) AS ?socLoc).
BIND(IF(BOUND(?socLoc),?socLoc,?socCountry) AS ?socLoc).
} LIMIT 3000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?soc"):::projected
v1("?socCountry")
v9("?socCountryQ")
v4("?socLabel"):::projected
v11("?socLoc"):::projected
v3("?socLocA")
v7("?socLocAQ")
v2("?socLocP")
v8("?socLocPQ")
v6("?socURI"):::projected
c3(["wd:Q12160242"]):::iri
v5 --"wdt:P31"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P18".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P131".-> v7
v7 --"rdfs:label"--> v3
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P276".-> v8
v8 --"rdfs:label"--> v2
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P17".-> v9
v9 --"rdfs:label"--> v1
end
bind0[/"if(bound(?socLocP),?socLocP,?socLocA)"/]
v2 --o bind0
v3 --o bind0
bind0 --as--o v11
bind1[/"if(bound(?socLoc),?socLoc,?socCountry)"/]
v11 --o bind1
v1 --o bind1
bind1 --as--o v11