Wikidata:WikiProject Ontology/Problems/Anti-pattern 2

Anti-pattern 2Edit

This is where a subclass C has two superclasses A and B that are related to one another by an instance of relationship.

The general form for this query (which again times out) is:

select ?classA ?classALabel (count(*) as ?count) WHERE {
    ?classC wdt:P279+ ?classA ;
            wdt:P279+ ?classB .
    ?classB wdt:P31 ?classA .
  service wikibase:label {
     bd:serviceParam wikibase:language "en" .
    }
} group by ?classA ?classALabel order by desc(?count)

Try it!

Also note this inconclusive RFC on color class relationships from 2016 (color (Q1075) is one of the classes appearing most often in these lists).