query-7d1f2e3eea6c07c03a1591ea03cc751d
TODO
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 ?tournament ?tournamentLabel ?error WHERE {
{
?tournament wdt:P31 wd:Q47358534 .
MINUS { ?tournament (wdt:P31|wdt:P3450)/wdt:P279* wd:Q7700500 }
BIND('missing subclass' AS ?error) .
} UNION {
?tournament (wdt:P31|wdt:P3450)/wdt:P279* wd:Q7700500 . # also with wdt:P31/wdt:P279 and wdt:P31/wdt:P279/wdt:P279; mind that there are some special cases
MINUS { ?tournament wdt:P31 wd:Q47358534 }
MINUS { ?tournament wdt:P31 wd:Q50301185 }
BIND('missing instance_of' AS ?error) .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,it,es,de,fr". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?error"):::projected
v1("?tournament"):::projected
a1((" "))
a2((" "))
c2(["wd:Q47358534"]):::iri
c8(["bd:serviceParam"]):::iri
c6(["wd:Q50301185"]):::iri
c5(["wd:Q7700500"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en,it,es,de,fr"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P3450"--> a2
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a2
end
union1r <== or ==> union1l
end
a2 --"wdt:P279"--> c5
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P31"--> c2
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P31"--> c6
end
bind2[/"'missing instance_of'"/]
bind2 --as--o v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c2
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P3450"--> a1
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a1
end
union2r <== or ==> union2l
end
a1 --"wdt:P279"--> c5
end
bind4[/"'missing subclass'"/]
bind4 --as--o v3
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end