<!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>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards a methodology for the semi-automatic generation of scientific knowledge graphs from XML documents</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>George Hannah</string-name>
          <email>g.t.hannah@liverpool.ac.uk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Terry R. Payne</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Valentina Tamma</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrew Mitchell</string-name>
          <email>Andrew.Mitchell@unilever.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ellen Piercy</string-name>
          <email>ellen.piercy@unilever.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Boris Konev</string-name>
          <email>konev@liverpool.ac.uk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Materials Innovation Factory, University of Liverpool</institution>
          ,
          <addr-line>51 Oxford Street, Liverpool, L7 3NY</addr-line>
          ,
          <country country="UK">United Kingdom</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Liverpool</institution>
          ,
          <addr-line>Foundation Building, Brownlow Hill, Liverpool, L69 7ZX</addr-line>
          ,
          <country country="UK">United Kingdom</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Robots used in analytical laboratories, such as those at Unilever, generate vast amounts of log data. This log data is typically stored in semi-structured formats (e.g. XML) according to some standard schema, e.g. the Analytical Information Markup Language (AnIML). Representing this data in a structured format such as a knowledge graph would allow for a more consistent data interpretation, as the relationships between concepts would be formalised in an ontology; consequently making the process of complex data analysis simpler for the scientists involved. We propose a semi-automatic pipeline that exploits the inherent structure of XML schemata, as well as previously represented domain knowledge, to create a knowledge graph that represents log data with its relevant metadata. We utilise ontology alignment techniques to identify related concepts in diferent ontologies, and therefore provide additional context when predicting the property linking two classes while building the graph.</p>
      </abstract>
      <kwd-group>
        <kwd>Ontology alignment</kwd>
        <kwd>knowledge graph generation</kwd>
        <kwd>XML</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>
        (B. Konev)
