query-e021c23c2c170cdaeada894b97d61c42
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
#defaultView:Map{"hide":["?rgb","?layer"]}
SELECT ?item ?coord ?en ?fr ?layer ?rgb WHERE {
?item wdt:P17 wd:Q16;
(wdt:P131*) wd:Q1965;
wdt:P625 ?coord.
{
{
?en schema:about ?item;
schema:isPartOf <https://en.wikipedia.org/>.
}
UNION
{
?fr schema:about ?item;
schema:isPartOf <https://fr.wikipedia.org/>.
}
}
BIND (if(BOUND(?en) && BOUND(?fr),"ff0000",if(BOUND(?en),"00ff00",if(BOUND(?fr),"0000FF","000000" ))) as ?rgb) # set the dot colour
BIND (if(BOUND(?en) && BOUND(?fr),"EN & FR",if(BOUND(?en),"EN",if(BOUND(?fr),"FR","NIL" ))) as ?layer) # set the layer
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?coord"):::projected
v3("?en"):::projected
v4("?fr"):::projected
v1("?item"):::projected
v6("?layer"):::projected
v5("?rgb"):::projected
c2(["wd:Q16"]):::iri
c8([https://en.wikipedia.org/]):::iri
c4(["wd:Q1965"]):::iri
c9([https://fr.wikipedia.org/]):::iri
v1 --"wdt:P17"--> c2
v1 --"wdt:P131"--> c4
v1 --"wdt:P625"--> v2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"schema:about"--> v1
v4 --"schema:isPartOf"--> c9
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"schema:about"--> v1
v3 --"schema:isPartOf"--> c8
end
union0r <== or ==> union0l
end
bind0[/"if(bound(?en)bound(?fr),'ff0000',if(bound(?en),'00ff00',if(bound(?fr),'0000FF','000000')))"/]
v3 --o bind0
v4 --o bind0
bind0 --as--o v5
bind1[/"if(bound(?en)bound(?fr),'EN & FR',if(bound(?en),'EN',if(bound(?fr),'FR','NIL')))"/]
v3 --o bind1
v4 --o bind1
bind1 --as--o v6