<!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>OWL Paths: A library for processing SPARQL-like property paths over OWL classes</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Melissa D. Clarkson</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Landon T. Detwiler</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Bend</institution>
          ,
          <addr-line>Oregon</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Kentucky</institution>
          ,
          <addr-line>Lexington, Kentucky</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Ontologies representing knowledge of biomedical domains are often constructed primarily of classes, rather than individuals. Classes are related to one another using OWL property restrictions which represent the complex network of relationships that would hold between individuals. The SPARQL query language is limited in its ability to represent the complexity needed for some types of queries over ontology class structures. We present the OWL Paths library, which uses a grammar syntactically similar to SPARQL and allows the user to write path expressions in relation to OWLClass objects in the OWL API. We demonstrate the need for this library using an example from the Foundational Model of Anatomy (FMA) ontology.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Ontology</kwd>
        <kwd>Ontology pattern</kwd>
        <kwd>Anatomy</kwd>
        <kwd>Knowledge representation 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Ontologies are used to represent knowledge about biological and medical domains. These
ontologies are built primarily or exclusively of classes (rather than individuals) and often make
use of a large number of types of relations (object properties) between classes [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Examples of
biomedical ontologies can be found at the Open Biological and Biomedical Ontologies (OBO)
Foundry website [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]
      </p>
      <p>
        Our work is in the domain of human anatomy. The Foundational Model of Anatomy (FMA)
ontology is a representation of canonical human anatomy developed by the Structural
Informatics Group at the University of Washington. The FMA asserts that anatomy can be
represented using a series of organizing units at different levels of granularity. These units
include “Cell”, “Portion of tissue”, “Organ”, and “Organ system”. The FMA serves as a reference
ontology of canonical human anatomy and has been incorporated into the Unified Medical
Language System (UMLS). It consists of over 100,000 classes and 130 types of relations between
classes—making it one of the largest biomedical ontologies in existence and the most
comprehensive ontology for adult human gross anatomy [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ].
      </p>
      <p>
        Our recent work with the FMA has focused on developing methods of auditing the FMA to
detect incomplete content and inconsistencies in modeling [
        <xref ref-type="bibr" rid="ref5 ref6">5,6</xref>
        ]. Anatomical structures repeated
throughout the body (such as joints, muscles, and bones) should be modeled in similar and
predictable ways, but the changes in modeling schemes during the 20-year development of the
FMA and inter-author variation have resulted in inconsistencies. Our goal is to remodel the FMA
using a pattern-based strategy that will support the next generation of intelligent biomedical
applications.
      </p>
      <p>Anatomical representation is a useful case for exploring how patterns can be applied within
complex ontologies. The patterns in our work (which we refer to as “knowledge representation
patterns”) are specific to the ontology content, rather than being generalizable patterns as those
available through OntologyDesignPatterns.org.</p>
      <p>The structure of the FMA is determined by both the naturally occurring structure of human
anatomy and medical conventions for dividing anatomical structures into parts. The various
organ systems of the body (including the musculoskeletal system, nervous system, lymphatic
system) are represented as parts that are related to each other through sets of constraints. For
example, each lymph node is continuous with at least one lymphatic vessel.</p>
      <p>We are working toward representing the anatomical structure of the human body as
machinereadable patterns to aid in authoring and curation of the next iteration of the FMA. To accomplish
this work, we must query over classes using a method that is analogous to path expressions. In
this paper we (1) demonstrate the need to query over ontologies using property path expressions
and (2) present our work in developing OWL Paths, a library that enables SPARQL-like processing
over ontology classes. We expect this work will be applicable to many large and complex
biomedical ontologies.</p>
    </sec>
    <sec id="sec-2">
      <title>2. The need for SPARQL-like path expressions over OWL classes in ontologies</title>
      <p>We first introduce a fictional example of a medical records ontology to explain the rational for
OWL Paths. We then show a more complex example using a representation of human anatomy
from the FMA.</p>
      <sec id="sec-2-1">
        <title>2.1. Representing an instance of a medical record and a medical record ontology</title>
        <p>Figure 1 shows a diagram of the graph representation of part of a fictional medical record for
patient number 001. One of the subsections of “MedicalRecord_001” is “PersonalData_001”, and
that section has subsections “DemographicData_001” and “ContactInfo_001”.
This data structure can be queried by SPARQL. For example, all subsections of the medical
record would be retrieved (would bind to ?x) with the following path pattern tuple:
demo:MedicalRecord_001 demo:has_subsection+ ?x</p>
        <p>Figure 2 shows a diagram of the graph representation of the class structure of the ontology
that specifies the structure of medical records in this system. This ontology tells us that each
medical record has at least one “PersonalData” section, and each “PersonalData” section has at
least one “DemographicData” section and one “ContactInfo” section. Notice that the
representation of classes in Figure 2 is more complex than the instance shown in Figure 1 and
requires the use of anonymous classes. Suppose we wanted to query the ontology to retrieve all
classes that are reachable, recursively, from the class “MedicalRecord” via existential restrictions
(owl:someValuesFrom) on the property demo:has_subsection. A SPARQL query can be written
only if we know how many levels deep we need to follow the path of demo:has_subsection
relations. SPARQL does not have a method of recursively searching a network of this complexity
to an arbitrary depth.</p>
        <p>In practice, this limitation is often overcome by a method called punning, in which an example
or model individual is created for each class of an ontology. These individuals can be directly
connected via object properties such as demo:has_subsection, thereby simplifying the structure
shown in Figure 2 to that in Figure 1. But this is a pre-processing step that that must be done
across the entire ontology. The purpose of OWL Paths is to enable SPARQL-like path processing
over the classes in an ontology as if the pun individuals were present, without the need for
preprocessing.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Representing human anatomy</title>
        <p>Because the FMA represents only classes (not individuals), following paths for any relation
other than owl:subClassOf requires following assertions that use anonymous classes. For
simplicity, the example in Figure 3 diagrams the relationships between a type of muscle (biceps
brachii) and bones (scapula, radius) as an anatomist would conceptualize these paths.</p>
        <p>The example in Figure 3 shows that a tendon attaches to a region of a bone, and that region is
transitively part of a bone. But the modeling has a variable number of “Region of bone organ”
classes traversed between a class “Tendon” and class “Bone organ”. Therefore this path traverses
a variable number of regional_part_of relations, and queries that traverse the paths between
“Tendon” and “Bone organ” must account for this recursive path. The OWL Paths library was
developed to provide the ability to perform this type of complex query.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Development of the OWL Paths library</title>
      <p>
        Ontologies are often created or edited in GUI based development tools, such as the Protégé
ontology editor and framework [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. However, when ontologies are used to empower smarter
tools there is often a need to consume them via APIs. The OWL API is an API and reference
implementation of the OWL 2 standard [
        <xref ref-type="bibr" rid="ref8 ref9">8,9</xref>
        ]. The OWL Paths tool presented here is a Java library
built on the OWL API for processing object property path expressions over OWL classes.
      </p>
      <p>
        Because most developers in ontology or semantic web fields are familiar with the SPARQL
query language for RDF(S), the OWL Paths grammar is syntactically similar to SPARQL. At
present, many but not all SPARQL constructs are supported in OWL Paths. OWL Paths also adds
two additional expression types that are not a part of SPARQL. Table 1 is adapted from the
SPARQL property path specification [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and compares the expressivity of OWL Paths to that of
SPARQL.
      </p>
      <sec id="sec-3-1">
        <title>A path between n and m occurrences of elt.</title>
      </sec>
      <sec id="sec-3-2">
        <title>Exactly n occurrences of elt. A fixed length path. n or more occurrences of elt.</title>
      </sec>
      <sec id="sec-3-3">
        <title>Between 0 and n occurrences of elt.</title>
        <p>uri[INV=uri] A path constraint that the inverse path must also hold.
elt[SUP=uri] A path constraint on the superclass of all classes on the ✓
path.
uri is either a URI or a prefixed name and elt is a path element, which may itself be composed of path syntax constructs.</p>
        <p>The OWL Paths library supports programmatically processing path expressions in relation to
OWLClass objects in the OWL API. The OWL Paths library adds a Java class PathExpression which</p>
      </sec>
      <sec id="sec-3-4">
        <title>SPARQL</title>
        <p>✓</p>
        <p>OWL
Paths</p>
        <p>✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
has exactly one relevant method, processPath. processPath accepts two arguments: (1) a path
expression which describes what sort of paths to follow, and (2) a list of subject classes to follow
such paths from. Paths are followed, in OWL Paths, as though traversing a non-materialized
network of punned (model or example) individuals. Presently these non-materialized puns are
presumed to exist everywhere for which there is an existential restriction (owl:someValuesFrom)
on an object property. Therefore, the owl:someValueFrom restrictions in Figure 2 are processed
as if the graph in Figure 1 had already been generated.</p>
        <p>The code snippet in Figure 4 would return four OWLClass objects in the results,
“demo:MedicalRecord”, “demo:PersonalData”, “demo:DemographicData”, and
“demo:ContactInfo”. That is because, in the demo ontology, the class “demo:MedicalRecord” is
connected via restriction on the property demo:has_subsection to each of those classes
recursively (including itself as the ‘*’ operator indicates zero or more).</p>
        <p>Like paths in SPARQL, path expressions in OWL Paths are compositional. Encapsulating a path
expression in parenthesis results in a new path element, to which further operators can be
applied. For example, consider the following path expression:</p>
        <p>The above path expression matches paths that are either composed of a single
demo:has_subsection property or a single demo:has_coding_system property. If we were to
encapsulate the above expression in parenthesis, we could then apply additional operators, for
example the unary operator ‘+’. It would then match paths with one or more edges all of which
are either demo:has_subsection or demo:has_coding_system. That expression would look like
this:</p>
        <p>The source code for OWL Paths, as well as a pre-build archive, are available at
https://gitlab.com/endless-forms-studio/owl_paths.</p>
        <sec id="sec-3-4-1">
          <title>3.1. Extensions</title>
          <p>Although we have compared OWL Paths to SPARQL, it is important to note that our path
expressions need not be limited to the expressivity of SPARQL. In this section we describe two
(beta) extensions to the path language that are not available in SPARQL property paths but have
been implemented in OWL Paths.</p>
          <p>For property paths in SPARQL the types of the intervening nodes along the path are not
considered, but when querying ontologies this information can be relevant. In SPARQL,
demo:has_subsection* specifies that matching paths have zero or more such edges but it does not
specify anything else about the nodes that are connected via those edges. In OWL Paths, one
extension provides the ability to specify the type for nodes along a path, restricting to only nodes
with a given superclass. The syntax for this constraint uses the suffix [SUP=&lt;IRI&gt;]. For example,
the following expression would return results connected to the subject by a restriction on
demo:has_contact_record only if the superclass of the connected class is “demo:PhoneRecord”:</p>
          <p>The other extension in OWL paths has a similar syntax, but it restricts results to those that
have an additional property restriction in the other direction, from the target to the source:</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>This work introduces OWL Paths, a Java library built on the OWL API for processing object
property path expressions over OWL classes. This was developed in response to our need to
perform queries over the FMA to advance our work implementing patterns. We anticipate that
this library will be of use to additional groups authoring and auditing other large ontologies that
model complex domains.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>B.</given-names>
            <surname>Smith</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Ceusters</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Klagges</surname>
          </string-name>
          , et al.
          <article-title>Relations in biomedical ontologies</article-title>
          .
          <source>Genome Biology</source>
          <volume>66</volume>
          (
          <year>2005</year>
          )
          <article-title>R46</article-title>
          . doi:
          <volume>10</volume>
          .1186/gb-2005-6-5-r46.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Open</given-names>
            <surname>Biological</surname>
          </string-name>
          and
          <article-title>Biomedical Ontology Foundry</article-title>
          . URL: https://obofoundry.org/.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>C.</given-names>
            <surname>Rosse</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.L.V.</given-names>
            <surname>Mejino</surname>
          </string-name>
          ,
          <article-title>A reference ontology for biomedical informatics: The Foundational Model of Anatomy</article-title>
          .
          <source>Journal of Biomedical Informatics</source>
          <volume>6</volume>
          (
          <year>2003</year>
          )
          <fpage>478</fpage>
          -
          <lpage>500</lpage>
          . doi:
          <volume>10</volume>
          .1016/j.jbi.
          <year>2003</year>
          .
          <volume>11</volume>
          .007.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>C.</given-names>
            <surname>Rosse</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.L.V.</given-names>
            <surname>Mejino</surname>
          </string-name>
          ,
          <article-title>The Foundational Model of Anatomy ontology</article-title>
          , in: A.G. Burger,
          <string-name>
            <given-names>D.</given-names>
            <surname>Davidson</surname>
          </string-name>
          , R. Baldock (Eds.),
          <source>Anatomy Ontologies for Bioinformatics: Principles and practice</source>
          , Springer, London,
          <year>2008</year>
          , pp.
          <fpage>59</fpage>
          -
          <lpage>117</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-1-
          <fpage>84628</fpage>
          -885-
          <issue>2</issue>
          _
          <fpage>4</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>M.D.</given-names>
            <surname>Clarkson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Roggenkamp</surname>
          </string-name>
          ,
          <article-title>Employing knowledge patterns for auditing the Foundational Model of Anatomy</article-title>
          ,
          <source>in: Proceedings of the 2nd International Workshop on Quality Assurance and Enrichment of Biological and Biomedical Ontologies and Terminologies at the 2019 IEEE International Conference on Bioinformatics and Biomedicine (IEEE BIBM</source>
          <year>2019</year>
          ), SanDiego, CA, November
          <volume>18</volume>
          -
          <issue>19</issue>
          ,
          <year>2019</year>
          . doi:
          <volume>10</volume>
          .1109/BIBM47256.
          <year>2019</year>
          .
          <volume>8983410</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M.D.</given-names>
            <surname>Clarkson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.T.</given-names>
            <surname>Detwiler</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.M. Platt</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Roggenkamp</surname>
          </string-name>
          ,
          <article-title>Assessing the consistency of modeling in complex ontologies: A study of the musculoskeletal system of the Foundational Model of Anatomy</article-title>
          ,
          <source>in: Proceedings of the 2021 International Conference on Biomedical Ontologies (ICBO</source>
          <year>2021</year>
          ), Bozen-Bolzano, Italy,
          <source>September 16-18</source>
          ,
          <year>2021</year>
          . URL: https://ceurws.org/Vol-
          <volume>3073</volume>
          /paper2.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.A.</given-names>
            <surname>Musen</surname>
          </string-name>
          ,
          <article-title>The Protégé project: A look back and a look forward</article-title>
          .
          <source>AI Matters (1)</source>
          <year>2015</year>
          :
          <fpage>4</fpage>
          -12 doi: 10.1145/2757001.2757003.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>[8] OWL API main repository</article-title>
          . URL: https://github.com/owlcs/owlapi.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <article-title>[9] OWL 2 Web Ontology Language Structural Specification</article-title>
          and
          <string-name>
            <surname>Functional-Style Syntax (Second Edition</surname>
          </string-name>
          ),
          <source>W3C Recommendation 11 December</source>
          <year>2012</year>
          . URL: https://www.w3.org/TR/owl2- syntax/
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <source>[10] SPARQL 1.1 Query Language, W3C Recommendation 21 March</source>
          <year>2013</year>
          . Section 9,
          <string-name>
            <given-names>Property</given-names>
            <surname>Paths</surname>
          </string-name>
          . URL: https://www.w3.org/TR/sparql11-query/#propertypaths
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>