<!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>Agile Knowledge Graph Testing with TESTaLOD</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Valentina Anita Carriero</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabio Mariani</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrea Giovanni Nuzzolese</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Valentina Pasqual</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Valentina Presutti</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>FICLIT, University of Bologna</institution>
          ,
          <addr-line>Bologna</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>STLab, ISTC-CNR</institution>
          ,
          <addr-line>Rome</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>XD is an agile methodology for knowledge graph construction focused on the continuous and iterative interaction between the development team and the testing team. This interaction is aimed at formally validating the resulting knowledge graphs with respect to clear ontological commitments identified as competency questions. In this paper we present and demonstrate TESTaLOD, which is a tool designed and implemented for supporting the testing team of XD projects with an easy-to-use web-based toolbox.</p>
      </abstract>
      <kwd-group>
        <kwd>Knowledge graph testing</kwd>
        <kwd>eXtreme Design</kwd>
        <kwd>ArCo</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>Related work</title>
      <p>
        Many languages, frameworks, methodologies and tools have been developed for
evaluating and testing ontologies. Among the available tools, it is worth
mentioning RDFUnit, built to perform a test-driven evaluation of linked data quality [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
It can run automatically a set of manually generated test cases. Those test cases
are executed as SPARQL queries against an endpoint; thus, an endpoint is always
      </p>
      <p>Copyright c 2019 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).</p>
      <p>
        V.A. Carriero et al.
required. Instead, TESTaLOD provides the possibility to run test cases without
a SPARQL endpoint. This functionality addresses the requirement of enabling
the testing process without having a SPARQL endpoint available, which can be
most likely the case when a knowledge graph is embryonic. SHARK (SHACL
Reasoning over Knowledge-graphs), which reuses RDFUnit tool to run the tests
and give the results, is a test-driven ontology validation framework for testing
an ontology using predefined or custom SHACL tests [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Taking SHARK as
reference framework due to its easy-to-use web interface, our platform has been
developed implementing new technical features to support XD methodology, i.e.
the possibility to perform automatically backward execution requires several files
to be uploaded at the same time, from different sources. In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] it is also proposed
OOPS! (OntOlogy Pitfall Scanner!), which is another Web application we took
in consideration. It is a diagnosis tool that, in addition to the detection of
potential errors in ontologies – that is based on a catalogue of the most common
pitfalls when developing an ontology – recommends some tips to repair them.
Its detection methods mainly rely on structural pattern matching and linguistic
analysis.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>The TESTaLOD web tool</title>
      <p>
        TESTaLOD is a Web application designed for providing the XD methodology
with a testing toolbox for supporting knowledge graph (KG) testing3. XD is
an iterative and incremental methodology, and involves different actors: (i) a
designer team, in charge of modelling a KG; (ii) a testing team, disjoint from
the designer team, which takes care of testing the KG; (iii) a customer team,
who elicits the requirements that are translated into ontological commitments
(i.e. competency questions and other constraints) that guide the KG
development. TESTaLOD uses the TestCase OWL meta model introduced in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] as the
reference schema for representing unit tests, a means for validating ontology
as well as data commitment. In such a schema, a unit test is modelled as a
competency question (CQ) expressed in natural language and associated with a
corresponding SPARQL query. Additionally, an expected result and a reference
data sample can be provided4. This allows to validate the CQ by executing the
SPARQL query with respect to the data sample, assessing the correspondence to
the expected result. TESTaLOD implements a two-step workflow as presented
in Figure 1, which is powered by a Web-based user interface that allows a user
to select and automatically execute an arbitrary number of defined test cases
modelled by using the TestCase OWL meta model.
      </p>
      <p>
        The first step requires a user to provide one or more test cases as input.
Those test cases can be either retrieved from a Github repository (cf. Figure 1
3Though there is no consensus on what a KG is [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], in the scope of this paper we
informally refer to a KG as linked (open) data including both OWL and RDF entities,
and both schema axioms and factual data.
      </p>
      <p>4More information on test structure and examples are provided in TESTaLOD
documentation’s section: http://testalod.herokuapp.com/documentation
Agile Knowledge Graph Testing with TESTaLOD
step 1(a)) or directly uploaded from a local file system (cf. Figure 1 step 1(b)).
When step 1(a) is selected by the user, TESTaLOD retrieves all the test cases
available in the repository by recursively traversing the subfolders reachable from
the repository root. After all the test cases are retrieved, the user is presented
with an additional view (step 2). This view allows the user to decide whether
or not to execute all the test cases found in the repository selectively. On the
contrary, if step 1(b) is selected, then all uploaded local files are directly tested.
Both alternatives allow the user to visualise a view that reports the output of
the automatic execution of the selected test cases. There are 3 possible outcomes
resulting from the execution of a test case with TESTaLOD, i.e. (i) the test
case is fully successful, thus the corresponding record in the user interface is
green coloured; (ii) the test case is partially successful (the test results do not
match completely the expected results), thus the corresponding record in the
user interface is yellow coloured; (iii) the test case is fully unsuccessful, thus the
corresponding record in the user interface is red coloured.</p>
      <p>
        TESTaLOD has been designed and implemented in the context of the ArCo
