<!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>Evaluating Semantic Queries for Dataset Engineering on the Hyperknowledge Platform</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Marcio Moreno</string-name>
          <email>mmoreno@br.ibm.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Polyana Bezerra</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rodrigo Costa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>V tor Nascimento</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Elton Soares</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marcelo Machado</string-name>
          <email>marcelo.machadog@ibm.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IBM Research, Brazil</institution>
          ,
          <addr-line>Av Pasteur 146 Rio de Janeiro - RJ</addr-line>
          ,
          <country country="BR">Brazil</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Machine learning typically requires training and validation of models with large and heterogeneous datasets. The engineering of these datasets is a critical task for enabling high accuracy and generalization, although in many cases it is done following an ad-hoc approach. Hyperknowledge can enable more structured engineering of datasets, by representing the datasets' symbolic and non-symbolic information, within the same framework, and enabling queries for dataset creation, retrieval, resampling, and combination. In this poster paper, we present how the Hyperknowledge Platform evaluates those queries and analyze its performance quantitatively. The preliminary results indicate that our platform can support data scientists' work while adding negligible time overhead.</p>
      </abstract>
      <kwd-group>
        <kwd>Hyperknowledge</kwd>
        <kwd>Hybrid Knowledge Representation</kwd>
        <kwd>Hyperlinked Knowledge Graph</kwd>
        <kwd>HyQL</kwd>
        <kwd>Multimodal data</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        As the popularity of Machine Learning (ML) tasks increases, so does the amount
