<!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>
      <journal-title-group>
        <journal-title>T. Racharak);</journal-title>
      </journal-title-group>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Library for Explainable Semantic Similarity for ELH Description Logic Ontology</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Teeradaj Racharak</string-name>
          <email>racharak@tohoku.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Watanee Jearanaiwongkul</string-name>
          <email>watanee@tohoku.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Workshop</string-name>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>Semantic Similarity, Non-standard Reasoner, Ontology, Explainable AI, JAVA API</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Advanced Institute of So-Go-Chi (Convergence Knowledge) Informatics, Tohoku University</institution>
          ,
          <addr-line>Miyagi</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2025</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0003</lpage>
      <abstract>
        <p>We present a newly developed Java library that implements a neuro-symbolic framework for computing semantic similarity between concepts in Description Logic ℰ ℒ ℋ ontologies. This library provides an implementation of a hybrid approach combining a structural-based method in ontology reasoning with distributional semantics derived from pre-trained word embeddings. It supports eficient similarity computation and interpretable explanations for the results. Designed with scalability in mind, it guarantees polynomial-time execution and supports large-scale ontologies with thousands of concepts and complex hierarchical structures. For explainability, it produces ifne-grained explanations by identifying the contributing primitive and existential concept pairs, as well as the semantic alignments found in the embedding space. These explanations help users understand why a similarity score is given, making the results transparent and auditable. The API is embedding-agnostic and compatible with a wide range of vector space models, including static embeddings (e.g., Word2Vec) and contextualized models (e.g., BERT). This tool enables the development of explainable, knowledge-driven AI systems in domains where both structured ontological modeling and contextual semantic understanding are essential.</p>
      </abstract>
      <kwd-group>
        <kwd>Ontology</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Measuring semantic similarity between ontology concepts is essential in applications such as clinical
decision support, semantic search, and ontology alignment [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. Structural-based approaches in
ontology reasoning ofer interpretability and logical consistency but are limited in capturing hidden or
implicit relationships. In contrast, embedding-based methods leverage distributional semantics from
large text corpora to model contextual meaning, enabling generalization, robustness to lexical variation,
and the ability to capture similarity even in sparsely modeled ontologies.
      </p>
      <p>
        To bridge the strengths of both approaches, we present a Java API implementing a neuro-symbolic
framework (originally proposed in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]) for concept similarity in Description Logic ℰ ℒ ℋ. The API
combines structural reasoning over ontology hierarchies with pre-trained word embeddings to compute
similarity scores that are both explainable and semantically enriched. It also supports automatic
generation of human-readable explanations, promoting transparent and trustworthy AI.
      </p>
      <p>CEUR</p>
      <p>
        ceur-ws.org
1.1. Algorithmic Design and Implementation
Our library, called JSIMℰ ℒ ℋExplainer, implements an eficient and explainable concept similarity
measure within the ℰ ℒ ℋ fragment of Description Logic. The core algorithm is designed in accordance
with the neuro-symbolic framework proposed in the prior theoretical works [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ], with a practical
focus on scalability, modularity, and extensibility.
      </p>
      <sec id="sec-1-1">
        <title>1.1.1. Supported Ontology Type</title>
        <p>The current implementation supports ℰ ℒ ℋ ontologies with unfoldable TBoxes. This ensures that no
cyclic definitions exist, making the ontology amenable to tree-based structural analysis.</p>
      </sec>
      <sec id="sec-1-2">
        <title>1.1.2. Embedding Model Independence</title>
        <p>The similarity computation module is designed to be agnostic to the choice of embedding models. Any
word embedding model—static or contextualized, domain-specific or general-purpose—can be used as
long as it provides a mapping from concept labels (strings) to vectors in a real-valued vector space.</p>
      </sec>
      <sec id="sec-1-3">
        <title>1.1.3. Algorithm and API’s Development</title>
        <p>
          Definition 1. [Homomorphism Degree subject to Embedding [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]] Let CNpri and RN be a set of primitive
concept names and role names in an ontology, respectively. Also, let Tℰℒ ℋ be a set of all ℰ ℒ ℋ description
trees, ℰ be a set of (possibly empty) pre-trained embeddings, and ℳ ∶ CNpri ∪ RN → ℰ be a mapping.
The homomorphism degree subject to ℰ (denoted by hd ) is a function hd ∶ Tℰℒ ℋ × Tℰℒ ℋ → [
          <xref ref-type="bibr" rid="ref1">0, 1</xref>
          ]