project [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. ArCo is the Italian Cultural Heritage knowledge graph, which is
developed by following eXtreme Design (XD), focused on ontology design patterns
(ODPs) reuse. The ArCo KG consists of a network of 7 vocabularies and 169
million triples about 820 thousand cultural entities. The testing activities have
been carried out by using TESTaLOD: at each ArCo new realease (or minor
change) all ArCo test cases have been executed on TESTaLOD to validate
updates of the whole KG. The test cases defined for the ArCo project and the
source code of TESTaLOD are both publicly available on GitHub5. A running
demo of TESTaLOD is available online6. In the context of the demonstration
track of the conference we will show how to use TESTaLOD in order to
validate the requirements elicited for the ArCo project and represented as test cases
formalised by using the TestCase OWL meta model.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions and future work</title>
      <p>In this paper we demonstrated TESTaLOD, a tool supporting knowledge graph
test focused on reducing the human effort at testing time. An ongoing work is
a new tool section that offers a graphical interface for compiling test case OWL
files with all the required annotations and for storing OWL files on a selected
Github folder, hence, ready to be tested. This update, in addition to facilitating
and speeding up the test activity, would be a great support for the creation of
TestCase OWL files, helping users in test cases’ validation and avoiding TestCase
meta model misuse.</p>
    </sec>
    <sec id="sec-5">
      <title>References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Eva</given-names>
            <surname>Blomqvist</surname>
          </string-name>
          et al. “
          <article-title>Experimenting with eXtreme Design”</article-title>
          .
          <source>In: Proc. of EKAW</source>
          <year>2010</year>
          .
          <article-title>(Lisbon, Portugal)</article-title>
          . Vol.
          <volume>6317</volume>
          . Springer,
          <year>2010</year>
          , pp.
          <fpage>120</fpage>
          -
          <lpage>134</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Eva</given-names>
            <surname>Blomqvist</surname>
          </string-name>
          et al. “
          <article-title>Engineering Ontologies with Patterns - The eXtreme Design Methodology</article-title>
          .” In:
          <article-title>Ontology Engineering with Ontology Design Patterns</article-title>
          . Vol.
          <volume>25</volume>
          .
          <article-title>Studies on the Semantic Web</article-title>
          . IOS Press,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Piero</given-names>
            <surname>Andrea</surname>
          </string-name>
          Bonatti et al. “
          <article-title>Knowledge Graphs: New Directions for Knowledge Representation on the Semantic Web (Dagstuhl Seminar 18371)”</article-title>
          .
          <source>In: Dagstuhl Reports 8.9</source>
          (
          <issue>2019</issue>
          ), pp.
          <fpage>29</fpage>
          -
          <lpage>111</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Valentina</given-names>
            <surname>Anita</surname>
          </string-name>
          Carriero et al. “
          <article-title>ArCo: the Italian Cultural Heritage Knowledge Graph”</article-title>
          .
          <source>In: Proc. of ISWC</source>
          <year>2019</year>
          <article-title>- accepted for publication</article-title>
          .
          <source>(Auckland</source>
          , New Zealand).
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Dimitris</given-names>
            <surname>Kontokostas</surname>
          </string-name>
          et al. “
          <article-title>Test-driven Evaluation of Linked Data Quality”</article-title>
          .
          <source>In: Proc. of WWW 2014</source>
          . Seoul, Korea: ACM,
          <year>2014</year>
          , pp.
          <fpage>747</fpage>
          -
          <lpage>758</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>María</given-names>
            <surname>Poveda-Villalón</surname>
          </string-name>
          et al. “
          <article-title>OOPS! (OntOlogy Pitfall Scanner!): An Online Tool for Ontology Evaluation”</article-title>
          .
          <source>In: Int. J. Semant. Web Inf. Syst. 10.2</source>
          (
          <issue>2014</issue>
          ), pp.
          <fpage>7</fpage>
          -
          <lpage>34</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Gustavo</given-names>
            <surname>Correa</surname>
          </string-name>
          <article-title>Publio. “SHARK: A Test-driven Framework for Design and Evolution of Ontologies”</article-title>
          .
          <source>In: Proc. of ESWC</source>
          <year>2018</year>
          .
          <year>2018</year>
          .
          <article-title>5The test cases are</article-title>
          available at https://github.com/ICCD-MiBACT/ArCo/tree/ master/ArCo-release/test/CQ, while
          <article-title>the source code of the tool is</article-title>
          available at https: //github.com/TESTaLOD/TESTaLOD. 6http://testalod.herokuapp.com/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>