<!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>Type Checking Semantically Lifted Programs via Query Containment under Entailment Regimes</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Informatics, University of Oslo</institution>
          ,
          <country country="NO">Norway</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Semantically lifted programs integrate declarative ontologybased knowledge modelling into imperative programming. In this approach, each state of a program is mapped into an OWL knowledge base (KB) and enriched with user-de ned knowledge; the resulting KB can be accessed from the program using standard Semantic Web queries. The result of a query, however, should conform the type system of the program. We present a technique for checking type conformance statically, which is based on query containment over OWL KBs. We then discuss an approximation method for type checking, which exploits concept subsumption rather than containment and hence allows for an e cient implementation using existing tools. Finally, we describe our implementation of semantically lifted programs with static type checking in language SMOL.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Semantic lifting [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a technique for
incorporatiWngebdetecclahrnaotliovgeieds,atsaucahccaesss ObWasLed onontoltohgeiesSe[m2]anantidc Staitonte 1 OEnxttoerlongayl
tSaPtAioRnsQ: Lru[n3t,4im], einsttoatiems poefraatniviemppreorgartaivmempirnoggrcaommpaure- Staceexutemq2aupepriyng KG import
mapped (i.e., lifted ) into OWL ontologies and enriched
with external user-de ned ontologies, and the result can be queried from the
program using a declarative language such as SPARQL under an entailment regime.
The gure to the right shows a part of a computation: a transition between
congurations depends on the mapped con guration and external ontology. This
approach allows for a tight integration of the imperative and declarative paradigms,
while preserving a clear separation between data modelling and program
computations. It is realised in Semantic Micro Object Language (SMOL) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], a Java-like
object-oriented language whose distinctive feature is access expressions, which
load the results of SPARQL queries, evaluated over the lifted enriched ontology
under an entailment regime [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">5,6,7</xref>
        ], into lists of objects.
      </p>
      <p>
        Semantic lifting is convenient when static expert domain knowledge in the
