query-b1ac8635e93aefa4af94ad6df020fe0c
Nonoumasy
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#>
SELECT ?palace ?palaceLabel (SAMPLE(?P18_image) AS ?image_from_Wikidata) (SAMPLE(?Commons_image) AS ?image_from_Commons) ?coords
WHERE
{
{
SELECT ?palace ?palaceLabel ?P18_image ?coords
WHERE
{
SERVICE <https://query.wikidata.org/sparql>
{
?palace wdt:P31 wd:Q16560;
wdt:P17 wd:Q45.
OPTIONAL { ?palace wdt:P625 ?coords. }
OPTIONAL { ?palace wdt:P18 ?P18_image. }
OPTIONAL { ?palace rdfs:label ?palaceLabel. FILTER (LANG(?palaceLabel) = "pt") }
}
}
} OPTIONAL { ?Commons_image wdt:P180 ?palace. }
}
GROUP BY ?palace ?palaceLabel ?coords
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?Commons_image"):::projected
v4("?P18_image"):::projected
v3("?coords"):::projected
v7("?image_from_Commons")
v6("?image_from_Wikidata")
v2("?palace"):::projected
v1("?palaceLabel"):::projected
c4(["wd:Q16560"]):::iri
c6(["wd:Q45"]):::iri
subgraph s1["https://query.wikidata.org/sparql"]
style s1 stroke-width:4px;
v2 --"wdt:P31"--> c4
v2 --"wdt:P17"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P18".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v1
end
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P180".-> v2
end
bind2[/"sample(?P18_image)"/]
v4 --o bind2
bind2 --as--o v6
bind3[/"sample(?Commons_image)"/]
v5 --o bind3
bind3 --as--o v7