<!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>Embedding OWL Ontologies with OWL2Vec?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ole Magnus Holter</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Erik B. Myklebust</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jiaoyan Chen</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ernesto Jimenez-Ruiz??</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Oxford</institution>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Informatics, University of Oslo</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Norwegian Institute for Water Research</institution>
          ,
          <addr-line>Oslo</addr-line>
          ,
          <country country="NO">Norway</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>The Alan Turing Institute</institution>
          ,
          <addr-line>London</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we present a preliminary study to compute embeddings for OWL 2 ontologies by projecting the ontology axioms into a graph and performing (random) walks over the ontology graph to create a corpus of sentences. This corpus is then given to a neural language model to create concept embeddings. The conducted preliminary evaluation shows promising results.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        In the literature we can find a number of approaches that perform embeddings over
(RDF) knowledge graphs [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] to conduct knowledge graph completion (e.g., [
        <xref ref-type="bibr" rid="ref11 ref14 ref4">4, 11,
14</xref>
        ]). Most of the approaches, however, only focus on the embedding of the data
instances. Although some approaches also learn embeddings for concepts involved in
instance type definitions (e.g., [
        <xref ref-type="bibr" rid="ref11 ref8">11, 8</xref>
        ]), the embeddings rely on data instances and the
knowledge provided by the ontology (e.g., subsumption axioms) is typically ignored.
Alshahrani et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] performs reasoning to expand the knowledge graph with new facts
(e.g., types of the instances), but the main focus is on the instance embeddings for
biological link prediction.
      </p>
      <p>
        Regarding concept embeddings, there have been some efforts to leverage word
embeddings to associate a vector to the lexical information of the ontology concepts. This
approach has typically been applied to ontology alignment tasks (e.g., [
        <xref ref-type="bibr" rid="ref13 ref9">13, 9</xref>
        ]). The
main limitation of this approach is the dependence on a relevant text corpus or a
pretrained set of word embeddings, which may have some limitations when applying to
ontologies with domain-specific vocabulary. Some works refine the word embeddings
using semantic lexicons (e.g., [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]) to compensate for the lack of domain-specific
training corpora. Nevertheless, the computed word embeddings neglect the rich semantics
of the ontologies (e.g., concept hierarchy, relationships among concepts).
      </p>
      <p>
        The approach followed by the systems Onto2Vec [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] and OPA2Vec [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] deserves
