<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Reasonable Ontology Templates: APIs for OWL</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Martin G. Skjaeveland</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Henrik Forssell</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Johan W. Klüwer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Lupp</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Evgenij Thorstensen</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Arild Waaler</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>DNV GL</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Informatics, University of Oslo</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>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.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Ontology-based methods have matured to where they offer knowledge workers practical
solutions for data management. In particular, tools that support W3C recommendations,
such as reasoning tools for OWL ontologies, are sufficiently stable and efficient to
allow wide-scale industrial use. However, from the perspective of product vendors
and consultancy companies in the IT industry, ontologies are still viewed as a fringe
technology. Hence ontology-based solutions are rarely proposed to enterprise customers,
and support from the software industry is limited. One factor that impedes uptake is the
high cost of establishing and maintaining a high-quality ontology. In part this is due to
the scarcity of ontology experts, with availability in most cases below critical mass, and
the lack of abstraction mechanisms and tool supported methods for applying ontology
design patterns ODPs [2] in ontology engineering. Efficient tool support is imperative to
industrial scale deployment of ontology-based methods.</p>
      <p>The work reported on in this paper has the potential to remedy the situation;
Reasonable Ontology Templates (OTTRs) [6, An extended version of the current paper] are
simple, but powerful, templates or macros for ontologies, cf. [7], represented in OWL
using a dedicated OWL vocabulary. An OTTR can be viewed as a parameterised ontology
which can be nested, i.e., defined using other OTTRs, and instantiated by providing
arguments to fit the parameters of the template. By recursively expanding an OTTR
by replacing any contained OTTR with the pattern it represents, we obtain a (regular)
OWL ontology. Using this feature, we can reason both on the OTTR specification and
its expansion, and additionally leverage existing W3C languages and tools for different
ontology engineering tasks—all driven by OTTRs. Specifically, the implicit mapping
between an OTTR’s parameters and its pattern may be exploited to generate various
format descriptions and transformation specifications, e.g., queries for extracting pattern
instances and transformations between tabular input formats and OTTR pattern instances.
The only additional tool support that is needed to make use of OTTRs are tools that can
perform the relatively simple operation of template expansion and instantiation.</p>
      <p>We believe OTTRs can provide a framework whereby a few ontology experts can
serve a large number of domain experts and put these in a position to actively contribute
to the development and maintenance of ontologies by clearly separating the design of
an ontology and the bulk content of the ontology: The ontology expert designs and
combines patterns represented as OTTRs to provide user-facing patterns on a level of
abstraction suitable for the domain matter experts. From the user-facing OTTRs a simple
input format is generated together with a transformation specification of the input format
to ontology format. The task of the domain matter experts is then “only” to provide
instance arguments to the input format.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Reasonable Ontology Templates</title>
      <p>A template T is a knowledge base OT together with a list of parameters (p1; : : : ; pn)
of distinguished concept, role, or individual names from OT . We write a template as
T (p1; : : : ; pn) :: OT and refer to the left side as the head and the right side as the body.
For a list (q1; : : : ; qn) of constants, concepts or role expressions called arguments, we
call T (q1; : : : ; qn) a template instance. Intuitively, a template instance is a shorthand for
representing a specific occurrence of a pattern. In addition to regular ontology axioms, a
template body may contain template instances. The expansion of a template instance
T (q1; : : : ; qn) is the ontology obtained by replacing each parameter occurrence of pi in
OT with the argument qi, for 1 i n, and applying the expansion recursively to any
template instances in the body. Cyclic template definitions are not allowed.
Example 1.</p>
      <sec id="sec-2-1">
        <title>SubSome(class; prop; range) :: fclass v 9prop:rangeg</title>
      </sec>
      <sec id="sec-2-2">
        <title>Disjoint(class1; class2) :: fclass1 u class2 v ?g</title>
      </sec>
      <sec id="sec-2-3">
        <title>PartOf(part; whole) :: fSubSome(part; hasPart; whole); Disjoint(part; whole)g</title>
        <p>
          PartOf(2CV; SoftTop)
