query-6a29b123c5e122f87348631cfd6cea9b
Chybějící P131 SELECT DISTINCT ?item ?itemLabel ?okrLabel ?L1Label ?L2Label ?L3Label ?USOP WHERE { ?item wdt:P31 wd:Q811534 . ?item wdt:P17 wd:Q213 . OPTIONAL { { ?okr wdt:P31 wd:Q548611 . ?item wdt:P131 ?okr . } UNION { ?okr wdt:P31 wd:Q5119 . ?item wdt:P131 ?okr . } } OPTIONAL{?item wdt:P131 ?L1 .} OPTIONAL{?item wdt:P131/wdt:P131 ?L2 .} OPTIONAL{?item wdt:P131/wdt:P131/wdt:P131 ?L3 .} FILTER NOT EXISTS { ?item wdt:P131 ?loc } SERVICE wikibase:label { bd:serviceParam wikibase:language "cs" } } LIMIT 80
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 bd: <http://www.bigdata.com/rdf#>
# Chybějící P131
SELECT DISTINCT ?item ?itemLabel ?okrLabel ?L1Label ?L2Label ?L3Label ?USOP
WHERE
{
?item wdt:P31 wd:Q811534 .
?item wdt:P17 wd:Q213 .
OPTIONAL {
{
?okr wdt:P31 wd:Q548611 .
?item wdt:P131* ?okr .
} UNION {
?okr wdt:P31 wd:Q5119 .
?item wdt:P131* ?okr .
}
}
OPTIONAL{?item wdt:P131 ?L1 .}
OPTIONAL{?item wdt:P131/wdt:P131 ?L2 .}
OPTIONAL{?item wdt:P131/wdt:P131/wdt:P131 ?L3 .}
FILTER NOT EXISTS { ?item wdt:P131 ?loc }
SERVICE wikibase:label { bd:serviceParam wikibase:language "cs" }
}
LIMIT 80
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?L1")
v5("?L2")
v6("?L3")
v1("?item"):::projected
v2("?loc")
v3("?okr")
a1((" "))
a2((" "))
a3((" "))
c11(["cs"]):::literal
c3(["wd:Q811534"]):::iri
c5(["wd:Q213"]):::iri
c6(["wd:Q548611"]):::iri
c9(["bd:serviceParam"]):::iri
c7(["wd:Q5119"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P131"--> e0v2
e0v1("?item"):::projected
e0v2("?loc"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"wdt:P131"--> v2
v1 --"wdt:P31"--> c3
v1 --"wdt:P17"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 -."wdt:P31".-> c7
v1 --"wdt:P131"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P31"--> c6
v1 --"wdt:P131"--> v3
end
union0r <== or ==> union0l
end
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> a1
a1 --"wdt:P131"--> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> a2
a2 --"wdt:P131"--> a3
a3 --"wdt:P131"--> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end