query-f63939991ff89d80ee6a6fa8404b5321
Differences between queriesDisclaimer: The answers to the questions below can probably be found in the SPARQL spec, but I can't seem able to find them. . So, the first thing I tried is: (P131)located in the administrative territorial entity , but some only have (P17)country . Most of them have (Q218)Romania So, I'm trying to find all the schools in
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#>
SELECT DISTINCT ?item ?itemLabel WHERE {
?item (wdt:P31/wdt:P279*) wd:Q3914.
{
?item wdt:P17 wd:Q218.
}
UNION
{
?item wdt:P131+ wd:Q218.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "ro". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
a1((" "))
c8(["bd:serviceParam"]):::iri
c5(["wd:Q218"]):::iri
c3(["wd:Q3914"]):::iri
c10(["ro"]):::literal
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P131"--> c5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P17"--> c5
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end