=)
f2CV v 9hasPart:SoftTop; SoftTop u 2CV v ?g
(
          <xref ref-type="bibr" rid="ref1">1</xref>
          )
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          )
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          )
(
          <xref ref-type="bibr" rid="ref4">4</xref>
          )
SubSome (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) is a template with three parameters: class, prop and range; and a single
axiom body: fclass v 9prop:rangeg. The PartOf template (
          <xref ref-type="bibr" rid="ref3">3</xref>
          ) contains the SubSome
and Disjoint (
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) templates in its body, fixing the second argument of SubSome to the
role name hasPart. An instance of this template, with its expansion, is seen in (
          <xref ref-type="bibr" rid="ref4">4</xref>
          ).
        </p>
        <p>A core feature of OTTR templates is the ability to relate
a simple tabular input format, represented by the parameter lifting
list of the template head, to a rich ontological structure in
the template body, possibly specified via compositions of
other templates. The fact that a template specifies both a T (p1; : : : ; pn) :: OT
tabular input format, an output ontology, and a mapping
between the two formats may be exploited by leveraging the lowering
capabilities of existing W3C standards and implementations.</p>
        <p>In addition to specifying an ontology representing a prototypical ontology of the template
(the expanded template), a single template can specify different tabular and graph input
format specifications using, e.g., XSD and ShEx, and transformations to and from (liftings
and lowerings) the ontology output format using, e.g., XSL and SPARQL. This means
that data can be captured in bulk using XML- or XSD-aware client tools, and efficiently
processed using XSL and/or SPARQL processors, all of which are driven by specifications
generated from a template.</p>
        <p>Using this framework the ontology engineering task can be split in two more or
less distinct responsibilities: one managed by the ontology engineer and the other by
the domain matter expert. The main task of the ontology engineer is to design and
maintain a library of interconnected templates capable of capturing the knowledge of the
domain matter expert at the correct abstraction level and using a vocabulary and format
recognisable by the user. The specificity needed for the ontology engineering task at hand
is achieved by iteratively composing and combining basic and more complex templates,
resulting in user-facing templates. From such templates, tabular input format specification
and transformations may be generated from the template specification, presenting a simple
tabular format for the user to fill in and the accompanying transformation specification
for generating ontology data.</p>
        <p>This process ensures uniformity and completeness of the captured domain knowledge:
completeness, as the template specifies all the attributes that are necessary and variable;
and uniformity, as the template instances are guaranteed to expand to the desired pattern.
The correctness of templates may be secured by checking the prototype ontology resulting
from expanding the template, as well as for each of the comprising templates in isolation.
Additional syntactic constraints on the input data may be specified for the input formats
and be used to check completeness of the input data.</p>
        <p>Templates are adapted to the semantic web by serialising them using RDF with the
OTTR vocabulary defined specifically for this task, and an implementation of the template
mechanism that can perform the necessary expansion and substitution is available online;
see http://www.ottr.xyz. This web service can read any OTTR template by providing its
address to the web application in an IRI query parameter. An example template similar to
Ex. 1 is published at its IRI http://draft.ottr.xyz/i18/partof and can be displayed
in the online application at the following IRI: http://osl.ottr.xyz/info/?tmp=http:
//draft.ottr.xyz/i18/partof. This page shows how the vocabulary is used to specify
parameters and arguments, and how these are passed on to containing template instances.
Also available from this page are all the formats that can be generated from the template by
the application. A library of OTTR templates is published at http://library.ottr.xyz.</p>
        <p>We believe that a set of templates can act as an API for OWL ontology construction
with its simple, but powerful abstraction mechanism based on the well-known concept
of nested non-cyclic macros and syntactic substitutions. This allows complex ontology
expressions to be compactly represented by a naturally compositional structure which
supports a more efficient construction and maintenance of ontologies following “don’t
repeat yourself” (DRY) principles. Additionally, with OTTR templates ontology design
patterns can be explicitly identified as such and clearly encapsulated. This improves
provenance and supports interoperability between ontologies using the same or related
templates without the requirement that the pattern must be discovered first. Since
templates are formally defined as parameterised ontologies the semantics of the pattern
can be verified using regular ontology reasoners. Furthermore, it makes the organisation
of templates and the study of relations between them essentially an extension of the
same well-studied issues regarding ontologies, and familiar terminology and theoretical
machinery can be reused. Finally, OTTRs can be compactly represented in RDF as OWL
ontologies using the OTTR vocabulary. This allows us to leverage the complete stack of
existing W3C languages and tools, such as ontology editors and reasoners.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Related and Future Work</title>
      <p>There are many practical tools and languages for using template-like mechanisms, of
