OWL
Overview
The Web Ontology Language, OWL, is an extension to RDFS that introduces several more constructs for organizing and inferring information. The entirety of the so-called "OWL universe" is divided into three parts - individuals, classes, and properties.
Some general-purpose constructs that aren't as easily categorized as others include:
owl:Class- This is a
rdfs:subClassOf rdfs:Classused in most OWL models.
- This is a
owl:DatatypeProperty- Indicates the value of the property should be an item of some XML data type.
owl:ObjectProperty- Indicates the value of the property should be an RDF resource.
Relationships
Inverse
The owl:inverseOf property allows inferring triples that work in the inverse direction. It can be understood by the following SPARQL construct:
CONSTRUCT { ?y ?Q ?x. }
WHERE { ?x ?P ?y. ?P owl:inverseOf ?Q. }
Symmetry
In the special case in which a property is its own inverse, OWL introduces the owl:SymmetricProperty class, understood as:
CONSTRUCT { ?p owl:inverseOf ?p. }
WHERE { ?p a owl:SymmetricProperty. }
Transitivity
The OWL owl:TransitiveProperty is understood as:
CONSTRUCT { ?x ?p ?z . }
WHERE { ?x ?p ?y.
?y ?p ?z.
?p a owl:TransitiveProperty. }
Equivalence
Classes
Two classes are said to be equivalent if their class extensions contain the same exact set of members. In RDFS, this is expressed as
?A rdf:subClassOf ?B
?B rdf:subClassOf ?A
In OWL, this is expressed simply as:
?A owl:equivalentClass ?B
Properties
When two properties are equivalent, we expect that in any triple that uses one as a predicate, the other can be substituted. In RDFS, this is expressed as:
?P rdfs:subPropertyOf ?Q
?Q rdfs:subPropertyOf ?Q
In OWL, this is expressed simply as:
?P owl:equivalentProperty ?Q
Individuals
Members of classes are called individuals. We can indicate two references to individuals actually refer to the same individual using the owl:sameAs construct. In SPARQL,
CONSTRUCT { ?x ?p ?o. }
WHERE { ?y ?p ?o. ?x owl:sameAs ?y. }
CONSTRUCT { ?s ?x ?o. }
WHERE { ?s ?y ?o. ?x owl:sameAs ?y. }
CONSTRUCT { ?s ?p ?x. }
WHERE { ?s ?p ?y. ?x owl:sameAs ?y. }
The reverse direction is handled by noting owl:sameAs is a owl:SymmetricProperty.
The owl:differentFrom property states two individuals are semantically distinct. The owl:AllDifferent class allows stating multiple individuals are all distinct from one another.
Functional Properties
OWL describes a property as functional if it can only take one value per individual. The owl:FunctionalProperty is described in SPARQL as:
CONSTRUCT { ?a owl:sameAs ?b . }
WHERE { ?p a owl:FunctionalProperty .
?x ?p ?a .
?x ?p ?b . }
Similarly, the owl:InverseFunctionalProperty is described as:
CONSTRUCT { ?a owl:sameAs ?b . }
WHERE { ?p a owl:InverseFunctionalProperty .
?a ?p ?x .
?b ?p ?x . }
Restrictions
The owl:Restriction is a construct in OWL used for creating new class descriptions based on descriptions of the prospective members of a class. The owl:onProperty construct specifies what property is to be used in the definition of the restriction class.
Value Constraints
There exist three value constraints used in conjunction with restrictions. Each is linked to a restriction class, constraining what members make up the class based on property values.
Existential Constraint
The existential constraint, corresponding to owl:someValuesFrom, is used to produce a restriction of the form "All individuals for which at least one value of the property P comes from class C". For example:
[ a owl:Restriction ;
owl:onProperty :hasParent ;
owl:someValuesFrom :Physician ]
The above defines a restriction class containing as members those with at least one parent who is a :Physician.
Universal Constraint
The universal constraint, corresponding to owl:allValuesFrom, is used to produce a restriction of the form "All individuals for which every value of the property P comes from class C". For example:
[ a owl:Restriction ;
owl:onProperty :hasParent ;
owl:allValuesFrom :Physician ]
The above defines a restriction class containing as members those with each of their parents (of which there could be :Physician.
Equality Constraint
The equality constraint, corresponding to owl:hasValue, is used to produce a restriction of the form "All individuals that have the value A for the property P". For example:
[ a owl:Restriction ;
owl:onProperty :hasParent ;
owl:hasValue :Josh ]
The above defines a restriction class containing as members those with parent :Josh.
Enumerations
The owl:oneOf property takes a list of classes as a value and asserts that a resource is semantically equivalent to one of the options.
O1 a owl:Class ;
owl:oneOf (ns:A ns:B ...) .
Cardinality
The owl:cardinality construct is used to specify the number of distinct values a property can have for any subject. owl:minCardinality and owl:maxCardinality define lower and upper bounds respectively. For example:
[ a owl:Restriction;
owl:onProperty :P ;
owl:cardinality 5
] .
Qualification
A qualified cardinality restriction allows including an additional reference, using owl:onClass, to a specific subject. For example:
[ a owl:Restriction;
owl:onClass :C ;
owl:onProperty :P ;
owl:qualifiedCardinality 5
] .
Set Operations
Union
The owl:unionOf property take a list of classes as a value. The union of two or more classes includes the members of all those classes combined.
U1 a owl:Class ;
owl:unionOf (ns:A ns:B ...) .
Intersection
The owl:intersectionOf property take a list of classes as a value. The intersection of two or more classes includes the members that belong to every one of the classes.
I1 a owl:Class ;
owl:intersectionOf (ns:A ns:B ...) .
Complement
The owl:complementOf property takes another class as a value. The complement of a class includes every resource that does not belong to the value class.
C1 owl:complementOf C2 .
Disjointedness
The owl:disjointWith property indicates that the class extensions of two classes do not overlap in any way.
C1 owl:disjointWith C2 .
The owl:AllDisjointClasses allows specifying more than two classes at a time.
Description Logic
OWL 2 introduces a subset of OWL called OWL DL (OWL Description Logic). It is the largest subset of OWL that retains decidability. Additional constructs are present with respect to the DL subset:
owl:Nothing- Is the class corresponding to the empty set. An empty class is said to be unsatisfiable.
owl:Thing- The class whose extension comprises all individuals of the OWL universe.
owl:bottomDataProperty- The datatype property that does not connect any individual with a literal.
owl:topDataProperty- The datatype property that connects all possible individuals with all literals.
owl:bottomObjectProperty- The object property that does not connect any pair of individuals.
owl:topObjectProperty- The object property that connects all possible pairs of individuals.