top
toggle:
-
Companion text and demo for ISWC 2017 poster presentation.
The concepts used in this demo are still valid, however, tools and formats have been updated. Please see ottr.xyz.
Reasonable Ontology Templates, OTTRs for short, are OWL ontology macros capable of representing ontology design patterns (ODPs) and closely integrating their use into ontology engineering. An OTTR is itself an OWL ontology or RDF graph, annotated with a special purpose OWL vocabulary. This allows OTTRs to be edited, debugged, published, identified, instantiated, combined, used as queries and bulk transformations, and maintained—all leveraging existing W3C standards, best practices and tools. We show how such templates can drive a technical framework and tools for a practical, efficient and transparent use of ontology design patterns in ontology design and instantiation.
The formal definition of ontology templates is based on description logics, while the implemented version is based on RDF graphs.
An ontology template $\mathcal T$ is a knowledge base $\boxt$ and a list of parameters $(\tpara{p_1},\ldots,\tpara{p_n})$ of distinguished concept, role, or individual names from $\boxt$. We write a template as \[ \tname{\mc{T}}(\tpara{p_1},\ldots,\tpara{p_n}):: \boxt. \] and refer to the left side as the head and the right side as the body.
For a list of parameters $(q_1,\ldots,q_n)$ we call $\tname{\mathcal T}(q_1,\ldots,q_n)$ a template instance. Intuitively, a template instance is shorthand for representing a specific occurrence or instance of a pattern. More precisely, the expansion of $\tname{\mathcal T}(q_1,\ldots,q_n)$ is the ontology $\boxt(q_1,\ldots,q_n)$ obtained by replacing each parameter occurrence of $\tpara{p_i}$ in $\boxt$ with the argument $q_i$, for all $1\leq i \leq n$.
This is a template: $$ \tname{PartOf}(\tpara{part}, \tpara{whole}) \map \{ \tpara{whole} \sqsubseteq \exists \ont{hasPart} . \tpara{part} \} $$ The name of the template is $\tname{PartOf}$. It has a single axiom knowledge base $\{\tpara{whole} \sqsubseteq \exists \ont{hasPart} . \tpara{part}\}$ where $\ont{hasPart}$ is a role name and $\tpara{part}$ and $\tpara{whole}$ are parameters.
This is an instance of the $\tname{PartOf}$ template:
$$\tname{PartOf}(\ont{SteeringWheel}, \ont{Car})$$
The instance expands to the ontology $\{ \ont{Car} \sqsubseteq
\exists \ont{hasPart} . \ont{SteeringWheel} \}$.
Note
that also $\tname{PartOf}(\tpara{part}, \tpara{whole})$ is
an instance of $\tname{PartOf}$, where the parameter names
are substituted for themselves; its ontology is $\{
\tpara{whole} \sqsubseteq \exists \ont{hasPart}
. \tpara{part} \}$.
Templates are modular: in addition to ontology axioms, a template may also contain template instances in its body. The notion of template instance expansion is then extended to a recursive operation where any template instances in the template body are expanded tail-recursively. Cyclic template definitions are not allowed.
Let $\tname{QualityValue}$ be the template
\begin{align*}
&\tname{QualityValue}(\tpara{x}, \tpara{hasQuality}, \tpara{uom}, \tpara{val}) \map \\
&\quad\{\tpara{x} \sqsubseteq \exists \tpara{hasQuality} .(\forall \ont{hasDatum} .(\exists \ont{hasUOM}
. \{\tpara{uom}\} \sqcap \exists \ont{hasValue} . \{\tpara{val}\}))\}
\end{align*}
which intuitively expresses that $\tpara{x}$ has a quality
with a given value $\tpara{val}$ with a given unit of
measurement $\tpara{uom}$.
Using this template and the $\tname{PartOf}$ template, and
fixing some of the parameters, the template
$\tname{PartLength}$ can be defined as
\begin{align*}
\tname{PartLength}(\tpara{whole}, \tpara{part}, \tpara{length})
\map \{
&\tname{PartOf}(\tpara{part}, \tpara{whole}),\\
&\tname{QualityValue}(\tpara{part}, \ont{hasLength}, \ont{meter}, \tpara{length})\}
\end{align*}
which expresses that the whole has a part with a given length measured in meters.
An example instance of the template is
$\tname{PartLength}(\ont{2CV}, \ont{SoftTop}, \ont{1.40})$
stating that (the car) 2CV has a softtop (roof) of length
1.40 meters.
The expansion of the instance is
\begin{align*}
\{ \ont{2CV} &\sqsubseteq \exists \ont{hasPart} . \ont{SoftTop},\\
\phantom{\{}\ont{SoftTop} &\sqsubseteq \exists \ont{hasLength} .(\forall \ont{hasDatum} .
(\exists \ont{hasUOM}
. \{\ont{meter}\} \sqcap \exists \ont{hasValue} . \{\ont{1.40}\}))\}\text{.}
\end{align*}
Ontology templates are adopted to the semantic web by serialising them using RDF with the OTTR OWL vocabulary defined for this task.
A template is associated with an RDF graph (document) available at the IRI of the template. (Similarly as the recommended practice for OWL ontology documents.) The RDF graph contains both the head, identifying the template and its parameters, and the body of the template. The template body may contain template instances and other ontology axioms, which are expressed using regular RDF/OWL serialisation. We differentiate between the head and the body of a template represented in RDF using the concept of outgoing graph neighbourhood, which informally are all the outgoing triples from the template and parameter individuals.
Parameters and arguments are represented as named variables and named values, respectively, where the name is represented in RDF as an IRI, and variables and values may be any RDF resource, i.e., any IRI or literal.
The $\tname{PartOf}$ template in OTTR serialisation, shown in two different variants: one specifying its parameter variables using indexed parameters and the other using an RDF list of parameter variables
.@prefix ottr: <http://ns.ottr.xyz/templates#> .
@prefix partOf: <http://www.ontologydesignpatterns.org/cp/owl/partof.owl#> .
@prefix : <http://draft.ottr.xyz/i17/partof#> .
### head:
<http://draft.ottr.xyz/i17/partof> a ottr:Template ;
ottr:hasParameter [ ottr:index 1; ottr:variable :Whole ] , # indexed parameters
[ ottr:index 2; ottr:variable :Part ] .
ottr:withVariables ( :Whole :Part ) . ## variable list
### body:
:Part a owl:Class .
:Whole a owl:Class ;
rdfs:subClassOf [ a owl:Restriction ;
owl:onProperty partOf:hasPart ; owl:someValuesFrom :Part ] .
This template is published at the IRI of the template
http://draft.ottr.xyz/i17/partof
and can be viewed in the online ontology template library
http://osl.ottr.xyz/info/?tpl=http://draft.ottr.xyz/i17/partof
.
The $\tname{PartOf}$ template in OTTR serialisation now
defined using a instance of
the ottr-owl:SubObjectSomeValuesFrom
template in the body, which expresses the
existential qualified axiom.
@prefix ottr: <http://ns.ottr.xyz/templates#> .
@prefix partOf: <http://www.ontologydesignpatterns.org/cp/owl/partof.owl#> .
@prefix ottr-owl: <http://candidate.ottr.xyz/owl/axiom/> .
@prefix : <http://draft.ottr.xyz/i17/partof#> .
### head:
<http://draft.ottr.xyz/i17/partof> a ottr:Template ;
ottr:withVariables ( :Whole :Part )
### body:
[] ottr:templateRef ottr-owl:SubObjectSomeValuesFrom ;
ottr:withValues ( :Whole partOf:hasPart :Part ) .
The OTTR library at http://library.ottr.xyz contains a set of templates that are available for use. The purpose of the library is to have a publicly available repository of templates that may be actively used in the construction of ontologies.
The library is backed by different git repositories that contain OTTR templates of different status and maturity: candidate, draft, and test. Test contains test suite templates to test the implementation of the OTTR library; draft is a sandbox area where anyone may contribute by pushing to the git repository; candidate contains templates which are relatively stable and are candidates for a standardised version. The formal relationships between these statuses and the management rules of the repositories is not yet established.
The implicit relationship between the head and the body of a template and be exploited to generate formats that represent the template head and the template body, and transformations between these formats, like XSD, XSLT, SPARQL SELECT, SPARQL CONSTRUCT and SPARQL UPDATE. We intend to add support for more formats, e.g,. graph validation formats such as SHACL and ShEx. The different formats are available from the web servlet explained below.
The web servlet located at http://osl.ottr.xyz
serves all the different formats that can be genereted from an
OTTR template, these can be found in the top right menu on each "information" page of a template, e.g.,
http://osl.ottr.xyz/info/?tpl=http://draft.ottr.xyz/i18/partof
.