As technology progresses, we are producing rapidly increasing amounts of data. This is
particularly true in science, with the introduction of laboratory robots. These robots consistently carry
out repeated actions faster, and with more accuracy than a human scientist; resulting in a large
volume of log data. This data is often stored in semi-structured formats such as XML, due to
the need to store this data in a machine readable and actionable format, thus granting scientists
access to advanced data analysis techniques [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Knowledge graphs (KGs) are data structures
that can support advanced data analytics by semantically representing entities (as vertices) and
the relationships between them (as directed edges) in a graph or semantic network.
      </p>
      <p>This research is motivated by the work carried out by Unilever, where several robots are
used in their laboratories to carry out scientific experiments. These experiments involve the
CEUR
Workshop
Proceedings
testing and formulation of many of their diferent products. During these experiments, log data
is generated by the robots and stored in AnIML (Analytical Information Markup Language)1
ifles. AnIML is an XML standard that has been designed for analytical chemical and biological
data and processes. In addition to the log data, this representation can also define metadata
surrounding experiments such as: the person that started the experiment, or the experiment
start time. Such metadata provides additional context, and if exploited correctly can improve
the semantic representation of the data. The structure of any given XML file is determined by
its schema, and the same is true in AnIML. These schemata state what attributes and children a
given element can have and the required cardinality of those attributes and child elements. We
hypothesise that the structure provided by the AnIML schema can be leveraged to bootstrap
an ontology that correctly models the knowledge in AnIML files. In a KG, the relationships
between concepts are formalised by an ontology. However, creating an ontology to describe a
domain can be both labour and time intensive, as the knowledge that is held by a domain expert
has to be correctly represented by an ontology engineer. Thus, we propose a semi-automatic
pipeline for creating a KG and corresponding ontology from semi-structured data in XML, with
the aim of reducing the time required to create and maintain a KG. We exploit the implicit
semantics found in XML documents, which follow a hierarchical structure consisting of two
types of relationship, parent-child, and element-attribute. These relationships identify a link
between two entities; however the specific nature of these links are unknown. Our aim is to
align concepts in our ontology with equivalent concepts in other ontologies, and then use this
additional context to assist in the prediction of the nature of these unknown relationships.</p>
    </sec>
    <sec id="sec-3">
      <title>2. Related work</title>
      <p>
        The use of KGs across many domains has increased over the past few years with the rise in
popularity of diferent machine learning (ML) models. As discussed in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], there is a desire to
explain the decision process followed by an AI model. Since KGs are structured, they can be
used to explain the data they model in a consistent way, that is readable by humans as well as
being machine processable. Businesses such as Unilever are now investing in solutions that
support the representation of their data in KGs to enhance AI powered data analysis [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>The reuse of concepts from other ontologies is both a key step in many ontology development
methodologies [3, 4] and in ontology alignment [5]. One possible approach to support reuse
consists of collecting a set of terms and utilising the NCBO recommender [6] to recommend a set
of candidate ontologies. Some examples of ontologies in the relevant domains are: Nanomine [7],
SIO (Semanticscience Integrated Ontology) [8], and ChEBI (Chemical Entities of Biological
Interest) [9]. However, often ontology recommendation engines rely mainly on the syntactic
similarity between class and property labels, thus potentially missing good matching candidates.
Furthermore, some of the ontological entities can be modelled diferently; for example, all of
the compounds in ChEBI are represented as classes, whereas, in other cases these compounds
may be represented as instances of a generic class like “Chemical Compound”.</p>
      <p>Whilst these ontologies have difering target domains, there is still some overlap between them
as they describe general concepts. This raises the issue of the terminological heterogeneity in</p>
      <sec id="sec-3-1">
        <title>1Analytical Information Markup Language (AnIML): https://www.animl.org/</title>
        <p>ontologies, as the same concepts may be described in diferent ontologies in diferent ways [ 10].
This can be particularly problematic when aligning ontologies, as alignment algorithms may
struggle to identify that two concepts are related when they represented in diferent ways,
leading to a low precision and recall [11].</p>
        <p>A key aspect of this work is the extraction of knowledge from semi-structured data sources.
We focus on semi-structured data in XML, utilising mapping languages to represent the
knowledge in the XML files [ 12]; however, this is not the only semi-structured data format. The
SemTab challenge [13] provides a framework to evaluate the efectiveness of diferent
methodologies on the task of matching tabular data to a KG. Similar to this work, matching tabular
data to a KG allows the implicit semantics of the relationships between columns in a table
to be formalised. SemTab utilises a pre-existing KG to match the data, therefore deriving its
semantics [13]. Although our approach focuses on the generation of a KG directly from the XML
data, it is related to the SemTab challenge as use the knowledge captured in other ontologies to
validate the relationships extracted from the XML schema.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3. Knowledge graph generation pipeline</title>
      <p>We propose the pipeline shown in Figure 1 to transform the log data contained within an
AnIML file to a KG. We begin by generating a skeleton ontology; i.e. an ontology where the
true nature of the edges is not known. This involves extracting elements from the AnIML core
schema2 and the AnIML technique definition schema, 3 discarding the elements in the schema
that are unnecessary for our use case. In AnIML, there are several container elements such
as SampleSet and ExperimentStepSet that provide no experiment specific information. By
ignoring these elements, we can extract the relevant information from the AnIML files for a
simpler representation within the KG. The remaining concepts are then represented in the
graph, with edges connecting concepts being taken from the structure of the AnIML schema.
The names of these properties are hypothesised by the adding the “has” prefix to the name of
the child concept, or attribute, whilst the true nature of the property is unknown. For example
the property connecting ani:Sample and ani:SampleID would be ani:hasSampleID.</p>
      <p>The following steps are shown in section A of Figure 1, and are expanded in more detail in
section B. We combine the names of concepts and their descriptions into a single string from
both our skeleton ontology and the ontology we wish to align to, in this case SIO [8]. We then
identify conceptual matches between the two ontologies. For example, comparing ani:role
with sio:SIO_000016 (which has the label “role”) would result in a similarity score of 77.6%.
Through experimentation we can fine tune a threshold of acceptance for a correct match. In
Figure 1, the Jaro-Winkler string distance metric is used to find matches as it places value on a
shared prefix [ 14]. By combining the concept name and description into a single string with
the format “name, description”, concepts that share a name are more likely to be identified,
whilst not disregarding concepts that have diferent names but similar descriptions. Once a
set of alignments have been established, they are validated by hand as automatic alignment
algorithms may struggle to achieve high precision and recall [11].</p>
      <p>Using the context provided by the alignments, we predict the semantics of the unknown
properties in our ontology. This is done by selecting a triple with an unknown property, and
creating a subgraph from our ontology containing all triples with a distance  ∈ [0, … , 1] away
from the subject of our selected triple, thus capturing the context surrounding this triple, in
the form of related concepts from both our skeleton ontology and the aligned ontology. For
example, to predict the true nature of ani:hasRole, the subgraph would include triples such as
“ani:Sample ani:hasRole ani:role .”, “ani:Sample ani:hasSampleID ani:sampleID .
”, and “ ani:role skos:broadMatch sio:SIO_000016 .” The subgraph can be used to form
a prompt for an LLM such as ChatGPT,4 requesting a prediction of the predicate in our selected
triple, which is validated by a domain expert to finalise the AnIML Core Ontology.</p>
      <p>We can now consider the AnIML log files. We extract the data from the files and populate
the KG, assigning the data as an instance of the class related to the element or attribute that
the data came from [12]. At this point we can enrich the knowledge in the graph by aligning
to other ontologies. In our case we initially consider chemical ontologies such as ChEBI [9],
as it provides access to a large dataset that can be used to train machine learning models for</p>
      <sec id="sec-4-1">
        <title>2https://github.com/AnIML/schemas/blob/master/animl-core.xsd 3https://github.com/AnIML/schemas/blob/master/animl-technique.xsd 4https://chat.openai.com/</title>
        <p>tasks such as chemical to chemical reaction prediction [15]. This enriched KG will support
Unilever’s scientists in their data analysis. To compute these alignments we will match the
chemical formula of compounds found in AnIML files to those found in ChEBI.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>4. Discussion and conclusions</title>
      <p>The pipeline illustrated in Figure 1 provides a novel method for semi-automatically creating
an ontology from an XML schema. This contribution has the potential to increase the rate in
which data is translated into semantic formats. There is vast amount of data across the web
stored in XML based formats like AnIML, so processes for consistently converting the schemata
describing this data into ontologies can eliminate one of the issues preventing the mass-adoption
of semantic web technologies in the analytical domain [16]. The pipeline consists of two stages
that involves the human validation of alignments and predictions. These stages can be used to
quantitatively evaluate the efectiveness of the alignment and prediction methods respectively,
by having the evaluator record the results and calculate the precision, recall, and F-score of
the approach, which can be used to compare with other methods. Another possible evaluation
metric is the KG’s ability to answer a set of competency questions defined by the domain experts
in our industrial use case (although this qualitative evaluation method is use-case specific).</p>
      <p>Although our pipeline was designed with a very specific use case in mind, it can be generalised
with limited efort to other domains, provided that the data is expressed in a semi-structured
format with an explicit schema. An additional requirement is the existence of some ontological
coverage or overlap, so that the knowledge extracted from the schema can be validated.</p>
      <p>When designing this pipeline, we decided not to re-use any specific ontology or extend an
ontology to cover the AnIML schema. The motivation for this decision was our use case. As all
of the data generated in the experiments is the intellectual property of Unilever, some data may
be expressed in a non-standard way. In these cases, extending pre-existing ontologies to cover
these proprietary concepts may become dificult, as the way they relate to other concepts may
be overly complex. Instead, the creation of a specific ontology for Unilever that is supported
by other ontologies appears to be a better alternative, as the relationship between proprietary
concepts and the standard concepts will be simpler and the ontology will be smaller. However,
evaluating the diferences between these two approaches is an avenue for future work.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgements References</title>
      <p>This work has been funded by an EPSRC ICASE studentship, 201146 with Unilevel PLC.
[3] N. F. Noy, D. L. McGuinness, Ontology development 101: A guide to creating your first
ontology, Technical Report, Stanford knowledge systems laboratory technical report
KSL01-05, 2001.
[4] M. Uschold, M. King, Towards a methodology for building ontologies, in: Proceedings
of the Workshop on Basic Ontological Issues in Knowledge Sharing, International Joint
Conference on Artificial Intelligence, 1995.
[5] M. Granitzer, V. Sabol, K. W. Onn, D. Lukose, K. Tochtermann, Ontology alignment—a
survey with focus on visually supported semi-automatic techniques, Future Internet 2
(2010) 238–258.
[6] M. Martínez-Romero, C. Jonquet, M. J. O’connor, J. Graybeal, A. Pazos, M. A. Musen, Ncbo
ontology recommender 2.0: an enhanced approach for biomedical ontology
recommendation, Journal of biomedical semantics 8 (2017) 1–22.
[7] J. P. McCusker, N. Keshan, S. Rashid, M. Deagen, C. Brinson, D. L. McGuinness, Nanomine:
A knowledge graph for nanocomposite materials science, in: The Semantic Web-ISWC
2020: 19th International Semantic Web Conference, Athens, Greece, November 2-6, 2020,
Proceedings, Part II 19, Springer, 2020, pp. 144–159.
[8] M. Dumontier, C. J. Baker, J. Baran, A. Callahan, L. Chepelev, J. Cruz-Toledo, N. R. Del Rio,
G. Duck, L. I. Furlong, N. Keath, et al., The semanticscience integrated ontology (sio) for
biomedical research and knowledge discovery, J. of biomedical semantics 5 (2014) 1–11.
[9] K. Degtyarenko, P. De Matos, M. Ennis, J. Hastings, M. Zbinden, A. McNaught, R. Alcántara,
M. Darsow, M. Guedj, M. Ashburner, Chebi: a database and ontology for chemical entities
of biological interest, Nucleic acids research 36 (2007) D344–D350.
[10] P. Mitra, G. Wiederhold, Resolving terminological heterogeneity in ontologies, in:
Proceedings of the ECAI workshop on Ontologies and Semantic Interoperability, 2002, pp.
45–50.
[11] Z. Dragisic, V. Ivanova, P. Lambrix, D. Faria, E. Jiménez-Ruiz, C. Pesquita, User validation
in ontology alignment, in: 15th International Semantic Web Conference , Kobe, Japan,
October 17–21, 2016, Proceedings, Part I 15, Springer, 2016, pp. 200–217.
[12] A. C. Junior, F. Orlandi, D. O’Sullivan, C. Dirschl, Q. Reul, Using mapping languages for
building legal knowledge graphs from xml files, in: 2nd International Contextualized
Knowledge Graphs Workshop (CKG’19) at the 18th International Semantic Web Conference,
2019. ArXiv preprint arXiv:1911.07673.
[13] N. Abdelmageed, J. Chen, V. Cutrona, V. Efthymiou, O. Hassanzadeh, M. Hulsebos,
E. Jiménez-Ruiz, J. Sequeda, K. Srinivas, Results of semtab 2022, Semantic Web Challenge
on Tabular Data to Knowledge Graph Matching 3320 (2022).
[14] M. Cheatham, P. Hitzler, String similarity metrics for ontology alignment, in: The Semantic
Web–ISWC 2013: 12th International Semantic Web Conference, Sydney, NSW, Australia,
October 21-25, 2013, Proceedings, Part II 12, Springer, 2013, pp. 294–309.
[15] R. T. Sousa, S. Silva, C. Pesquita, The supervised semantic similarity toolkit, in: European</p>
      <p>Semantic Web Conference, Springer, 2022, pp. 42–46.
[16] P. Hitzler, A review of the semantic web field, Communications of the ACM 64 (2021)
76–83.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>I.</given-names>
            <surname>Tiddi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Schlobach</surname>
          </string-name>
          ,
          <article-title>Knowledge graphs as tools for explainable machine learning: A survey</article-title>
          ,
          <source>Artificial Intelligence</source>
          <volume>302</volume>
          (
          <year>2022</year>
          )
          <fpage>103627</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Zheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. V.</given-names>
            <surname>Kostylev</surname>
          </string-name>
          , G. Cheng, E.
          <string-name>
            <surname>Jimenez-Ruiz</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Soylu</surname>
          </string-name>
          , E. Kharlamov,
          <article-title>Enhancing knowledge graph generation with ontology reshaping - bosch case</article-title>
          ,
          <source>in: European Semantic Web Conference</source>
          , Springer,
          <year>2022</year>
          , pp.
          <fpage>299</fpage>
          -
          <lpage>302</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>