defined inductively as follows:
        </p>
        <p>hd (  ,   ) ≔  × p‐hd (  ,   ) + (1 − ) × e‐set‐hd (ℰ , ℰ )
where  ≔ |  | , also,   , ℰ denotes a set of primitive concepts and a set of existentials, respectively, on
|  ∪ℰ |
(unfolded) description tree   ;
p‐hd (  ,   ) ≔
  (, ) ≔
1
{
max{cos(ℳ(), ℳ()), 0}
⎧1
⎪
⎪0
⎨
⎪ ∑ max{  (,)}
⎪ ∈  ∈ 
⎩ |  |
if   = ∅
if   ≠ ∅
and   = ∅
otherwise,
if  = 
otherwise,
where cos(⋅, ⋅) represents the cosine similarity,
e‐set‐hd (ℰ , ℰ ) ≔
⎧1
⎪
⎪0
⎨
⎪ ∑ max{e‐hd (∃. ,  )}
⎪ ∃.∈ℰ    ∈ℰ
⎩ |ℰ |
if ℰ = ∅
if ℰ ≠ ∅
and ℰ = ∅
where   is an existential; and
where 0 ≤  &lt; 1 ; and
e‐hd (∃ . , ∃. ) ≔ 
 ( , ) × ( + (1 − ) ×</p>
        <p>hd (  ,   ))
  ( , ) ≔</p>
        <p>1
{ ∑ max{cos(ℳ( ′),ℳ( ′)),0}
 ′∈ℛ  ′∈ℛ
|ℛ |
if  = 
otherwise,
(5)
(6)
where ℛ , ℛ denotes a set of all  ’s super roles and a set of all  ’s super roles, respectively. Note that a set
of all  ’s super roles, denoted by ℛ , is defined as ℛ = { ∈ RN |  ⊑ ∗ } and,  ⊑ ∗  if  =  or   ⊑  +1 ∈ 
where 1 ≤  ≤ ,  1 =  ,   =  , and ∗ is a transitive closure.</p>
        <p>From the above definition, we describe the main procedure of our similarity procedure implemented
in our library here. Given a target ontology and two concepts whose similarity is to be computed, the
similarity procedure in our library proceeds with respect to the following main steps:
1. Unfolding the TBox: The ontology is preprocessed by replacing defined concept names with
their definitions recursively until all concept expressions are written in terms of only primitive
concepts (i.e., concept names that are not defined in the TBox).
2. Description Tree Construction: Each unfolded concept is translated into a description tree, a
syntactic representation that reflects the hierarchical and conjunctive structure of the concept
expression based on ℰ ℒ ℋ constructors.
3. Structural Comparison: A syntactic comparison is performed between the two description
trees as described in Definition 1. The algorithm recursively computes a similarity degree by
combining structural correspondence with lexical proximity (i.e. the used embeddings).
4. Embedding-based Similarity: For each concept or role label encountered, the algorithm uses
the chosen embedding model (cf. Mapping ℳ in Definition 1) to compute a cosine similarity
between matching nodes or edges. This allows for approximate matching even when labels difer
lexically but are semantically related.
5. Similarity Aggregation: The final score is obtained by aggregating the local similarity scores
of the matched substructures, weighted appropriately based on tree depth and logical operators.</p>
        <p>The algorithm has been mathematically proven to run in polynomial time with respect to the size of
the ontology and the input concept descriptions. Termination is guaranteed due to the finite nature of
the unfolding and tree construction processes, as well as the bounded number of structural comparisons
during similarity computation.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Core API Design</title>
      <p>The core APIs are designed to facilitate our concept similarity computation, explanation generation,
and easy integration with OWL ontologies and external embedding models. The library is available
online at: https://github.com/realearn-people/sim-elh-explainer-jar</p>
      <p>
        Below is an overview of the key functions provided in our development:
1. Instantiation of JSIMℰ ℒ ℋ Explainer: The first step is to instantiate a SimExplainer object
for loading the input ontology into a targeted Java project. Following [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ], all primitive concept
names and role names could be also pre-configured in a separate setting, called Preference Profile
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In addition, our API supports two kinds of ontology file extensions: .owl and .krss.
2. Concept Name Retrieval: This function allows to retrieve all concept names from the ontology.
3. Similarity Measure: This function measures similarity between two concepts.
4. Description Tree Retrieval: This function returns a description tree of the given concept. This
can be represented in JSON for machine readability and in ASCII for human readability.
5. Explanation Retrieval: This function returns a 4-tuple representing the explanation of detected
similarity consisting of (1) the homomorphism degree from a concept to another concept, (2) a
list of primitive concept pairs that contribute to the similarity score, with each pair consisting of
one concept from the first input and one from the second, (3) a list of existential concept pairs
contributing to the similarity score, where each pair consists of one existential concept from
each of the two input concepts, and (4) an applied embedding map in which each key is a pair of
existential or primitive concepts—one from each input concept—that contributes to the overall
similarity score. For the 4th one, the corresponding value is a set of pairs, where each pair
represents a similarity found within the embedding space between roles or primitive concepts.
      </p>
      <p>We provide the output of explanation retrieval in both JSON and ASCII for flexibility of use of
the library. Note that the final similarity score is derived by averaging the homomorphism degrees
(Definition 1) from both the forward and backward directions of the respected description trees.
#
1
2</p>
    </sec>
    <sec id="sec-3">
      <title>3. Experiments and Conclusions</title>
      <p>
        We evaluated our similarity framework using SNOMED CT and the family ontology [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. We aimed
to validate that concepts sharing more features should yield a higher similarity degree. To manage
complexity of SNOMED CT, we focused on two top-level categories: Clinical Finding and Procedure.
We randomly sampled 206 concepts (0.5%) from each category, forming three test sets:  1 ×  1,  2 ×  2,
and  1 ×  2, where  1 and  2 represent the Clinical Finding and Procedure samples, respectively. Our
ifndings confirmed that concept pairs from the same category consistently received higher similarity scores
than cross-category pairs, in line with expectations based on ontological structure and subsumption. Table
1 shows some insights for the chosen pairs in the family ontology. In the future, we plan to validate on
other aspects such as usability. This could be done by involving users or developers to gather feedback.
Declaration of Generative AI and AI-assisted Technologies
The authors did not use any generative AI and AI-assisted technologies for writing the article. The
authors thus take full responsibility for the content of the publication.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>F. Z.</given-names>
            <surname>Smaili</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Hoehndorf</surname>
          </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>
          (
          <year>2019</year>
          )
          <fpage>2133</fpage>
          -
          <lpage>2140</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          , L. Cheng, C. Wang,
          <article-title>Ontosem: an ontology semantic representation methodology for biomedical domain</article-title>
          ,
          <source>in: 2020 IEEE International Conference on Bioinformatics and Biomedicine (BIBM)</source>
          , IEEE,
          <year>2020</year>
          , pp.
          <fpage>523</fpage>
          -
          <lpage>527</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>T.</given-names>
            <surname>Racharak</surname>
          </string-name>
          ,
          <article-title>On approximation of concept similarity measure in description logic ELH with pretrained word embedding</article-title>
          ,
          <source>IEEE Access 9</source>
          (
          <year>2021</year>
          )
          <fpage>61429</fpage>
          -
          <lpage>61443</lpage>
          . URL: https://doi.org/10.1109/ACCESS.
          <year>2021</year>
          .
          <volume>3073730</volume>
          . doi:
          <volume>10</volume>
          .1109/ACCESS.
          <year>2021</year>
          .
          <volume>3073730</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Racharak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Suntisrivaraporn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Tojo</surname>
          </string-name>
          ,
          <article-title>Personalizing a concept similarity measure in the description logic ELH with preference profile</article-title>
          ,
          <source>Comput. Informatics</source>
          <volume>37</volume>
          (
          <year>2018</year>
          )
          <fpage>581</fpage>
          -
          <lpage>613</lpage>
          . URL: https://doi.org/10.4149/cai_2018_
          <volume>3</volume>
          _
          <fpage>581</fpage>
          . doi:
          <volume>10</volume>
          .4149/CAI\_
          <year>2018</year>
          \_3\_
          <fpage>581</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Stevens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Stevens</surname>
          </string-name>
          ,
          <article-title>A family history knowledge base using owl 2</article-title>
          ., in: Owled, volume
          <volume>432</volume>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>