In the
Semantic Web and in
knowledge representation
Knowledge representation and reasoning (KRR, KR&R, KR²) is the field of artificial intelligence (AI) dedicated to representing information about the world in a form that a computer system can use to solve complex tasks such as diagnosing a medic ...
, a metaclass is a
class
Class or The Class may refer to:
Common uses not otherwise categorized
* Class (biology), a taxonomic rank
* Class (knowledge representation), a collection of individuals or objects
* Class (philosophy), an analytical concept used differently ...
whose instances are themselves classes. Similar to their role
in programming languages, metaclasses in Semantic Web languages can have properties otherwise applicable only to individuals, while retaining the same class's ability to be classified in a concept hierarchy. This enables knowledge about instances of those metaclasses to be inferred by
semantic reasoners using statements made in the metaclass. Metaclasses thus enhance the expressivity of knowledge representations in a way that can be intuitive for users. While classes are suitable to represent a population of individuals, metaclasses can, as one of their feature, be used to represent the conceptual dimension of an ontology. Metaclasses are supported in the ontology language
OWL
Owls are birds from the order Strigiformes (), which includes over 200 species of mostly solitary and nocturnal birds of prey typified by an upright stance, a large, broad head, binocular vision, binaural hearing, sharp talons, and feathers a ...
and the data-modeling vocabulary
RDFS
RDF Schema (Resource Description Framework Schema, variously abbreviated as RDFS, , RDF-S, or RDF/S) is a set of classes with certain properties using the RDF extensible knowledge representation data model, providing basic elements for the descr ...
.
Metaclasses are often modeled by setting them as the
object
Object may refer to:
General meanings
* Object (philosophy), a thing, being, or concept
** Object (abstract), an object which does not exist at any particular time or place
** Physical object, an identifiable collection of matter
* Goal, an ai ...
of claims involving rdf:type and rdfs:subClassOf—built-in properties commonly referred to as ''instance of'' and ''subclass of''. ''Instance of'' entails that the
subject of the claim is an instance, i.e. an individual that is a member of a class. ''Subclass of'' entails that the subject is a class. In the context of ''instance of'' and ''subclass of'', the key difference between metaclasses and ordinary classes is that metaclasses are the object of ''instance of'' claims used on a class, while ordinary classes are not objects of such claims. (e.g. in a claim
Bob ''instance of'' Human
, Bob is the subject and an Instance, while the object, Human, is an ordinary class; but a further claim that
Human ''instance of'' Animal species
makes "Animal species" a metaclass because it has a member, "Human", that is also a Class).
OWL 2 DL supports metaclasses by a feature called
punning,
in which one entity is interpreted as two different types of thing—a class and an individual—depending on its syntactic context. For example, through punning, an ontology could have a concept hierarchy such as
Harry the eagle ''instance of'' golden eagle
The golden eagle (''Aquila chrysaetos'') is a bird of prey living in the Northern Hemisphere. It is the most widely distributed species of eagle. Like all eagles, it belongs to the family Accipitridae. They are one of the best-known birds ...
,
golden eagle ''subclass of'' bird
Birds are a group of warm-blooded vertebrates constituting the class Aves (), characterised by feathers, toothless beaked jaws, the laying of hard-shelled eggs, a high metabolic rate, a four-chambered heart, and a strong yet lightweig ...
, and
golden eagle ''instance of'' species
In biology, a species is the basic unit of Taxonomy (biology), classification and a taxonomic rank of an organism, as well as a unit of biodiversity. A species is often defined as the largest group of organisms in which any two individuals of ...
. In this case, the punned entity would be golden eagle, because it is represented as a class (second claim) and an instance (third claim); whereas the metaclass would be species, as it has an instance that is a class. Punning also enables other properties that would otherwise be applicable only to ordinary instances to be used directly on classes, for example "golden eagle ''conservation status''
least concern
A least-concern species is a species that has been categorized by the International Union for Conservation of Nature (IUCN) as evaluated as not being a focus of species conservation because the specific species is still plentiful in the wild. Th ...
."
Having arisen from the fields of
knowledge representation
Knowledge representation and reasoning (KRR, KR&R, KR²) is the field of artificial intelligence (AI) dedicated to representing information about the world in a form that a computer system can use to solve complex tasks such as diagnosing a medic ...
,
description logic and
formal ontology
In philosophy, the term formal ontology is used to refer to an ontology defined by axioms in a formal language with the goal to provide an unbiased (domain- and application-independent) view on reality, which can help the modeler of domain- or ...
, Semantic Web languages have a closer relationship to
philosophical ontology than do conventional programming languages such as
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
or
Python. Accordingly, the nature of metaclasses is informed by philosophical notions such as
abstract objects
In metaphysics, the distinction between abstract and concrete refers to a divide between two types of entities. Many philosophers hold that this difference has fundamental metaphysical significance. Examples of concrete objects include plants, hum ...
, the
abstract and concrete
In metaphysics, the distinction between abstract and concrete refers to a divide between two types of entities. Many philosophers hold that this difference has fundamental metaphysical significance. Examples of concrete objects include plants, ...
, and
type-token distinction. Metaclasses permit concepts to be construed as tokens of other concepts while retaining their ontological status as types. This enables types to be enumerated over, while preserving the ability to inherit from types. For example, metaclasses could allow a machine reasoner to infer from a human-friendly ontology how many
elements
Element or elements may refer to:
Science
* Chemical element, a pure substance of one type of atom
* Heating element, a device that generates heat by electrical resistance
* Orbital elements, parameters required to identify a specific orbit of ...
are in the
periodic table
The periodic table, also known as the periodic table of the (chemical) elements, is a rows and columns arrangement of the chemical elements. It is widely used in chemistry, physics, and other sciences, and is generally seen as an icon of ...
, or, given that
number of protons is a property of chemical element and isotopes are a subclass of elements, how many protons exist in the isotope
hydrogen-2
Deuterium (or hydrogen-2, symbol or deuterium, also known as heavy hydrogen) is one of two stable isotopes of hydrogen (the other being protium, or hydrogen-1). The nucleus of a deuterium atom, called a deuteron, contains one proton and one ...
.
Metaclasses are sometime organized by levels, in a similar way to the simple Theory of types where classes that are not metaclasses are assigned the first level, classes of classes in the first level are in the second level, classes of classes in the second level on the next and so on.
Examples
Following the
type-token distinction, real world objects such as
Abraham Lincoln
Abraham Lincoln ( ; February 12, 1809 – April 15, 1865) was an American lawyer, politician, and statesman who served as the 16th president of the United States from 1861 until his assassination in 1865. Lincoln led the nation thro ...
or the planet
Mars
Mars is the fourth planet from the Sun and the second-smallest planet in the Solar System, only being larger than Mercury. In the English language, Mars is named for the Roman god of war. Mars is a terrestrial planet with a thin atmos ...
are regrouped into classes of similar objects. Abraham Lincoln is said to be an ''instance of'' human, and Mars is an ''instance of'' planet. This is a kind of
is-a
In knowledge representation, object-oriented programming and design (see object-oriented program architecture), is-a (is_a or is a) is a subsumption relationship between abstractions (e.g. types, classes), wherein one class ''A'' is a subclas ...
relationship. Metaclasses are class of classes, such as for example the
nuclide
A nuclide (or nucleide, from nucleus, also known as nuclear species) is a class of atoms characterized by their number of protons, ''Z'', their number of neutrons, ''N'', and their nuclear energy state.
The word ''nuclide'' was coined by Truma ...
concept. In chemistry,
atom
Every atom is composed of a nucleus and one or more electrons bound to the nucleus. The nucleus is made of one or more protons and a number of neutrons. Only the most common variety of hydrogen has no neutrons.
Every solid, liquid, gas ...
s are often classified as
elements and, more specifically,
isotope
Isotopes are two or more types of atoms that have the same atomic number (number of protons in their nuclei) and position in the periodic table (and hence belong to the same chemical element), and that differ in nucleon numbers ( mass number ...
s. The glass of water one last drank has many hydrogen atoms, each of which is an ''instance of''
hydrogen
Hydrogen is the chemical element with the symbol H and atomic number 1. Hydrogen is the lightest element. At standard conditions hydrogen is a gas of diatomic molecules having the formula . It is colorless, odorless, tasteless, non-toxic ...
.
Hydrogen
Hydrogen is the chemical element with the symbol H and atomic number 1. Hydrogen is the lightest element. At standard conditions hydrogen is a gas of diatomic molecules having the formula . It is colorless, odorless, tasteless, non-toxic ...
itself, a class of atoms, is an ''instance of''
nuclide
A nuclide (or nucleide, from nucleus, also known as nuclear species) is a class of atoms characterized by their number of protons, ''Z'', their number of neutrons, ''N'', and their nuclear energy state.
The word ''nuclide'' was coined by Truma ...
. Nuclide is a class of classes, hence a metaclass.
Implementations
RDF and RDFS
In
RDF, the property is used to state that a resource is an instance of a class.
This enables metaclasses to be easily created by using in a chain-like fashion. For example, in the two
triples
Harry the eagle rdf:type golden eagle
golden eagle rdf:type species
the resource is a metaclass, because is used as a class in the first statement and the class is said to be an instance of the class in the second statement.
RDF also provides as a way to create properties beyond those defined in the built-in vocabulary. Properties can be used directly on metaclasses, for example "", where is a property defined via and is a metaclass per the preceding example above.
RDFS
RDF Schema (Resource Description Framework Schema, variously abbreviated as RDFS, , RDF-S, or RDF/S) is a set of classes with certain properties using the RDF extensible knowledge representation data model, providing basic elements for the descr ...
, an extension of RDF, introduced and and enriched how vocabularies can classify concepts.
Whereas enables vocabularies to represent
instantiation
Instantiation or instance may refer to:
Philosophy
* A modern concept similar to ''participation'' in classical Platonism; see the Theory of Forms
* The instantiation principle, the idea that in order for a property to exist, it must be had by ...
, the property enables vocabularies to represent
subsumption
Subsumption may refer to:
* A minor premise in symbolic logic (see syllogism)
* The Liskov substitution principle in object-oriented programming
* Subtyping in programming language theory
* Subsumption architecture in robotics
* A subsumption rel ...
. RDFS thus makes it possible for vocabularies to represent
taxonomies, also known as subsumption hierarchies or concept hierarchies, which is an important addition to the
type–token distinction
The type–token distinction is the difference between naming a ''class'' (type) of objects and naming the individual ''instances'' (tokens) of that class. Since each type may be exemplified by multiple tokens, there are generally more tokens than ...
made possible by RDF.
Notably, the resource is an instance of itself,
demonstrating both the use of metaclasses in the language's internal implementation and a
reflexive usage of . RDFS is its own
metamodel
OWL
In some OWL flavors like
OWL1-DL, entities can be either classes or instances, but cannot be both. This limitations forbids metaclasses and
metamodeling
A metamodel or surrogate model is a model of a model, and metamodeling is the process of generating such metamodels. Thus metamodeling or meta-modeling is the analysis, construction and development of the frames, rules, constraints, models and ...
.
This is not the case in the OWL1 full flavor, but this allows the model to be computationally undecidable.
In
OWL2, metaclasses can implemented with ''punning'', that is a way to treat classes as if they were individuals.
Other approaches have also been proposed and used to check the properties of
ontologies
In computer science and information science, an ontology encompasses a representation, formal naming, and definition of the categories, properties, and relations between the concepts, data, and entities that substantiate one, many, or all domains ...
at a meta level.
Punning
OWL 2 supports metaclasses through a feature called ''punning''. In metaclasses implemented by punning, the same subject is interpreted as two fundamentally different types of thing—a class and an individual—depending on its syntactic context. This is similar to a
pun
A pun, also known as paronomasia, is a form of word play that exploits multiple meanings of a term, or of similar-sounding words, for an intended humorous or rhetorical effect. These ambiguities can arise from the intentional use of homophoni ...
in natural language, where different senses of the same word are emphasized to illustrate a point. Unlike in natural language, where puns are typically used for comedic or rhetorical effect, the main goal of punning in Semantic Web technologies is to make concepts easier to represent, closer to how they are discussed in everyday speech or academic literature.
Protégé
In the ontology editor
Protégé
Mentorship is the influence, guidance, or direction given by a mentor. A mentor is someone who teaches or gives help and advice to a less experienced and often younger person. In an organizational setting, a mentor influences the personal and p ...
, metaclasses are templates for other classes who are their instances.
[ §6.1 summary of the RDFS model]
Metaclass classification
an example of ontology with a first metaclass order: the classification of some chemical atoms
Some ontologies like the
Cyc AI project ontology classifies classes and meta-classes themselves
in their ontologies. Classes are divided into "fixed order classes" and "variable order classes". In the case of the former, an order is attributed for metaclasses by measuring the distance to individuals with respect to the number of "instance of" triples that are necessary to find an individual. Classes that are not metaclasses are classes of individuals, so their order is "1". Metaclasses that are classes of first order classes' order is "2", and so on. Variable order metaclasses, on the other hand, can have instances, one example of variable order metaclass is the class of all fixed order classes.
See also
*
Metaclass
In object-oriented programming, a metaclass is a class whose instances are classes. Just as an ordinary class defines the behavior of certain objects, a metaclass defines the behavior of certain classes and their instances. Not all object-orient ...
*
class (knowledge representation)
In knowledge representation, a class is a collection of individuals or objects. A class can be defined either by extension (specifying members), or by intension (specifying conditions), using what is called in some ontology languages like OWL. A ...
References
{{reflist
Ontology languages
Web Ontology Language
Resource Description Framework