query-6c0060a17d855c8a1ce7ce1de753ceb8

rq turtle/ttl

Anti-pattern 1An item is an instance of a class, but is also classified (perhaps via several intermediate classes) as a subclass of the same class. This often indicates that "instance of" has been used where "subclass of" makes more sense; alternatively it may mean the class in question should be considered a metaclass whose instances are classes. There are a lot of issues like this in wikidata right now. Wikidata:WikiProject Ontology/Problems/instance and 6-level subclass of same class Wikidata:WikiProject Ontology/Problems/instance and 5-level subclass of same class Wikidata:WikiProject Ontology/Problems/instance and 4-level subclass of same class Wikidata:WikiProject Ontology/Problems/instance and 3-level subclass of same class Wikidata:WikiProject Ontology/Problems/instance and subclass of subclass of same class Wikidata:WikiProject Ontology/Problems/instance and subclass of same classThe most general form to find these problems is:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?metaclass ?metaclassLabel (count(*) as ?count) WHERE {
    ?class wdt:P31 ?metaclass ;
           wdt:P279+ ?metaclass .
  service wikibase:label {
     bd:serviceParam wikibase:language "en" .
    }
} group by ?metaclass ?metaclassLabel order by DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?class") v4("?count") v3("?metaclass"):::projected c4(["bd:serviceParam"]):::iri c6(["en"]):::literal v2 --"wdt:P31"--> v3 v2 --"wdt:P279"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind1[/"count(*)"/] bind1 --as--o v4