query-6c0060a17d855c8a1ce7ce1de753ceb8
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
- https://query.wikidata.org/sparql
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
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Ontology/Problems
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Ontology/Problems/Anti-pattern_1