Wikidata:Item classification
This page is a work in progress, not an article or policy, and may be incomplete and/or unreliable.
Please offer suggestions on the talk page. বাংলা | català | čeština | Deutsch | English | español | فارسی | suomi | français | हिन्दी | magyar | italiano | 日本語 | 한국어 | Lëtzebuergesch | latviešu | македонски | Bahasa Melayu | မြန်မာဘာသာ | norsk bokmål | Nederlands | ਪੰਜਾਬੀ | polski | پنجابی | português | português do Brasil | română | Scots | shqip | slovenščina | српски / srpski | svenska | Türkçe | русский | українська | 中文(简体) | +/− |
This page documents classification of items in Wikidata.
Introduction
[edit]Classification is the act of grouping real world objects into classes of object. An introduction to classification in Wikidata can be found on Help:Classification.
This page gives more insight and some details about classification in Wikidata and some statistics.
Background
[edit]Classification in Wikidata is based (however loosely) on an external standard called RDF Schema. If in doubt, this standard, and its specification, is a good starting point for clarifying questions you may have about classification.
RDF Schema classification superficially resembles that of object-oriented programming languages such as Java.[1] However, you should be aware that they are not the same. The key feature of object-oriented programming is "inheritance". RDF Schema has no such concept of inheritance; instances in RDF Schema, and thus in Wikidata, do not automatically inherit all statements made about their parent classes. If, for example, we have an item for a class called "cat
", and the page for that item states that "cat has whiskers
", it is not the case that any instance of "cat
" automatically also "has whiskers
". Any statements made on the page of a class item describe the class as an item in and of itself, not as an abstract class whose attributes are automatically passed on to its instances. Hence you can state on the page of the "cat
" class item that "cat is a species
" without worrying that this statement will be passed on to the instances of the "cat
" class; an individual cat such as Grumpy Cat is of course not a species in and of itself—it is an individual of the cat species.
These same considerations also apply to subclassing; any statements made about a parent class (or "superclass") of another class do not automatically pass on its subclasses. Thus, if "cat has whiskers
", and "domestic short-haired cat is a subclass of cat
", it does not automatically follow that "domestic short-haired cat has whiskers
". Again, this helps ensure that if, for example, "cat is a species
", then it does not follow that "domestic short-haired cat is a species
"; a domestic short-haired cat is merely an outwardly variant of the cat species and must not automatically be assumed to be a species in and of itself.
It is, however, the case that all instances of any given class are also instances of the superclasses of that class.[2] Thus, if for example "domestic short-haired cat is a subclass of cat
" and "Meow is an instance of domestic short-haired cat
", then it automatically does follow that "Meow is an instance of cat
".
The implications of this model of classification is that while statements about a class are not inherited by its instances and subclasses, properties that are valid for a given class (see Wikidata:Domain and Wikidata:Range) are also automatically valid for all subclasses and instances of that class.
Note, however, that the description given here in this section is of the idealized formalism pronounced by the RDF Schema standard. It may or may not be followed in detail in Wikidata.
Classification in Wikidata
[edit]Item classification in Wikidata is done via non-domain specific properties:
Wikidata Property | W3C RDF Schema 1.1 | Wikidata Property Constraint | Wikidata:Database reports |
---|---|---|---|
subclass of (P279) | rdfs:subClassOf | target item has to be a subclass of (P279) entity (Q35120) | Constraint violations/P279 |
instance of (P31) | rdf:type | target item has to be a subclass of (P279) entity (Q35120) | Constraint violations/P31 |
Each, via a property constraint, requires entity (Q35120) to be the root item for any item that uses one these properties.
Both properties and a third property, part of (P361), are listed at Help:Basic membership properties.
Domain-specific classification properties
[edit]Some domain-specific classification properties exist
Property | Subproperty of * | Status | Comment |
---|---|---|---|
parent taxon (P171) | P279 | existing | several constraint violations are caused by items that use this property, or are in the subclass-tree of such items. |
vessel class (P289) | P31 | existing | had been proposed for deletion |
- "Subproperty of" is used in a loose, informal sense here. The listed properties not technically subproperties of P31 or P279. P31 (instance of) and P279 (subclass of) have the semantics of rdf:type and rdfs:subClassOf, two reserved properties in OWL 2 DL, the preferred language for Semantic Web ontologies. Although currently unsupported in Wikidata, subproperty of is also a reserved property: rdfs:subPropertyOf. OWL 2 DL prohibits statements like "food type subproperty of P31" or "car type subproperty of P279" (details here), so subproperties of P31 or P279 are invalid.
Database reports
[edit]- Wikidata:Database reports/Item classification
- Wikidata:Database reports/Constraint violations/P279
- As of 2014-07-10 692 unrooted subclasses are instance of Wikimedia category (Q4167836), i.e. they are Wikimedia specific items. WDQ: claim[279] and noclaim[279:(tree[35120][][279])] and claim[31:4167836] [1].
- Wikidata:Database reports/Constraint violations/P31
Templates
[edit]- Template:classification - shows a superclass tree based on subclass of (P279) and a link to the subclass tree
- Template:Item documentation includes Template:Item classification and provides extra links, e.g. to a lists of instances
- Template:Type (instance of)
- Template:SubType (subclass of)
Help
[edit]See also
[edit]Literature
[edit]- W3C Working Group Note: Representing Classes As Property Values on the Semantic Web.