Wikidata:WikiProject Ontology/Problems/Anti-pattern 1

Anti-pattern 1 edit

An 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.

The most general form to find these problems is:

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)
Try it!

but this general query times out. Some of the specific autogenerated lists may be empty also due to time-outs; when the queries work they all show many problems of this sort.