form of ontologies should tightly interact with the dynamic setting of a program's
1 class Platform(List&lt;Server&gt; serverList) ... end
2 class Server(List&lt;Task&gt; taskList) ... end
3 class Scheduler(List&lt;Platform&gt; platformList)
4 Unit reschedule()
5 List&lt;Platform&gt; l:=access("SELECT ?x WHERE {?x a Overloaded}");
6 this.adaptPlatforms(l);
7 end
8 end
runtime. In particular, as illustrated in Fig. 1, semantic lifting allows us to
integrate an external ontology into a program directly, without reimplementing
it. The SMOL program in this example models a scheduling mechanism for a
cloud system: a platform has a list of servers, each of which in turn have a list of
tasks, and a scheduler retrieves the list of all overloaded platforms by executing
a SPARQL query on its own state lifted to an OWL 2 DL [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] ontology and
enriched by a (not shown) external ontology, which de nes, among others, symbol
Overloaded. Semantic lifting also suits for program debugging, in particular for
detecting bugs stemming from the domain misrepresentation, which are semantic
errors that are very di cult to catch using standard debugging methods [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>The example in Fig. 1 also shows that the interaction between ontology
reasoning and program states is challenging to handle for a type system. In
particular, for type safety of the access assignment, one must verify that the
query returns only instances of class Platform. However, since Overloaded is not
de ned within the program itself, a system needs to analyse the interaction
between the state lifting mechanism, the external ontology, and the query for
such veri cation. Moreover, the situation can be more complicated if the query
is parametrised by program expressions evaluated in the current state.</p>
      <p>
        Type checking in SMOL of Kamburjan et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is fully dynamic; in
particular, the types of query answers are checked only in runtime. It is well-known,
however, that dynamic type checking approach is prone to errors that are di
cult to catch. Thus most of the state-of-the-art object-oriented query languages
are equipped with a static type checker, which detect possible type mismatches
without running the program. In this paper, we ful l this gap for SMOL by
developing a static type checking approach for the language, in particular, its access
expressions. Speci cally, we reduce veri cation whether a query always returns
a list of entities of the correct type to the containment of the query in the query
corresponding to the type with respect to the TBox of the lifted and
external ontologies under the used entailment regime; here, TBox is a terminological
part of an OWL 2 ontology when seen as a description logics (DL) knowledge
base [
        <xref ref-type="bibr" rid="ref10 ref11 ref9">9,10,11</xref>
        ]. Note that the semantic lifting mechanism of SMOL guarantees that
the TBox depends only on the program, but not a speci c state, which allows
us to check containment statically, without running the program.
      </p>
      <p>
        Practical applicability of these results is limited by the lack of implemented
algorithms for query containment under expressive entailment regimes, such as
the OWL 2 regimes [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] relevant to this work (the situation is better for weaker
regimes: e.g., Chekol et al. [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] designed and implemented containment for the
RDFS regime, and their paper has a good survey of the state of the art). To
overcome this issue, we show that, for simple but most common conjunctive queries,
the containment can be approximated by DL concept subsumption, which is a
standard DL reasoning problem with e cient implementations [
        <xref ref-type="bibr" rid="ref10 ref11 ref9">9,10,11</xref>
        ].
      </p>
      <p>Our implementation of SMOL with a static type system based on our results
is available at github.com/Edkamb/SemanticObjects.</p>
      <p>
        Related Work. SMOL is an imperative programming language that uses SPARQL
and OWL as declarative sublanguages [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. There are many combinations in
this spirit, which either enable both paradigms in one language (e.g., Scala
and Python) or incorporate one paradigm into the other as a domain-speci c
language (e.g., algorithm blocks in Modelica). Leaving a review of such
combinations out of the scope, we concentrate only on approaches that directly relate
to the Semantic technologies. The closest to ours is the approach of Leinberger
et al. [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. It bridges imperative types and declarative knowledge graphs by a
technique for type checking relying on SHACL shape validation [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. This is in
contrast to our work, where the type system interacts with the semantic lifting
only through queries. Beyond type safety, integration of the semantic
technologies within programming languages is utilised in the tasks such as veri cation of
knowledge graph check assertions [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] and checking if a program stays within a
certain DL [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. More loose couplings of knowledge graphs and programs is used
to integrate existing RDF data into program types to statically check access of
such data [
        <xref ref-type="bibr" rid="ref17 ref18">17,18</xref>
        ]. Finally, some authors use the term `type checking' to detect
errors stemming from incorrect usage of ranges in domains within queries [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ].
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Description Logics and OWL</title>
      <p>
        Description Logics (DLs) [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] are a family of logic-based formalisms, which have
proven instrumental in the Semantic Web technologies. In this paper, we
generally rely on SROIQ(D), an expressive DL underlying a popular ontology
language OWL 2 DL. Here, D is a set of concrete datatypes, where each d 2 D is
associated with its domain dD of values. We write D for the union of all dD; we
also assume that D consists of Int, String, and other standard basic datatypes
with corresponding domains, as well as a special datatype Unit, which ranges
over a dedicated single value. Note, however, that the syntax and semantics of
SROIQ(D) are rather cumbersome, and many details are immaterial for this
paper. So, we will present only the essential parts of SROIQ(D), and refer to the
literature [
        <xref ref-type="bibr" rid="ref10 ref9">9,10</xref>
        ] for complete de nitions. Besides classic DL reasoning problems,
such as concept subsumption, SMOL relies on query answering over DL knowledge
bases. For brevity, we concentrate on conjunctive queries (CQs), corresponding
to a simple fragment of SPARQL query language for RDF. However, SMOL does
not rely on any speci c properties of SROIQ(D) and CQs, and, unless explicitly
speci ed, all our results are applicable to other DLs and query languages; the
choice of SROIQ(D) and CQs is justi ed by the existence of e cient OWL and
SPARQL engines, allowing us to use them in our implementation (see Section 5).
DL Syntax. Let C, R, RD, and I be disjoint sets of atomic concepts, abstract
roles, concrete roles, and individuals, respectively. A concept is either an atomic
concept or an expression recursively constructed from D, C, R, RD, and I
using appropriate syntax; for example, if C; C0 are concepts, R 2 R, T 2 RD,
d 2 D, and o 2 I, then &gt;, C u C0, :C, 9R:C, 9R :C, 9T:d, and fog are
also concepts. A TBox is a set of axioms, such as general concept inclusions
C v C0 for concepts C; C0, role functionality axioms funct P for P 2 R [ RD,
and abstract role inclusions R v R0 for R; R0 2 R (role inclusions and similar
axioms are often considered as a separate set called RBox, but we put them into
the TBox for brevity). In fact, only certain combinations of axioms are allowed
in a SROIQ(D) TBox, but these restrictions are immaterial for this paper. An
ABox is a set of assertions of the form C(a), R(a; b), T (a; n) for C 2 C, R 2 R,
T 2 RD, a; b 2 I, and n 2 D; note that each ABox assertion can be written as
a TBox inclusion (e.g., C(a) is equivalent to fag v C by the semantics below);
however, it will be convenient for us to consider ABox separately. A SROIQ(D)
knowledge base (KB ) is a pair (T ; A) of a TBox T and an ABox A.
DL Semantics. An interpretation I is a pair ( I ; I ) of a non-empty
domain I , disjoint from concrete domain D, and a function I mapping each
u 2 I to uI 2 I , each atomic concept C to CI I , each R 2 R to
RI I I , and each T 2 RD to T I I D. Interpretation function
I extends to concepts: &gt;I = I , (C u C0)I = CI \ (C0)I , (:C)I = I n CI ,
(9R:C)I = fu 2 I j 9v: (u; v) 2 RI and v 2 CI g, (9R :C)I = fu 2 I j
9v: (v; u) 2 RI and u 2 CI g, (9T:d)I = fu 2 I j 9n: (u; n) 2 T I and n 2 dDg,
(fog)I = foI g, etc. Assuming nI = n for each n 2 D for brevity, interpretation
I satis es axioms P v P 0 and funct P if P I (P 0)I and jfv j (u; v) 2 P I gj 1
for every u 2 I , respectively; it satis es assertions C(a), P (a; s) if aI 2 CI and
(aI ; sI ) 2 P I , respectively. It is a model of a KB K if it satis es all axioms and
assertions of K. A KB is consistent if it has a model. A concept C1 is subsumed
by a concept C2 with respect to a KB (or just TBox) K, written C1 vK C2, if
C1I C2I for every model I of K.
      </p>
      <p>Query Answering. A conjunctive query (CQ ) Q(x) with answer variables x
is an expression 9y: ', where the body ' is a conjunction of atoms C(t), d(t),
P (t; t0) and (t = t0) with C 2 C, d 2 D, and P 2 R [ RD, while t; t0 either
variables in x [ y or constants in I [ D. CQ Q(x) is unary if jxj = 1. CQ Q(x)
may be written as just Q when x is immaterial. A tuple s of constants in I [ D
is an answer to Q over an interpretation I if there is : x [ y ! I [ D such
that (x) = sI and each atom in ' holds in I|that is, (t) 2 CI , (t) 2 dD,
( (t); (t0)) 2 P I , and (t) = (t0) for each C(t), d(t), P (t; t0), and (t = t0) in ',
respectively. A tuple is a (certain) answer to Q over a KB K if it is an answer
to q over each model of K.</p>
      <p>
        RDF, OWL, and Entailment Regimes. As mentioned above, SROIQ(D)
KBs are in practice represented as OWL 2 DL ontologies in RDF format, where
both TBox and ABox are written as an RDF graph consisting of triples of IRIs,
literals (i.e., concrete datatype values), and blank nodes (i.e., named
placeholders). In turn, CQs can be translated to a core fragment of the RDF query
language SPARQL. Same as RDF, OWL and SPARQL are mature technologies
standardised by W3C, with e cient implementations of concept subsumption
checking and query answering, respectively. However, computing all certain
answers to CQs over KBs as de ned above has high computational complexity
(in fact, it is not even known whether the corresponding problem is decidable).
So, SPARQL engines instead realise so-called entailment regimes for query
answering over OWL ontologies. We refer to the literature for the speci cations
of existing entailment regimes [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">5,6,7</xref>
        ], since the only essential property for this
paper is their soundness : every answer to (the SPARQL version of) a CQ over
(the OWL 2 DL version of) a KB under an entailment regime is also a certain
answer to the CQ over the KB. Our implementation, described in Section 5 (and
illustrated in Fig. 1), uses RDF, OWL, and SPARQL rather than SROIQ(D)
and CQs; however, we use the latter in the paper for readability.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Typed Semantic Micro Object Language</title>
      <p>
        In this section, we present the version of Semantic Micro Object Language SMOL
that extends the original SMOL of Kamburjan et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] with a typing system. The
distinctive feature of SMOL is a tight two-way integration with ontologies, and
thus both the syntax and semantics of the language depend on DL KBs.
3.1
      </p>
      <p>Syntax
First, we present the syntax of typed SMOL. In a nutshell, it is a core of standard
Java with the only distinctive feature being access expression, which, as we will
see later, allows us to query a SROIQ(D) KB exported from the current state
of the program evaluation and extended with axioms de ned by a user.
De nition 1 (Typed SMOL Surface Syntax). A CQ template is a CQ with
some non-answer variables having special form %i with i 1. The syntax of
SMOL is given in Fig. 2, where C ranges over class names, f over classes' elds,
m over classes' method names, v over variables, Q over unary CQ templates,
and n over (the literals representing the elements of ) D; the rst : : : denotes
the datatypes in D besides Int, String and Unit, and the second the standard
operations over the datatypes besides + and .1</p>
      <p>A program consists of classes and a main block as the entry point for
execution. A class declares lists of typed elds and methods, and may also extend
another class. A method has a return type and a list of parameters. Besides classes
and datatypes in D, types include lists, which, as we will see, are essentially</p>
      <sec id="sec-3-1">
        <title>1 Our implementation of SMOL (see also Section 5) has additional features (e.g., Java</title>
        <p>style generic types), which are inessential for this paper and omitted for brevity.
Prog ::= Class main s end Class ::= class C extends C (T f) Met end
Met ::= T m (T v) s end T ::= C j List&lt;T&gt; j Unit j Int j String j : : :
s ::= [T] l:=rhs; j s s j if e then s else s end s</p>
        <p>
          j while e do s end s j return e; j skip;
l ::= this.f j e.f j v rhs ::= e j new C(e) j e.m(e) j access(Q; e)
e ::= null j l j n j e + e j e e j : : :
Programs, classes
Methods, types
Statements
Locations, RHS
Expressions
classes with special structure parametrised by other types. The statements are
in an imperative language similar to standard WHILE-languages [
          <xref ref-type="bibr" rid="ref20 ref21">20,21</xref>
          ], where
the right-hand side (RHS) of an assignment is an expression, an object creation,
a method call, or a semantic access (i.e., the only non-standard feature of SMOL).
Typed SMOL relies on Plotkin-style structural operational semantics [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ]: the
program state at each point of computation is formalised as a con guration, and a
set of operational rules de nes the transition system between such con gurations.
In the following de nitions, we assume an in nite supply on object identi ers
(e.g., strings), and let a domain element (DE ) be either a datatype value in D
or an object identi er. We start with the de nition of a con guration.
De nition 2 (Con guration). Let CT range over sets of classes with unique
names, X over object identi ers, over maps from variables to DEs, over maps
from elds to DEs, and i over N. Con gurations Conf, objects ob, processes2
prc and runtime statements rs are de ned by the following grammar:
Conf ::= CT ob prc
ob ::= (C; )X
prc ::= (X; rs; )i
rs ::= s j l
stack; s:
        </p>
        <p>In essence, a con guration consists of three components: class de nitions
CT, a list of objects ob with unique identi ers, and a stack of processes prc
corresponding to nested method calls. Besides its unique identi er X, each object
has the corresponding class name C and memory of elds. In turn, a process
has an id i, the object identi er X to resolve this, the runtime statement rs that
is executing, and memory of local variables. For the process on the top of the
stack, the runtime statement is the currently executed normal statement; for all
other processes, the runtime statement is of the form l stack, which denotes
that location l is waiting for a return value from the next process on the stack.</p>
        <p>As we will see below, SMOL semantics is such that the classes CT of each
reachable con guration of a program Prog are always the same. In particular, CT
includes all the classes of Prog as well as several implicit classes:</p>
      </sec>
      <sec id="sec-3-2">
        <title>2 Processes are sometimes called `stack frames' or `stack elements'; we use the term</title>
        <p>
          `process' for consistency with the previous work [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ].
{ Entry that has no elds and a single method Int entry s end, where s is the
main block statement of Prog;
{ Null that has no elds, no methods and extends every other class;
{ List&lt;T&gt; for every type List&lt;T&gt; mentioned in Prog that has two elds T head
and List&lt;T&gt; tail, and no methods.
        </p>
        <p>Thus, we call each con guration with such CT a con guration of Prog.</p>
        <p>The evaluation of a program Prog starts in an initial con guration|that is,
the con guration of Prog where the objects and processes are such that Entry
is instantiated as an object with its only method initiating the only process in
the stack, and Null as an object with identi er NULL to evaluate null expression.
Further details of this con guration are standard and inessential for the paper.</p>
        <p>
          As mentioned above, the operational semantics of SMOL is a set of conditional
rewrite rules describing transitions from one con guration into another. The
exact form of most of these rules is however immaterial to this paper. Thus, we
refrain from introducing them all of them in the de nition below, referring to
a technical report [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ]. The de nition makes use of the several notations. First,
let X be an object identi er to resolve this, be a variables map, and ob be
a list of objects; then the evaluation JeKX;ob of an expression e is a variable or
an identi er- eld pair when e is on the left of an assignment (in which case e
is always a location), or a DE in all other cases. In both cases, the evaluation
is computed in a standard way (e.g., JnullKX;ob is always NULL); however, it may
fail by reasons such as type mismatch, in which case the evaluation is unde ned.
        </p>
        <p>Second, Ans is a translation of CQ answers under an entailment regime into
the structures of the runtime semantics. Formally, let s1; : : : ; sn be the answers
to a unary CQ Q over a KB K under an entailment regime er in arbitrary order.
Let the si have a common type T if either T is a datatype and all the si are its
values, or T is the most speci c class such that all the si are object identi ers
of objects of T. If the si have a common type T, then Anser(K; Q) is the pair
(ob; Y1), where ob is the list of n new objects (List&lt;T&gt;; i)Yi , i = 1; : : : ; n, with
each i(head) = si, and with i(tail) = Yi+1 if i &lt; n and n(tail) = NULL (if
n = 0 we take ob = ; and Y1 = NULL). Otherwise Anser(K; Q) is unde ned.
De nition 3 (Transition System). The relevant rules of the SMOL transition
system are given in Fig. 3, where Q v is the CQ obtained from a CQ template Q
by substituting each variable %i in Q by element i of a list v, while TCT is a TBox
constructed from a set of classes CT, Tuser is a user-de ned TBox, and AConf is
an ABox constructed from con guration Conf; the construction is done via the
semantic lifting mechanism, which is explained in Section 3.3. Recall also that
the sets of classes in con gurations are always the same on the both sides of
every transition rule. Thus, for readability, we mention CT over ! in the rules
rather than in the con gurations on the sides of !.</p>
        <p>Rule (e-av) assigns the evaluation of an expression to a local variable. In the
rst premise, l is evaluated to a variable in the context of the object identi ed by
X, the object of the current process. In the second, expression e is evaluated to a
value v. In the conclusion, the assignment is consumed and object Y is updated
JlKX ;ob = v</p>
        <p>JeKX ;ob = v
ob prc; (X; s; [v 7! v])i
(acc-av)</p>
        <p>JlKX ;ob = v
ob prc; (X; l:=access(Q; e); s; )i
| C{onzf</p>
        <p>Anser (TCT [ Tuser; AConf); Q JeKX ;ob</p>
        <p>CT
!
}</p>
        <p>= (ob0; Y)
ob; ob0 prc; (X; s; [v 7! Y])i
by setting f to v. Rule (acc-av) similarly assigns a list constructed by Ans from
the CQ answers to a local variable (analogous rules (e-af) and (acc-af) assigning to
a eld|that is, when the expression is evaluated to a identi er- eld pair|are
omitted). Each rule applies only if the evaluation of its e or Ans is de ned.</p>
        <p>
          A runtime con guration for which no rule is applicable is terminated. A
terminated runtime con guration with the empty stack is successfully terminated,
otherwise it is stuck. Thus, a program may get stuck in case of type mismatches
in assignments and expression evaluations, null access, and similar errors. The
semantics of (untyped) SMOL of Kamburjan et al. [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] realises dynamic
checking |that is, getting stuck at runtime is the only way to catch such errors. This
approach, however, has well-known disadvantages. To overcome this in case of
typing, in Section 4 we develop static type checking for typed SMOL. Before this,
however, we complete the de nition of the semantics with description of the KB
corresponding to a con guration, which is used in access expressions.
The distinctive feature of SMOL is that programs can perform semantic access to
the knowledge base of a state enriched with an external TBox, as illustrated in
Fig. 1. We next present the semantic lifting mechanism to construct a TBox TCT
from a set CT of classes and an ABox AConf from a con guration Conf, as well as
discuss a user-de ned TBox Tuser. The complete description of the mechanism
for constructing TCT and AConf is long; moreover, our results do not depend on its
details, and its only property required in the results of Section 4 (and satis ed
by the mechanism described below) is its consistency |that is, that for every set
CT of classes and every con guration Conf, the KB (TCT; AConf) is consistent. Our
implementation of SMOL easily adapts to changes in this mechanism that
preserve consistency. So, we refrain from introducing the mechanism in full, instead
presenting only their descriptions as well as example axioms and assertions, and
referring to the technical report [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] and implementation for the full de nition.
        </p>
        <p>TBox TCT for classes CT consists of three parts:
(1) the axioms describing the language primitives|that is, the structure of
classes, elds, and methods, as well as relationships between them;
(2) the axioms describing the runtime primitives|that is, the structure of
objects, processes, and local variables, as well as relations between them;</p>
        <sec id="sec-3-2-1">
          <title>TBox TCT:</title>
          <p>(1) 9HasField :&gt; v Class
9HasMethod :&gt; v Class
(2) 9RunsOnObj :&gt; v Proc
9NextOnStack :&gt; v Proc
(3)
9HasField :&gt; v Field
9HasMethod :&gt; v Method
9RunsOnObj :&gt; v Object
9NextOnStack :&gt; v Proc
funct(NextOnStack )</p>
        </sec>
        <sec id="sec-3-2-2">
          <title>9av:&gt; v Proc for each variable v in classes of CT</title>
        </sec>
        <sec id="sec-3-2-3">
          <title>ClassC v ClassC0 for each class C extending class C0 in CT</title>
          <p>Class(aC); Var (av); HasField (aC; af); Field (af); HasMethod (aC; am); Method (am)
for each class C in CT, and each eld f, method m and variable v in C</p>
        </sec>
        <sec id="sec-3-2-4">
          <title>ABox AConf:</title>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>Object (aX); OfClass(aX; aC) for each object (C; )X in Conf</title>
        <sec id="sec-3-3-1">
          <title>Proc(api ); NextOnStack (api ; api+1 ) for each non-top process (X; rs; )i in Conf</title>
          <p>(3) the axioms describing the program itself|that is, the class hierarchy and
the internal structure of classes, including elds, methods, and their local
variables and statements, as well as relationships with the previous parts.
Examples of axioms in all three parts is given in Fig. 4 (concept and role names
are self-explanatory; some axioms are written as ABox assertions for readability,
and they can be written as TBox inclusions between nominals as usual). Observe
here, that only Part (3) depends on the program (and classes CT), while Parts (1)
and (2) describe the SMOL syntax and semantics. Note also that TCT does not
depend on a particular con guration; since CT does not change during execution,
so does not TCT, and hence we can use TCT for static type checking in Section 4.</p>
          <p>ABox AConf is constructed from a con guration Conf by mapping the objects
ob and the stack prc of processes in Conf to a set of assertions. Example assertions
of AConf are given in Fig. 4, where underlined individuals are evaluation-speci c.</p>
          <p>
            Finally, the user-de ned Tuser can be an arbitrary TBox such that TCT [ Tuser
is in SROIQ(D) (as a side comment, note that TCT presented above does not use
the full functionality of SROIQ(D) and falls inside a weaker logic DLLiteA);
besides this, Tuser should be static|that is, can mention concepts, roles, and
individuals of TCT, but does not change throughout execution and hence does not use
the evaluation-speci c individuals of AConf. Our results in Section 4 require Tuser
to be consistent with the lifting mechanism|that is, the KB (TCT [ Tuser; AConf)
to be consistent for every CT and Conf. This requirement is reasonable since it
ensures meaningful CQ answering: if the KB is inconsistent, then each constant
is a certain answer to each unary CQ. It can be guaranteed, for example, by
ensuring that Tuser is a conservative extension of every TCT [
            <xref ref-type="bibr" rid="ref24">24</xref>
            ].
4
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Safe Internal Semantic State Access</title>
      <p>
        As mentioned above, the original formulation of SMOL [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] relies on dynamic type
checking|that is, type errors, such as errors caused by expressions evaluating
(acc-type) 9y: ' ^ ST1 (%1) ^
^ STn (%n)
eTr ST0 (x)
` l : List&lt;T0&gt;
` ei : Ti
`eTr l:=access(9y: '; e1, : : : ,en) : Unit
to values of wrong types, are cought at runtime. In this section, we discuss static
type checking for SMOL, which is a technique to ensure, without running the
program, type safety |that is, that the program does not get stuck due to a type
mismatch and always successfully terminate [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]. For this, the following
properties should be shown for an appropriate notion of a well-typed 3 con guration [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ].
Local Progress: A well-typed con guration is either successfully terminated
or can make an execution step (i.e., has an applicable rule).
      </p>
      <p>Subject Reduction: If a well-typed con guration makes an execution step,
then the resulting con guration is also well-typed.</p>
      <p>Additionally, one needs to ensure that the initial con guration is well-typed.</p>
      <p>We use well-typedness based on the following property of adherence.
De nition 4. The typing function of a program Prog is the function mapping
every location (i.e., a eld, variable, or parameter) of Prog to the type of its
declaration in Prog. A con guration is well-typed if it adheres to |that is, if
the value of each location l is a DE of type (l).</p>
      <p>
        The goal of static type checking is to verify Local Progress and Subject
Reduction without running the program|that is, without applying the transition
system of De nition 3. Instead, much simpler type judgement rules are applied
to each of the program statements independently (which is sometimes called
`on the surface syntax'), and their applicability to each statement ensures type
safety of the program in the runtime. In the following De nition 5, we give type
judgement for access statements based on a standard data and knowledge base
property, namely query containment with respect to a TBox. We refrain form
giving these rules for all other cases, since they are standard [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] (essentially, by
doing this we assume that the program is type-safe when all l:=access(: : :) are
replaced by l:=null and that all such l are of List&lt;T&gt; type, for some T).
De nition 5. A CQ Q1 is contained in a CQ Q2 over a TBox T under an
entailment regime er, written Q1 eTr Q2, if for every ABox A each answer to Q1
over (T ; A) under er is also an answer to Q2 over (T ; A) under er. The type
judgement rule ( acc-type) for access statements is given in the top of Fig. 5, where
` e : T denotes that expression e has type T under typing function , and where
ST for a type T is T if T is a datatype, or ClassT if T is a class or list.
      </p>
      <p>
        So, as usual for static type checking using type judgement [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] an application
of Rule (acc-type) results in a labelling of an access statement with type Unit. The
      </p>
      <sec id="sec-4-1">
        <title>3 For convenience, we use a slightly non-standard notion of 'well-typedness'.</title>
        <p>next straightforward theorem, which is the main result of this paper, shows
that such applicability guarantees Local Progress and Subject Reduction for
con gurations with access statements. Together with standard similar results
for other statements, this implies type safety of programs with all statements
labelled by appropriate type judgement rules.</p>
        <p>Theorem 1. Let CT be class de nitions of a program Prog, be the typing
function of Prog, and Tuser a TBox consistent with the lifting mechanism. Then,
for each reachable con guration conf of Prog that adheres to and has
statement l:=access(: : :) on top of the stack of processes such that `eTrCT[Tuser
l:=access(. . . ) : Unit is derived by Rule ( acc-type), there exists a con guration
conf0 of Prog that adheres to such that conf ! conf0 by Rule ( acc-av) in Fig. 3.</p>
        <p>For example, consider the following access statement with a CQ template:
List&lt;C&gt; l:=access("9%1: x = %1"), Obj);: Assuming that Obj is an object of
class C' and C is also a class, type judgement of Rule (acc-type) for this statement
boils down to checking containment 9%1: (x = %1) ^ ClassC'(%1) eTrCT[Tuser
ClassC(x), which holds if and only if C' is a subclass of C (assuming that regime
er takes atomic concept inclusions ClassC v ClassC0 in TCT into account).</p>
        <p>
          Theorem 1 provide a ne-grained, but only su cient condition for type safety
of access statements, while necessity cannot be guaranteed since not all ABoxes
correspond to con gurations. Moreover, its applicability is limited in practice
since, as far as we are aware, there are no algorithms and tools for checking CQ
containment over SROIQ(D) under non-trivial entailment regimes. To
overcome this, we next present a stronger su cient condition, which is based on
concept subsumption rather than query containment under entailment regimes.
This approach is advantageous since concept subsumption is a main reasoning
task for DLs, and there are practical systems (e.g., HermiT [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ]) implementing
e cient subsumption for OWL 2 DL (i.e., SROIQ(D)) and its fragments.
        </p>
        <p>The following straightforward theorem uses of an adaptation of concept
subsumption to unary CQs: a unary CQ Q is subsumed by a concept C with respect
to a KB (or a TBox) K, written Q vK C, if sI 2 CI for each certain answer s
to Q over K and each model I of K. For brevity, the theorem is stated only for
assigned locations of class (or list) types; the case of datatypes is analogous.
Theorem 2. Theorem 1 holds if Rule ( acc-type) is replaced by Rule ( acc-approx-type),
which is the same as Rule ( acc-type) except that the containment in the premise
is replaced by existence of a concept C and two subsumptions Q0 vT C and
C vT ClassT0 , where Q0 = 9y: ' ^ ST1 (%1) ^ ^ STn (%n) .</p>
        <p>To apply this theorem and Rule (acc-approx-type) in practice, we can
syntactically construct a concept C from the query Q0 using some technique that
guarantees the rst subsumption to hold, and then check the second subsumption
by a DL reasoner. A more speci c (with respect to vT ) concept C ensures more
ne-grained su cient condition for type-safeness. However, unless Q0 is
equivalent (with respect to vT ) to a concept, there is no most speci c such C. Thus,
there may be many techniques for constructing C from the query.</p>
        <p>
          A reasonable choice is to take a repetition-free unravelling of Q0; for
datatypefree queries, it is the concept equivalent, with respect to v;, to a maximal
constant-free query Q00 that is tree-shaped and has a homomorphism to Q0 that
does not identify atoms (cf. the rolling up of Horrocks and Tessaris [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ]). Here,
a query is tree-shaped if the multigraph with its variables as nodes and an edge
fx; yg for each atom R(x; y) is a tree. For example, for a `triangle' query Q0 =
9y; z: R(x; y) ^ P (y; z) ^ S(z; x), which is not equivalent to any SROIQ(D)
concept, a possible unravelling is 9R:9P u9S , with justifying Q00 = 9y; z; x0: R(x; y)^
P (y; z) ^ S(z; x0). Such unravelling is not unique (e.g., 9R u 9S :9P is another
possibility), but it always exists, and we can take any candidate to construct
C. In fact, if Q0 is constant-free and tree-shaped, which is common in practice,
then such unravelling is always unique and equivalent to Q0 (for any TBox). This
technique directly generalises to queries with datatypes.
5
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Implementation</title>
      <p>
        Our SMOL implementation is available at github.com/Edkamb/SemanticObjects;
it provides an ability to generate full TBox TCT and ABox AConf, as well as to
link arbitrary Tuser. The language itself is implemented as an interpreter, using
ANTLR [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ] for the frontend and Kotlin for the backend. The implementation
relies on OWL 2 DL and SPARQL as counter-parts of SROIQ(D) and CQs,
and Jena [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ] for SPARQL querying OWL 2 DL ontologies. Subsumption-based
static type checking for access is realised using HermiT [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] plug-in for Jena.
Currently, it is implemented only for tree-shaped CQs|that is, CQs translatable
to concepts. If the user prefers to ignore the static type checker (e.g., if a CQ is
not tree-shaped or a failure is believed to be due to over-approximation), it is
possible to ignore the warning and rely on the dynamic type checker.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>We have developed a method to ensure static type safety in semantically lifted
programs. We have shown that the use of queries as an interface between the
imperative and declarative parts of SMOL programs allows us to reduce type
safety to query containment with respect to ontologies, which can in turn be
approximated by concept subsumption. Due to lack of tools for such containment,
our implementation of SMOL realises type checking using the approximating
approach. We anticipate, however, that this new application of containment will
initiate further theoretical and practice-oriented research in this direction. We
emphasise that, for our application, we only need a special case of containment,
where the containing query is always an instance query. For future work, we plan
to design such containment algorithms, as well as to investigate how program
accessibility modi ers (e.g., private) interact with semantic lifting.
Acknowledgements. This work was supported by the Research Council of
Norway via the PeTWIN project (Grant Nr. 294600).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Eduard</given-names>
            <surname>Kamburjan</surname>
          </string-name>
          , Vidar Norstein Klungre, Rudolf Schlatte, Einar Broch Johnsen, and
          <string-name>
            <given-names>Martin</given-names>
            <surname>Giese</surname>
          </string-name>
          .
          <article-title>Programming and debugging with semantically lifted states</article-title>
          .
          <source>In ESWC</source>
          , pages
          <volume>126</volume>
          {
          <fpage>142</fpage>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Boris</given-names>
            <surname>Motik</surname>
          </string-name>
          ,
          <string-name>
            <surname>Peter F. Patel-Schneider</surname>
          </string-name>
          ,
          <article-title>and Bijan Parsia. OWL 2 Web Ontology Language Structural Speci cation and Functional-style Syntax</article-title>
          .
          <source>W3C Recommendation</source>
          ,
          <year>2012</year>
          . Available at http://www.w3.org/TR/owl2-syntax/.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Eric</given-names>
            <surname>Prud</surname>
          </string-name>
          <article-title>'hommeaux and Andy Seaborne. SPARQL query language for RDF</article-title>
          .
          <source>W3C Recommendation</source>
          ,
          <year>2008</year>
          . Available at http://www.w3.org/TR/ rdf-sparql-query/.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. W3C SPARQL Working Group.
          <source>SPARQL 1</source>
          .
          <article-title>1 Query language</article-title>
          .
          <source>W3C Recommendation</source>
          ,
          <year>2013</year>
          . Available at http://www.w3.org/TR/sparql11-query/.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Birte</given-names>
            <surname>Glimm</surname>
          </string-name>
          and
          <article-title>Markus Krotzsch. SPARQL beyond subgraph matching</article-title>
          .
          <source>In ISWC</source>
          , pages
          <volume>241</volume>
          {
          <fpage>256</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Birte</given-names>
            <surname>Glimm</surname>
          </string-name>
          and
          <string-name>
            <given-names>Chimezie</given-names>
            <surname>Ogbuji</surname>
          </string-name>
          .
          <source>SPARQL 1</source>
          .
          <article-title>1 Entailment Regimes</article-title>
          .
          <source>W3C Recommendation</source>
          ,
          <year>2013</year>
          . Available at http://www.w3.org/TR/sparql11-entailment/.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Egor</surname>
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Kostylev</surname>
          </string-name>
          and Bernardo Cuenca Grau.
          <article-title>On the semantics of SPARQL queries with optional matching under entailment regimes</article-title>
          .
          <source>In ISWC</source>
          , pages
          <volume>374</volume>
          {
          <fpage>389</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Boris</given-names>
            <surname>Motik</surname>
          </string-name>
          , Bernardo Cuenca Grau, Ian Horrocks, Zhe Wu,
          <source>Achille Fokoue, and Carsten Lutz. OWL 2 Web Ontology Language: Pro les</source>
          ,
          <year>2009</year>
          . Available at http: //www.w3.org/TR/owl2-profiles/.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          , Oliver Kutz, and
          <string-name>
            <given-names>Ulrike</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>The even more irresistible SROIQ</article-title>
          .
          <source>In KR</source>
          , pages
          <volume>57</volume>
          {
          <fpage>67</fpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          and
          <string-name>
            <given-names>Ulrike</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>Ontology reasoning in the SHOQ(D) description logic</article-title>
          .
          <source>In IJCAI</source>
          , pages
          <volume>199</volume>
          {
          <fpage>204</fpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Franz</surname>
            <given-names>Baader</given-names>
          </string-name>
          , Ian Horrocks, Carsten Lutz, and
          <string-name>
            <given-names>Ulrike</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>An Introduction to Description Logic</article-title>
          . Cambridge University Press,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12. Melisachew Wudage Chekol, Jero^me Euzenat,
          <article-title>Pierre Geneves, and Nabil Layada. SPARQL query containment under schema</article-title>
          .
          <source>J. Data Semant.</source>
          ,
          <volume>7</volume>
          (
          <issue>3</issue>
          ):
          <volume>133</volume>
          {
          <fpage>154</fpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Martin</surname>
            <given-names>Leinberger</given-names>
          </string-name>
          , Philipp Seifer, Claudia Schon, Ralf Lammel, and
          <article-title>Ste en Staab. Type checking program code using SHACL</article-title>
          .
          <source>In ISWC</source>
          , pages
          <volume>399</volume>
          {
          <fpage>417</fpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>Holger</given-names>
            <surname>Knublauch</surname>
          </string-name>
          and
          <string-name>
            <given-names>Dimitris</given-names>
            <surname>Kontokostas</surname>
          </string-name>
          .
          <article-title>Shapes constraint language (SHACL)</article-title>
          .
          <source>W3C recommendation, W3C</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <article-title>Benjamin Zarrie and Jens Cla en</article-title>
          .
          <article-title>Veri cation of knowledge-based programs over description logic actions</article-title>
          .
          <source>In IJCAI</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          .
          <article-title>Actions and programs over description logic knowledge bases: A functional approach</article-title>
          . In Knowing, Reasoning, and Acting: Essays in Honour of Hector J.
          <string-name>
            <surname>Levesque</surname>
          </string-name>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Martin</surname>
            <given-names>Leinberger</given-names>
          </string-name>
          , Stefan Scheglmann, Ralf Lammel, Ste en Staab, Matthias Thimm, and
          <string-name>
            <given-names>Evelyne</given-names>
            <surname>Viegas</surname>
          </string-name>
          .
          <article-title>Semantic web application development with LITEQ</article-title>
          .
          <source>In ISWC</source>
          , pages
          <volume>212</volume>
          {
          <fpage>227</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>Alexander</given-names>
            <surname>Paar</surname>
          </string-name>
          and
          <string-name>
            <given-names>Denny</given-names>
            <surname>Vrandecic</surname>
          </string-name>
          . Zhi#
          <article-title>- OWL aware compilation</article-title>
          .
          <source>In ESWC</source>
          , pages
          <volume>315</volume>
          {
          <fpage>329</fpage>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Jesus Manuel</surname>
          </string-name>
          Almendros-Jimenez and Antonio Becerra-Teron.
          <article-title>Discovery and diagnosis of wrong SPARQL queries with ontology and constraint reasoning</article-title>
          .
          <source>Expert Syst. Appl.</source>
          ,
          <volume>165</volume>
          :
          <fpage>113772</fpage>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <given-names>Glynn</given-names>
            <surname>Winskel</surname>
          </string-name>
          .
          <source>The Formal Semantics of Programming Languages: An Introduction</source>
          . MIT Press, Cambridge, MA, USA,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21. Hanne Riis Nielson and
          <string-name>
            <given-names>Flemming</given-names>
            <surname>Nielson</surname>
          </string-name>
          .
          <article-title>Semantics with Applications: An Appetizer (Undergraduate Topics in Computer Science</article-title>
          ). Springer-Verlag, Berlin, Heidelberg,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <given-names>Gordon</given-names>
            <surname>Plotkin</surname>
          </string-name>
          .
          <article-title>A structural approach to operational semantics</article-title>
          .
          <source>J. Log. Algebr. Program.</source>
          ,
          <fpage>60</fpage>
          -
          <lpage>61</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Eduard</surname>
            <given-names>Kamburjan</given-names>
          </string-name>
          , Vidar Norstein Klungre, Rudolf Schlatte, Einar Broch Johnsen, and
          <string-name>
            <given-names>Martin</given-names>
            <surname>Giese</surname>
          </string-name>
          .
          <article-title>Programming and debugging with semantically lifted states (full paper)</article-title>
          .
          <source>Technical Report 499</source>
          , University of Oslo,
          <year>2021</year>
          . available at https://ebjohnsen.org/publication/rr499.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Carsten</surname>
            <given-names>Lutz</given-names>
          </string-name>
          , Dirk Walther, and
          <string-name>
            <given-names>Frank</given-names>
            <surname>Wolter</surname>
          </string-name>
          .
          <article-title>Conservative extensions in expressive description logics</article-title>
          .
          <source>In IJCAI</source>
          , pages
          <volume>453</volume>
          {
          <fpage>458</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Benjamin</surname>
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Pierce</surname>
          </string-name>
          .
          <article-title>Types and Programming Languages</article-title>
          . MIT Press,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Birte</surname>
            <given-names>Glimm</given-names>
          </string-name>
          , Ian Horrocks, Boris Motik, Giorgos Stoilos, and
          <string-name>
            <given-names>Zhe</given-names>
            <surname>Wang</surname>
          </string-name>
          .
          <article-title>Hermit: An OWL 2 reasoner</article-title>
          . J.
          <string-name>
            <surname>Autom</surname>
          </string-name>
          . Reason.,
          <volume>53</volume>
          (
          <issue>3</issue>
          ):
          <volume>245</volume>
          {
          <fpage>269</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          and
          <string-name>
            <given-names>Sergio</given-names>
            <surname>Tessaris</surname>
          </string-name>
          .
          <article-title>A conjunctive query language for description logic aboxes</article-title>
          .
          <source>In Proceedings of the Seventeenth National Conference on Arti cial Intelligence and Twelfth Conference on on Innovative Applications of Arti cial Intelligence, July 30 - August 3</source>
          ,
          <year>2000</year>
          , Austin, Texas, USA, pages
          <volume>399</volume>
          {
          <fpage>404</fpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <given-names>Terence</given-names>
            <surname>Parr</surname>
          </string-name>
          .
          <source>The De nitive ANTLR 4 Reference. Pragmatic Bookshelf</source>
          ,
          <volume>2</volume>
          <fpage>edition</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>29. http://jena.apache.org.</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>