of data used to train and test them. The e ectiveness of such algorithms is related
to the quality and variety of the data applied during the training stage [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The
continuous growth in size and heterogeneity of datasets used in ML tasks makes
what we call Dataset Engineering (DE) a key step for e ective data exploitation,
leading to more e ective models. Here we de ne DE as the process of handling
data through structuring and traceability. In this paper, we present how the
Hyperknowledge Platform [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] enables the engineering of datasets, by leveraging
the Hyperknowledge (HKW) model and the Hyperknowledge Query Language
(HyQL). We evaluate the response times of the HyQL queries related to those
tasks to check if these are lower, or in the same order of magnitude, as the
requirements posed by other data science tasks (such as model training, raw le
transfer time, and size). Thus, we designed a testbed containing a dataset that
Copyright © 2021 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
combines a domain ontology and a dataset of images along with its metadata
and bounding boxes descriptions; and a set of queries that represents DE-related
tasks. We argue our approach can assist data scientists in their tasks saving time
and promoting better data exploitation.
2
      </p>
      <p>
        Hyperknowledge Platform
The central component of the HKW Platform, depicted in Figure 1, is the
HKBase that stores and maintains instances of HKW models. It has a exible
internal architecture to which components can be coupled through the
implementation of one of its APIs (IObserver, IDataBase, and IReasoner).
The functionalities provided
by HKBase are exposed to
applications through its
RESTful API. The current HKBase
implementation uses two
different data sources, one for
storing data structured
following the HKW model and
another for storing
unstructured content, which can be
used for storing datasets. It
also contains both the query
and reasoning engines that
will be used for processing Fig. 1. HKW Platform architecture [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
HyQL queries. An engine implementation might be optimized depending on
which data source is being used for storing the model, without creating a hard
dependency for HKBase.
      </p>
      <p>The HyQL engine's main components are its grammar 2 and its processing
engine. The processing steps followed by the HyQL processing engine are
summarized in Algorithms 1 and 2. In both algorithms, the variable insertClauses
will be used to store the set of pairs (c; E) such that c is the target context and E
is the set of entities to be inserted in c. Meanwhile, the variable updateClauses
will store the set of tuples (c; E; C; P ) such that c is the target context, E is the
set of entities to be inserted in c, C is the set of contexts to be generated by the
SPLIT function, and P is the set of proportion values associated with each
context in C. Finally, in Algorithm 1, the variable R stores the set of entities/rows
to be retrieved by the query.</p>
      <p>The execDEClauses function logic is described in Algorithm 2. This function
receives the insertClauses and updateClauses variables, passed as parameters
to the call performed in line 13 of Algorithm 1, to identify which contexts and
reference nodes 3 must be created in HKBase as a result of the query.
2 Accessible at https://ibm.box.com/v/iswc2021-hyql-grammar. For clarity, we have
suppressed the handling of spaces, comments, and lower case keywords.
3 Reference node is a special type of HKW node that promotes the reuse of nodes
across multiple contexts.</p>
      <p>Algorithm 1: HyQL engine main
processing steps.</p>
      <p>Algorithm 2: Dataset
engineering clauses execution.</p>
      <p>Input: HyQL Query Q
1 insertClauses = ;; updateClauses = ;; R = ;;
2 subQueriesObjects = P arseQuery(Q);
3 foreach subquery object sQ of
1110654789 subiisssssmQffQQQQQssgueussQQreIURRDpeQQgtdrRDea=eUI=U=aist)aesptua;6=(setQ6=gd(slaOsCt=eaQR;Q)S;ttbl;cReaejFtcw;tChteu;ehesicsesslt=tQetaQunehcnsEushlECRat;dsDa)sd;ve;do(dsa=a(sdQstlQsuaQgsPQR(aeQ,;stItesQUsIesQQtCn)uot;sREoloeitn))nSr;st=setCetr,rlaatsiCuQnslt)ase;u((sssQQes,,;
12 end
13 execDEClauses(insertClauses; updateClauses);
14 return R
To evaluate our work quantitatively, we have measured the median execution
time the HyQL engine spends executing some of the queries related to DE tasks.
The main goal of this evaluation is to answer the following research questions
(RQs): (RQ1) Is the time required to answer DE queries within our platform
lower or in the same order of magnitude as the time consumed by other data
science tasks, such as model training and raw le transfer time? (RQ2) Are there
meaningful di erences in response times across HKBase con gurations?</p>
      <p>
        To answer those RQs, we designed an experimental dataset based on the
Pascal VOC2012 [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Using the HKW Platform, this dataset was represented as
an HKW context containing descriptions of its classes, images, and relationships
between the bounding boxes of images and classes using 20 concept nodes, 17.125
content nodes, and 57.263 links between node anchors, respectively.
      </p>
      <p>Based on this dataset we designed 11 experimental queries, presented in
Table 1, that include 4 SELECT queries, 4 INSERT queries based on the results
of SELECT queries, an UPDATE query that splits data into multiple contexts, a
SELECT query that uses spatial operators for ltering results, and an INSERT
query based on this SELECT query.</p>
      <p>In total, 3 HKBase con gurations, presented in Table 2, were evaluated.
Evaluating multiple combinations of HKBase data sources, and HyQL engine
implementations, helps us understand which con gurations perform better for
each type of query and allows us to nd the optimal setting for a given scenario.</p>
      <p>The Generic HyQL engine implementation can work with any data source
supported by HKBase as all query processing is performed using the standard
data source API (IDB) while the SPARQL-based HyQL engine optimizes the
processing of HyQL clauses in Jena by translating them directly into a single
SPARQL query with multiple subqueries.</p>
      <p>
        The hardware in which Table 1. HyQL queries designed for experiments.
these experiments were exe- ID HyQL Query
cuted was composed of two QQ21 SSEELLEECCTT tdraatiansientg set
dedicated Dell OptiPlex 7050 Q3 SELECT test set
machines 4. Half the repeti- Q4 SELECT distinct image WHERE image has cat
tions for every con guration Q5 IVNASLEURETSI(NSTEOLEmCyTDdaatatsaestest)
were executed on each machine Q6 IVNASLEURETSI(NSTEOLEmCyTTrtaraininininggSestest)
to guarantee a fair compari- Q7 IVNASLEURETSI(NSTEOLEmCyTTetsetsStestest)
son. The software setup of both INSERT INTO myCatImages
machines was also the same 5. Q8 VALUES (SELECT distinct image
eTxhpeersimcreipnttss wuesreed i mtoplermunenttehde (UWSPPHDLEAIRTTE(Eimimdaaagtgea,ese[h"taismsAacPgaetP)LtrYaining set",
iCnomPpyotsheonto adnedplouysedandDorcekseert Q9 ["G0iRm:6O5a;gU0eP:0v5aB;liY0d:a3itm]i)oanges)et", "image test set"],
the service containers. Both the Q10 SAENLDECimTagimeahgaes WcaHtAERNED ipmearsgoenhcaosnptaerinsosncat
server and the client script ran INSERT INTO myCatAndPersonImages VALUES
on the same host machine. For Q11 (SELECT image WHERE image has person
running the queries, the dataset AND image has cat AND person contains cat)
was loaded once and all the Table 2. HKBase con gurations evaluated.
queries were executed in se- Con guration Description
quence, following their numeri- HKGBe+nerMiconHgyoQDLB + anHdKGBeanseerwicitHhyMQoLnegnogDinBe.
cal order. All repetitions of each HKB + Jena + HKBase with Jena and
query were also executed in se- HGKenBer+icJHenyQaL+ HGKenBearsice HwiytQhLJeennagianned.
quence and after each repeti- HyQLtoSPARQL SPARQL-based HyQL engine.
tion of queries with INSERT
and UPDATE clauses, the execution script removed all the entities generated by
the previous repetition to preserve the IID assumption [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        A total of 100 query repetitions were executed on each machine, totaling 200
query repetitions. As highlighted by the 95% con dence intervals (vertical black
lines on the upper edge of each bar) in the bar plots of Figure 2, these were
su cient to allow distinguishing which con gurations were performed better for
each query. These preliminary results indicate that the time overhead required
for using our system is minimal when compared to time spent in typical data
science tasks, such as: (1) tting a model to the data (training), which can take
multiple days or even months; (2) managing datasets manually, which currently
consumes a high proportion of data scientists' work hours [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>Therefore, we conclude that the answer to the RQ1 is that the requirements
posed by our solution can be up to several orders of magnitude lower than
the requirements posed by other data science tasks, introducing an overhead
of at maximum a couple of minutes required for the retrieval, creation and/or
integration of datasets using our system, while removing the need of performing
several tasks manually. Also, with regards to RQ2, the results indicate that HKB
+ Jena + HyQLtoSPARQL con guration presents lower response times.
Q1</p>
      <p>Q2</p>
      <p>Q3</p>
      <p>Q4</p>
      <p>Q5</p>
      <p>Q6
Query</p>
      <p>Q7</p>
      <p>Q8</p>
      <p>Q9</p>
      <p>Q10</p>
      <p>Q11</p>
      <p>Conclusion
In this paper, we presented how the HKW Platform enables semantic queries
for dataset engineering. The main contributions of this work are the proposal,
implementation, and evaluation of the HyQL engine extensions required for
supporting these queries. Data scientists could use this solution to nd new datasets,
balance, clean, and resample them, and select speci c features, which saves time
and promotes better data exploitation. The quantitative analysis of the HyQL
engine has indicated that the queries discussed in this work can be evaluated
in a reasonable amount of time. When we compare the results obtained in our
preliminary analysis with the time currently spent for DE and ML tasks, we
conclude that the overhead introduced by our approach is negligible.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Anaconda</surname>
          </string-name>
          <article-title>: 2020 state of data science</article-title>
          .
          <source>Tech. rep., Anaconda</source>
          , Inc. (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Donatiello</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nelson</surname>
          </string-name>
          , R.:
          <article-title>Performance evaluation of computer and communication systems: joint tutorial papers of Performance'93</article-title>
          and Sigmetrics'
          <volume>93</volume>
          , vol.
          <volume>729</volume>
          . Springer Science &amp; Business
          <string-name>
            <surname>Media</surname>
          </string-name>
          (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dong</surname>
            ,
            <given-names>X.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rekatsinas</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Data integration and machine learning: A natural synergy</article-title>
          .
          <source>In: Proceedings of the 2018 international conference on management of data</source>
          . pp.
          <volume>1645</volume>
          {
          <issue>1650</issue>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Everingham</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eslami</surname>
            ,
            <given-names>S.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Van Gool</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Williams</surname>
            ,
            <given-names>C.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Winn</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zisserman</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>The pascal visual object classes challenge: A retrospective</article-title>
          .
          <source>International journal of computer vision 111(1)</source>
          ,
          <volume>98</volume>
          {
          <fpage>136</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Moreno</surname>
            ,
            <given-names>M.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Santos</surname>
          </string-name>
          , R.C.,
          <string-name>
            <surname>dos Santos</surname>
            ,
            <given-names>W.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cerqueira</surname>
          </string-name>
          , R.: Kes:
          <article-title>The knowledge explorer system</article-title>
          . In: International Semantic Web Conference (P&amp;D/Industry/BlueSky) (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>