query-1fa1885a09e210ca16d723b39d5358b9
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?item (SAMPLE(?div1) as ?div1) (SAMPLE(?div2) as ?div2)
WHERE
{
?item wdt:P17 wd:Q148 .
?item wdt:P31/wdt:P279* wd:Q32815 .
OPTIONAL {
?item wdt:P131* ?div1.
?div1 wdt:P31/wdt:P279* wd:Q9316670.
}
OPTIONAL {
?item wdt:P131* ?div2.
?div2 wdt:P31/wdt:P279* wd:Q13396669.
}
} GROUP BY ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?div1"):::projected
v4("?div2"):::projected
v1("?item"):::projected
a1((" "))
a2((" "))
a3((" "))
c2(["wd:Q148"]):::iri
c5(["wd:Q32815"]):::iri
c7(["wd:Q9316670"]):::iri
c8(["wd:Q13396669"]):::iri
v1 --"wdt:P17"--> c2
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v4
v4 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v4
v4 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c8
end
bind2[/"sample(?div1)"/]
v4 --o bind2
bind2 --as--o v4
bind3[/"sample(?div2)"/]
v4 --o bind3
bind3 --as--o v4