OWL Example with RDF Graph
Let us illustrate the use of OWL vocabulary on an example ontology (inspired by OWL Pizzas): "Pizza has PizzaBase as its base; Pizza is disjoint with PizzaBase; NonVegetarianPizza is exactly Pizza that is not VegetarianPizza; isIngredientOf is a transitive property; isIngredientOf is inverse of hasIngredient". The example expressed in the description logic syntax follows:
The same example expressed using OWL Abstract Syntax formulates the same information using LISP-like notation, and in addition uses URI for identification of all classes and properties:
Namespace(p = <http://example.com/pizzas.owl#>) Ontology( <http://example.com/pizzas.owl#> Class(p:Pizza partial restriction(p:hasBase someValuesFrom(p:PizzaBase))) DisjointClasses(p:Pizza p:PizzaBase) Class(p:NonVegetarianPizza complete intersectionOf(p:Pizza complementOf(p:VegetarianPizza))) ObjectProperty(p:isIngredientOf Transitive inverseOf(p:hasIngredient)) )
When embedding the example OWL ontology to RDF, every statement must be
converted to triples - see the figure below. For example, the
∃R.C restriction is formed by anonymous resource of type
owl:Restriction. This anonymous resource (blank node) is a subject for two
owl:someValuesFrom that relate the
restriction relation (property) and concept (class). The anonymous resource is
then used to be related to the constrained class (by
our case). The example expressed in triples and serialized in N3 follows:
Pizza OWL ontology expressed in RDF triples
@prefix : <http://example.com/pizzas.owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . :Pizza rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :hasBase ; owl:someValuesFrom :PizzaBase ] ; owl:disjointWith :PizzaBase . :NonVegetarianPizza owl:equivalentClass [ owl:intersectionOf ( [owl:complementOf :VegetarianPizza] :Pizza ) ] . :isIngredientOf a owl:TransitiveProperty , owl:ObjectProperty ; owl:inverseOf :hasIngredient .
The OWL DL uses all the SHOIN(D) features. The overview of the possible descriptions, data ranges, properties, individuals and data values is shown in the table in the previous page. The DL description of the semantics was introduced in one of the previous sections. The domain of individuals in the model is ΔI, the domain of data values ΔID was added to specify semantics of data ranges.
The ontology is formed by constraints on a model. The axioms that can be used to constrain a model are summarized in the table in the previous page.
In addition to the standard description logic features there are so called
annotation properties added. In addition to RDFS annotation properties (such as
rdfs:label) there are properties that allow to
state for example version information, state compatibility or incompatibility
between ontologies. There is also a construct
owl:imports that allows to
state that an ontology imports another ontology.