special mention. Both Onto2Vec and OPA2Vec consider each axiom in the ontology as
a sentence. The set of axioms (including some inferred axioms) in the ontology form
a document that is then given to Word2Vec [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Word2Vec computes vectors for each
of the elements in the document including concept identifiers, relationships and OWL
constructs. Although this approach represents an interesting effort, it has the following
limitations: (i) the corpus of sentences may be limited for small-medium ontologies to
create meaningful vectors, (ii) OWL constructs may introduce noise in the embeddings,
and (iii) Word2Vec does not differentiate between sentences like “A SubClassOf: B”
and “A DisjointWith: C” which will lead to similar embeddings for A, B and C.
      </p>
      <p>In order to overcome the limitations of state-of-the-art approaches, we have
implemented a framework to compute semantic embeddings from OWL 2 ontologies. Our
approach (i) projects the ontology into a graph, (ii) implements several strategies to
walk the ontology graph, (iii) creates a corpus of sentences according to the walking
strategies, and (iv) generates concept embeddings from that corpus.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Methods</title>
      <p>
        Figure 1 summarises the current architecture of the OWL2Vec framework, composed of
three main components: ontology projection, walk strategy, and concept embeddings.
Ontology projection. We follow a simplified version of the (RDF-based) graph
projection of the ontology used by Agibetov et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The nodes in the projected RDF
graph represent concepts in the ontology while edges are labelled with possible
relations among those concepts. The key property of this projection is that every edge (i.e.,
triple hA; Ro; Bi) in the graph is justified by one or more axioms entailed by the
ontology which “semantically relates” two concepts (e.g., A and B) via a property (e.g.,
Ro). Table 1 shows the type of axioms currently considered in the ontology projection.
Walk strategy. We have implemented a set of strategies to walk the ontology graph.
We initially relied on a modified version of RDF2Vec [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. The main difference with
respect to the original RDF2Vec algorithm is the use of the ontology projection as
input and the inclusion of weighted edges for the walks (as also proposed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]). One
could give more weight to the taxonomic relationships or to the object properties to
walk from one hierarchy branch to another. The modified algorithm also allowed the
creation of sentences with the concept URI and/or the concept labels. We encountered,
however, a scalability limitation for long walks over large ontologies. To overcome
the limitations of the RDF2Vec approach, we implemented a more flexible strategy
inspired by node2vec [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. This strategy (i) scales with large ontologies, (ii) allows to bias
the walks, (iii) enables semantic similarity not only for closely connected elements but
also for similar structures, (iv) has flexibility to change the direction of a walk to avoid
Embedding OWL Ontologies with OWL2Vec
Condition 2
      </p>
      <p>Triple(s)
D</p>
      <p>B j B1 t ::: t Bn j B1 u ::: u Bn
hA; Ro; Bi or
hA; Ro; Bii for i21..n
hB; SubClassOf; Ai
hA; SubClassOf ; Bi</p>
      <p>Condition 1
A SubClassOf: Ro Restriction D
Ro Restriction D SubClassOf: A
Ro Domain: A Ro Range: B
A SubClassOf: Ro value b b type B</p>
      <p>
        hA; Ro ; Bi in graph
Ro InverseSOnfS: uRbPo ropertyOf: Ro hA; S1; C1i...hCn; Sn; Bi in graph
S1 :::
B SubClassOf: A
dead ends, and (v) uses the (in-memory) triple store reasoner RDFox [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] to enhance
the access to the projected ontology graph.
      </p>
      <p>
        Concept embeddings. The walk strategies in OWL2Vec are flexible and allow the
creation of different types of corpora of sentences that will lead to concept embeddings
with different characteristics. For example, the computed embeddings may favour the
semantic similarity among concepts within the same hierarchy (e.g., between P erson
and Researcher) or among concepts related with other properties (e.g., between P aper
and Researcher). We currently rely on Word2Vec [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and FastText [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] to compute the
embedding from the resulting documents.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Preliminary Evaluation and Future Work</title>
      <p>Figure 2 shows a subset of our preliminary set of experiments.5 We have computed
(agglomerative) clusters of the concepts in the EKAW conference ontology based on
the embeddings provided by RDF2Vec, Onto2Vec and OWL2Vec. We can observe that
the clusters (of related concepts) obtained with the OWL2Vec embeddings are well
differentiated while for RDF2Vec and Onto2Vec the cloud of points is more sparse.6</p>
      <p>
        These clustering results are encouraging, but more evaluation is required to evaluate
the usefulness of the computed embeddings. We plan to conduct an extensive evaluation
to obtain quality measures similar to the ones proposed within the Concept2vec
framework [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. We also aim at evaluating OWL2Vec in real-world applications like
biomedical link prediction or ecotoxicological effect prediction to analyze if the OWL2Vec
concept embeddings improve the state-of-the-art solutions. Furthermore, we are adopting
OWL2Vec within our ontology alignment system as the different OWL2Vec walking
strategies has led to a promising set of concept similarities.
      </p>
      <p>
        OWL2Vec has the potential of becoming an essential component of machine
learning applications that rely on the semantic information of an ontology as input.
Acknowledgements. This work is supported by the AIDA project (The Turing Institute)
and the SIRIUS Centre for Scalable Data Access (RCN 237889).
5 OWL2Vec source codes available from: https://gitlab.com/oholter/owl2vec
6 The rest of conference-based OntoFarm ontologies [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] led to similar findings.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Agibetov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , et al.:
          <article-title>Supporting shared hypothesis testing in the biomedical domain</article-title>
          .
          <source>J. Biomedical Semantics</source>
          <volume>9</volume>
          (
          <issue>1</issue>
          ), 9:
          <fpage>1</fpage>
          -
          <lpage>9</lpage>
          :
          <fpage>22</fpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Alshahrani</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , et al.:
          <article-title>Neuro-symbolic representation learning on biological knowledge graphs</article-title>
          .
          <source>Bioinformatics</source>
          <volume>33</volume>
          (
          <issue>17</issue>
          ),
          <fpage>2723</fpage>
          -
          <lpage>2730</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Alshargi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shekarpour</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Soru</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sheth</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Quasthoff</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Concept2vec: Metrics for Evaluating Quality of Embeddings for Ontological Concepts</article-title>
          .
          <source>CoRR abs/1803</source>
          .04488 (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Bordes</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , et al.:
          <article-title>Translating Embeddings for Modeling Multi-relational Data</article-title>
          .
          <source>In: 27th Conference on Neural Information Processing Systems (NIPS)</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Cochez</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ristoski</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ponzetto</surname>
            ,
            <given-names>S.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulheim</surname>
          </string-name>
          , H.:
          <article-title>Global RDF vector space embeddings</article-title>
          .
          <source>In: International Semantic Web Conference (ISWC)</source>
          . pp.
          <fpage>190</fpage>
          -
          <lpage>207</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Grover</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leskovec</surname>
          </string-name>
          , J.: node2vec:
          <article-title>Scalable Feature Learning for Networks</article-title>
          .
          <source>In: SIGKDD International Conference on Knowledge Discovery and Data Mining</source>
          . pp.
          <fpage>855</fpage>
          -
          <lpage>864</lpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Joulin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grave</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bojanowski</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Douze</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , Je´gou, H.,
          <string-name>
            <surname>Mikolov</surname>
          </string-name>
          , T.:
          <article-title>FastText.zip: Compressing text classification models</article-title>
          .
          <source>CoRR abs/1612</source>
          .03651 (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Kejriwal</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Szekely</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Scalable Generation of Type Embeddings Using the ABox</article-title>
          .
          <source>OJSW</source>
          <volume>4</volume>
          (
          <issue>1</issue>
          ),
          <fpage>20</fpage>
          -
          <lpage>34</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Kolyvakis</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , et al.:
          <article-title>DeepAlignment: Unsupervised Ontology Matching with Refined Word Vectors</article-title>
          .
          <source>In: NAACL Conference on Human Language Technologies</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Mikolov</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , et al.:
          <article-title>Distributed Representations of Words and Phrases and their Compositionality</article-title>
          .
          <source>In: 27th Conference on Neural Information Processing Systems (NIPS)</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Moon</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jones</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Samatova</surname>
            ,
            <given-names>N.F.</given-names>
          </string-name>
          :
          <article-title>Learning entity type embeddings for knowledge graph completion</article-title>
          .
          <source>In: Conference on Information and Knowledge Management (CIKM)</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Nenov</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Piro</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Banerjee</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>RDFox: A Highly-Scalable RDF Store</article-title>
          .
          <source>In: 14th International Semantic Web Conference</source>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Nkisi-Orji</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wiratunga</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Massie</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hui</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heaven</surname>
          </string-name>
          , R.:
          <article-title>Ontology Alignment Based on Word Embedding and Random Forest Classification</article-title>
          . In: ECML-PKDD. pp.
          <fpage>557</fpage>
          -
          <lpage>572</lpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Ristoski</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Noia</surname>
          </string-name>
          , T.D.,
          <string-name>
            <surname>Leone</surname>
            ,
            <given-names>R.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulheim</surname>
          </string-name>
          , H.:
          <article-title>RDF2Vec: RDF graph embeddings and their applications</article-title>
          .
          <source>Semantic Web</source>
          <volume>10</volume>
          (
          <issue>4</issue>
          ),
          <fpage>721</fpage>
          -
          <lpage>752</lpage>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Smaili</surname>
            ,
            <given-names>F.Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gao</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hoehndorf</surname>
            ,
            <given-names>R.:</given-names>
          </string-name>
          <article-title>Onto2Vec: joint vector-based representation of biological entities and their ontology-based annotations</article-title>
          .
          <source>Bioinformatics</source>
          <volume>34</volume>
          (
          <issue>13</issue>
          ),
          <fpage>i52</fpage>
          -
          <lpage>i60</lpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Smaili</surname>
            ,
            <given-names>F.Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gao</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hoehndorf</surname>
            ,
            <given-names>R.:</given-names>
          </string-name>
          <article-title>OPA2Vec: combining formal and informal content of biomedical ontologies to improve similarity-based prediction</article-title>
          .
          <source>Bioinformatics</source>
          <volume>35</volume>
          (
          <issue>12</issue>
          ) (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mao</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Knowledge Graph Embedding: A Survey of Approaches and Applications</article-title>
          .
          <source>IEEE Trans. Knowl. Data Eng</source>
          .
          <volume>29</volume>
          (
          <issue>12</issue>
          ),
          <fpage>2724</fpage>
          -
          <lpage>2743</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Zamazal</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          , Sva´tek, V.:
          <article-title>The Ten-Year OntoFarm and its Fertilization within the OntoSphere</article-title>
          .
          <source>J. Web Semant</source>
          .
          <volume>43</volume>
          ,
          <fpage>46</fpage>
          -
          <lpage>53</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>