which we highlight the following. The Ontology Pre-Processor Language (OPPL) [3],
originally an ontology manipulation language for adding and removing ontology axioms,
allows for expressing patterns as scripts which may be included directly in OWL
ontologies. The M2 mapping language [5] extends the OWL Manchester syntax with
ontology pattern descriptions for translating spreadsheet data into ontologies. Taking a
broader approach, Tawny-OWL [4] provides an environment for building OWL ontologies
using Clojure, with all the advantages of using a programming language, including the
use of macros.</p>
      <p>The present proposal for templates has been developed in close interaction with
industrial user communities, and we intend to apply it to various existing enterprise
ontologies in the immediate future. This will serve to evaluate, verify and refine the
concept, and will help us develop an efficient and reliable set of tools and web services.
We believe that templates can be important for construction and use of open, validated
modelling patterns, as is required for shared models, and for enabling ontology-based
collaboration. In order to create templates that cover typical needs of industrial users,
we will work with standardisation bodies and make these templates available through a
public repository. This should lower the cost of translating existing data into ontologies,
opening up the benefits of ontology-based methods to new users.</p>
      <p>To support this work, methods for constructing, structuring and managing templates
are necessary. To this end, we intend to further develop the prototype implementation and
to develop tools for developing and applying OTTR templates in ontology engineering.
We also intend to continue the initial efforts on describing the logical properties of
templates [1].</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>H.</given-names>
            <surname>Forssell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. P.</given-names>
            <surname>Lupp</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. G.</given-names>
            <surname>Skjaeveland</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Thorstensen</surname>
          </string-name>
          .
          <article-title>Reasonable Macros for Ontology Construction and Maintenance</article-title>
          .
          <source>In DL Workshop</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>P.</given-names>
            <surname>Hitzler</surname>
          </string-name>
          et al., editors.
          <source>Ontology Engineering with Ontology Design Patterns: Foundations and Applications</source>
          , volume
          <volume>025</volume>
          . IOS Press, Amsterdam,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>L.</given-names>
            <surname>Iannone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. L.</given-names>
            <surname>Rector</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R.</given-names>
            <surname>Stevens</surname>
          </string-name>
          .
          <article-title>Embedding Knowledge Patterns into OWL</article-title>
          .
          <source>In ESWC</source>
          , pages
          <fpage>218</fpage>
          -
          <lpage>232</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>P.</given-names>
            <surname>Lord</surname>
          </string-name>
          .
          <article-title>The Semantic Web takes Wing: Programming Ontologies with Tawny-OWL</article-title>
          . In OWLED,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>M. J. O'Connor</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Halaschek-Wiener</surname>
            , and
            <given-names>M. A.</given-names>
          </string-name>
          <string-name>
            <surname>Musen</surname>
          </string-name>
          .
          <article-title>M2: A Language for Mapping Spreadsheets to OWL</article-title>
          .
          <string-name>
            <surname>In</surname>
            <given-names>OWLED</given-names>
          </string-name>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M. G.</given-names>
            <surname>Skjaeveland</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Forssell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. W.</given-names>
            <surname>Klüwer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. P.</given-names>
            <surname>Lupp</surname>
          </string-name>
          , E. Thorstensen,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Waaler. PatternBased Ontology</surname>
          </string-name>
          <article-title>Design and Instantiation with Reasonable Ontology Templates</article-title>
          .
          <source>Accepted for the Workshop on Ontology Design and Patterns (WOP2017)</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>D.</surname>
          </string-name>
          <article-title>Vrandec˘ic´. Explicit knowledge engineering patterns with macros</article-title>
          .
          <source>In Proceedings of the Ontology Patterns for the Semantic Web Workshop at the ISWC</source>
          <year>2005</year>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>