query-2b71369e875f986906d59b70d1e37f98
Redundancies : "A subclass of B subclass of C" and "A subclass of C" 09:25, 5 August 2019 (UTC) pagetalk / TomT0m author The "A subclass of C" statement is probably redundant in those cases, or an indication of a mess. shown by this query"A subclass of B subclass of C subclass of D" and … "A subclass of D"
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 ?class ?classLabel ?intermediaire ?intermediaireLabel ?intermediaire2 ?intermediaire2Label ?parent ?parentLabel {
?class (^wdt:P279)* wd:Q22001389 ;
wdt:P279 ?parent .
?class wdt:P279 ?intermediaire . ?intermediaire wdt:P279 ?intermediaire2 . ?intermediaire2 wdt:P279 ?parent .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?class"):::projected
v3("?intermediaire"):::projected
v4("?intermediaire2"):::projected
v2("?parent"):::projected
c4(["bd:serviceParam"]):::iri
c6(["en"]):::literal
c1(["wd:Q22001389"]):::iri
c1 --"wdt:P279"--> v1
v1 --"wdt:P279"--> v2
v1 --"wdt:P279"--> v3
v3 --"wdt:P279"--> v4
v4 --"wdt:P279"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end