<!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>Rule-based Reasoning in Semantic Text Analysis1,2</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ivan Rygaev</string-name>
          <email>irygaev@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Laboratory of Computational Linguistics, A. A. Kharkevich Institute for Information Transmission Problems, Russian Academy of Sciences</institution>
          ,
          <addr-line>Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper we demonstrate the rule engine of the SemETAP semantic text analyzer being developed in the Laboratory of Computational Linguistics of the Institute for Information Transmission Problems of the Russian Academy of Sciences. The rule engine is based on SPARQL queries and implements the forward chaining algorithm for existential rules. In a case study we show the system's capabilities and limitations, identify topics for further research and provide requirements for a reasoner that would satisfy our needs.</p>
      </abstract>
      <kwd-group>
        <kwd>Semantic text analysis</kwd>
        <kwd>Semantic concept definitions</kwd>
        <kwd>Inference</kwd>
        <kwd>Existential</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1 This paper presents the results of a joint effort of the team of the Laboratory of Computational Linguistics of the Institute
for Information Transmission Problems of the Russian Academy of Sciences. The team includes I. Boguslavsky, L. Iomdin,
A. Lazursky, S. Timoshenko, T. Frolova, V. Dikonov, E. Inshakova, V. Sizov and others. I would like to thank my colleagues
for their wonderful collaboration.
2 This work was supported by the RSF grant 16-18-10422, which is gratefully acknowledged.</p>
      <p>SemETAP is aiming at formalizing this knowledge using semantic concept definitions. The
semantic analyzer transforms the original text into a semantic graph consisting of semantic concepts
from the ontology and relations between them. Then semantic concept definition rules are applied to
extend the semantic graph with the implicit information. After that the semantic structure is ready to
answer deep questions.</p>
      <p>
        The goal of this paper is threefold: 1) show the current capabilities of the SemETAP inference
engine; 2) identify topics for further research and 3) provide requirements for a reasoner that would
satisfy our needs. For the reader’s convenience we will take the simple example (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) as the input
sentence for the case study and will show how the rule application process will lead us to the answers
of the questions in (
        <xref ref-type="bibr" rid="ref2">2</xref>
        )3.
      </p>
      <p>The paper is structured as follows: Section 2 presents the basic semantic structure which
SemETAP generates from the input sentence; Section 3 discusses the syntax of inference rules;
Section 4 emphasizes the need for anonymous individuals in the rules; Section 5 provides
implementation details of the inference engine; Section 6 discusses the representation of temporal
relations, Section 7 shows the successive rule application process, Section 8 discusses issues related to
facticity and proposition (un)certainty status, Section 9 identifies the need for disjunction, negation
and universal quantification, Section 10 highlights the importance of anonymous individuals in the
query results, Section 11 discusses the optimization issues, Section 12 summarizes our requirements
for an ideal reasoner, and Section 13 concludes the paper.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Basic Semantic Structure</title>
      <p>
        The semantic analyzer transforms the original text into a semantic structure consisting of a set
of binary predicates (or RDF triples). Such a semantic structure can be represented as a semantic graph.
A (simplified) graph and a set of triples corresponding to (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) are shown below4:
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
hasGivenName (Human_1, "John")
hasAgent (Selling_1, Human_1)
hasAgent2 (Selling_1, Human_2)
hasObject (Selling_1, Umbrella_1)
hasGivenName (Human_2, "Peter")
before (Selling_1, SpeechTimeInterval)
3 Other examples of concept definitions can be found in [4].
4 Many names of the semantic concepts used (Human, Selling, Buying etc) are taken from SUMO ontology [18].
      </p>
      <p>There are two types of nodes in the graph – concept nodes and literal nodes. A concept node
represents an individual of a certain class (= semantic concept) from the ontology while a literal node
contains just a string or numeric value.</p>
      <p>A class of an individual is encoded in its name to make the semantic structure more readable.
Human_1 is of class Human by default. The class can also be stated explicitly when necessary as
Human(Human_1) or isA(Human_1, Human).</p>
      <p>In this example we have Selling_1 object of the class Selling which represents the sale
event. Human_1 of the class Human represents the seller which is indicated with hasAgent relation.
The buyer is marked with hasAgent2 relation and the product with hasObject. The last triple
indicates that the event happened before the speech time interval i.e. in the past.</p>
    </sec>
    <sec id="sec-3">
      <title>3 Semantic Concept Definition Rule Syntax</title>
      <p>
        Once the basic semantic structure is built, it is time to apply inference rules to extend it. Most
of the inference rules are concept definition rules, which decompose one concept into a connected set
of other concepts. In our example we can apply the definition of Selling, which is shown below:
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
      </p>
      <p>Rule Selling:</p>
      <p>Selling(?selling)
Interdefinition:
hasAgent(?selling, ?seller) &amp; Agent(?seller) &amp;
hasAgent2(?selling, ?buyer) &amp; Agent(?buyer) &amp;
hasObject(?selling, ?thing) &amp;
hasPrice(?selling, ?money) &amp; CurrencyMeasure(?money) &amp;
sameTime(?buying, ?selling)
Definition:</p>
      <p>Buying(?buying) &amp;
hasAgent(?buying, ?buyer) &amp;
hasAgent2(?buying, ?seller) &amp;
hasObject(?buying, ?thing) &amp;
hasPrice(?buying, ?money).</p>
      <p>This rule says that Selling is Buying with swapped arguments.</p>
      <p>A rule consists of several sections. This rule has Body (the first section which follows the rule
name), Interdefinition and Definition sections. In addition to these, a rule may also
contain an Implication section. Each section consists of a conjunction of unary (classes) and
binary (relations) predicates. Logical negation and disjunction are temporarily not supported, although
we have plans to introduce them into the rule syntax. Variables (unlike constant individuals) are
marked with a question mark.</p>
      <p>
        The complicated rule structure follows from the wish to have everything related to a semantic
concept in one place (as a ‘dictionary entry’ for that concept). In particular, a concept definition works
both as a direct and an inverse implication. The logic of the rule sections application is the following:
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
      </p>
      <p>Body -&gt; Interdefinition &amp; Definition &amp; Implication
Definition -&gt; Body &amp; Interdefinition</p>
      <p>Explicit quantifiers are not supported. All variables in the antecedent are treated as implicitly
universally quantified. All new variables in the consequent (not present in the antecedent) are assumed
to be existentially quantified. However, there is a demand for explicit universal quantifiers in the
consequent which we plan to address in the future (see details in Section 9).</p>
      <p>
        Body usually contains the concept being defined, Definition – its necessary and sufficient
conditions which can be applied both ways, Implication – its one-way entailments. A special
section is Interdefinition which is logically a part of the definition but nevertheless must be in
the consequent of the inverse implication. For example, if we combine Interdefinition and
Definition into one section in (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ), then the inverse implication will work only if there
is ?selling variable in the first place which does not make much sense. We want the inverse
implication to be able to create the whole Selling object, not just assign Selling class to the
object which is already there.
      </p>
    </sec>
    <sec id="sec-4">
      <title>4 Anonymous Individuals</title>
      <p>Our rules allow new variables in the consequent which are not present in the antecedent. Since
a concept definition is a detailed elaboration of the concept it must almost necessarily contain new
variables to represent various parts of the concept definition. Such variables are known as existentials
[9] or anonymous individuals.</p>
      <p>
        For example, we cannot define a concept without mentioning its arguments. Every sale
involves a seller, a buyer, a product, and some amount of money. If any of these is missing then the
situation cannot be called ‘selling’. Nevertheless not all of these four arguments are necessarily
present in a sentence. In (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) there is no mention of money. In The car is sold three of the four
arguments are missing. They may be missing in a sentence but they are still there in the situation the
sentence describes. So, on the semantic level we have to restore all the missing arguments.
      </p>
      <p>
        The first four lines of the Interdefinition of Selling in (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) serves for that purpose. It
makes sure that all four arguments of sale are there in the semantic structure and assign some classes
to them (Agent and CurrencyMeasure) if those classes are missing for some reason.
      </p>
      <p>In the process of rule application we cannot just create new anonymous individuals for all new
variables in the consequent. First we need to check if some of them are already there in the original
semantic structure. The logic of checking for their existence can be complicated in the general case,
but for semantic arguments it is simple. All semantic arguments are marked as a functional property in
the ontology. So, if the argument property already has some value in the original structure then it just
gets assigned to the existential variable and no new individual is created. In reality one sale event can
include, say, multiple products, but this will be modelled using a separate group individual which will
have a single hasObject relation to a sale event.</p>
      <p>
        The application of the arguments in the Selling definition will introduce
CurrencyMeasure_1 individual to our semantic structure connected by hasPrice to the original
Selling_1 object (existing objects and relations are marked with dashed lines in the graph):
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
hasPrice (Selling_1, CurrencyMeasure_1)
      </p>
      <p>
        Now let’s apply the rest of the rule (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ). This part will generate a Buying object which has the
same arguments, but Human_1 and Human_2 will swap their roles from Agent to Agent2 and vice
versa (Selling part of the graph is not shown for simplicity):
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
hasAgent (Buying_1, Human_2)
hasAgent2 (Buying_1, Human_1)
hasObject (Buying_1, Umbrella_1)
hasPrice (Buying_1, CurrencyMeasure_1)
sameTime (Buying_1, Selling_1)
      </p>
      <p>
        But what will happen if we try to apply this rule once again? Will it create another Buying
object? No. But how does it check for existence? After all Buying_1 is not connected to any of the
existing variables by a functional property. In this case we have a simple rule:
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        )
      </p>
      <p>Do not add exactly the same subgraph that already exists.</p>
      <p>By a ‘subgraph’ here we mean the largest possible subgraph ending on the existing individuals
and including all of the anonymous individuals one of its nodes is connected to. This is not a logically
perfect rule and not a technically efficient one. In some cases it can create duplicates. For example, if
we had another Buying object in our original structure with the same arguments but missing
hasPrice, it would not be matched and a new Buying object would be created instead.</p>
      <p>So this is an open task to develop a logically consistent and efficient algorithm to match for
the existing individuals before adding anonymous ones. One of the ideas to be explored is to look for
noncontradicting individuals rather than exactly the same ones. For example, if we found a Buying
object but it has a different buyer or seller then it is not a match. And if we found a Buying object
that has some arguments matching and others missing then it is a potential match. Exact rules of
noncontradiction still have to be developed. The task seems to be similar to the anaphora and
coreference resolution issue which is also dealt with in our lab.</p>
    </sec>
    <sec id="sec-5">
      <title>5 Implementation</title>
      <p>The inference engine uses RDF storage to store the semantic structure and SPARQL language
to apply rules and run queries.</p>
      <p>Each rule gets compiled into a number of SPARQL insert statements. Each statement:
1. Searches for the rule antecedent pattern in the semantic structure.
2. Checks if the part of the consequent for which it is responsible is not present yet in the
semantic structure.
3. (If 1 and 2 are satisfied) adds the part of the consequent for which it is responsible to the
semantic structure, creating new individuals and/or RDF triples.</p>
      <p>Thus, the inference engine uses the forward chaining method of reasoning.</p>
      <p>The order of rules application is not determined. Rules are applied in several iterations, each
of which runs all suitable rules. The application process stops when either the last iteration has not
produced any new data or ten iterations have been completed. The latter condition is needed to avoid
potential infinite recursion in the rule application process.</p>
      <p>The question is processed in the following way:
1. A (basic) semantic structure of the question is built. The semantic structure of the question
is similar to the semantic structure of the corresponding affirmative sentence but
individuals corresponding to wh-words are marked in a special way.
2. This semantic structure is used as a pattern for a SPARQL select query which is run
against the RDF storage returning individuals corresponding to wh-words in the question.
3. The results returned by the query are either displayed to the user in a table format or
converted into a natural language sentence depending on the mode. In the latter case the
text of the question is used as a pattern to generate the sentence of the answer.</p>
      <p>Using RDF storage and SPARQL has its pros and cons. SPARQL is a powerful language
which provides built-in capabilities for searching for a subgraph within the semantic structure. But its
strength is also its weakness because we have almost no control over the search algorithm and very
few possibilities to optimize its performance.</p>
      <p>So we are contemplating the possibility of using one of the existing reasoners which would
cover our needs, e.g. Graal [2], or, alternatively, rewriting our inference engine with the full control
over the algorithms without using SPARQL.</p>
    </sec>
    <sec id="sec-6">
      <title>6 Temporal Relations</title>
      <p>
        At this point based on (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) we are almost able to answer the question (2a): “Who bought the
umbrella?” The only thing we are missing is the indication that Buying_1 happened in the past.
      </p>
      <p>To represent event timeframes we adopted a slightly modified version of Allen’s temporal
interval logic [1]. We use six Allen’s base temporal relations, some additional relations (including
sameTime for equality) and a number of transitivity rules which form the composition table.</p>
      <p>
        The transitivity rule which we need in our case is as follows:
(
        <xref ref-type="bibr" rid="ref9">9</xref>
        )
      </p>
      <p>Rule TimeSameTimeBefore:
sameTime(?a, ?b) &amp;
before(?b, ?c)
Implication:</p>
      <p>before(?a, ?c).</p>
      <p>
        Having sameTime(Buying_1, Selling_1) from (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) and before(Selling_1,
SpeechTimeInterval) from (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) and (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ) we can conclude:
(
        <xref ref-type="bibr" rid="ref10">10</xref>
        ) before (Buying_1, SpeechTimeInterval)
      </p>
      <p>
        Now structures (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) and (
        <xref ref-type="bibr" rid="ref10">10</xref>
        ) provide us with all the information we need to answer the
question (2a).
      </p>
    </sec>
    <sec id="sec-7">
      <title>7 Going Deeper</title>
      <p>
        Now we can apply the definition of Buying:
(
        <xref ref-type="bibr" rid="ref11">11</xref>
        ) Rule Buying:
      </p>
      <p>Buying(?buying)
Interdefinition:
hasAgent(?buying, ?buyer) &amp; Agent(?buyer) &amp;
hasAgent2(?buying, ?seller) &amp; Agent(?seller) &amp;
hasObject(?buying, ?thing) &amp;
hasPrice(?buying, ?money) &amp;
sameTime(?exchange, ?buying)
Definition:</p>
      <p>Exchange(?exchange) &amp;
hasAgent(?exchange, ?buyer) &amp;
hasObject(?exchange, ?money) &amp; CurrencyMeasure(?money) &amp;
hasAgent2(?exchange, ?seller) &amp;
hasObject2(?exchange, ?thing).</p>
      <p>
        This rule says that Buying is an Exchange for money. It is structured in a way similar to
the Selling rule, and it will add the following data to our structure:
(
        <xref ref-type="bibr" rid="ref12">12</xref>
        ) hasAgent (Exchange_1, Human_2)
hasObject (Exchange_1, CurrencyMeasure_1)
hasAgent2 (Exchange_1, Human_1)
hasObject2 (Exchange_1, Umbrella_1)
sameTime (Exchange_1, Buying_1)
      </p>
      <p>
        Appling the temporal transitivity rule (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) again, we can conclude:
(
        <xref ref-type="bibr" rid="ref13">13</xref>
        ) before (Exchange_1, SpeechTimeInterval)
      </p>
      <p>
        This does not provide us with new information needed to answer questions (2b) – (2d), so we
proceed to the definition of Exchange:
(
        <xref ref-type="bibr" rid="ref14">14</xref>
        ) Rule Exchange:
      </p>
      <p>Exchange(?exchange1)
Interdefinition:</p>
      <p>This rule defines Exchange as two mutual Givings. It also contains an Implication
section which introduces a symmetric Exchange event proposition. If John exchanged with Peter
then it is also true that Peter exchanged with John.</p>
      <p>
        This rule will add two Giving objects and one Exchange object to our semantic structure
as shown below:
(
        <xref ref-type="bibr" rid="ref15">15</xref>
        ) hasAgent (Giving_1, Human_2)
hasObject (Giving_1, CurrencyMeasure_1)
hasRecipient (Giving_1, Human_1)
during (Giving_1, Exchange_1)
(
        <xref ref-type="bibr" rid="ref16">16</xref>
        ) hasAgent (Giving_2, Human_1)
hasObject (Giving_2, Umbrella_1)
hasRecipient (Giving_2, Human_2)
during (Giving_2, Exchange_1)
(
        <xref ref-type="bibr" rid="ref17">17</xref>
        ) hasAgent (Exchange_2, Human_1)
hasObject (Exchange_2, Umbrella_1)
hasAgent2 (Exchange_2, Human_2)
hasObject2 (Exchange_2, CurrencyMeasure_1)
sameTime (Exchange_2, Exchange_1)
      </p>
      <p>Both Giving objects are connected to Exchange_1 by during temporal relation. That
means that they occurred within Exchange_1 timeframe. We can apply another transitivity rule for
them:
(18) Rule TimeDuringBefore:
during(?a, ?b) &amp;
before(?b, ?c)
Implication:</p>
      <p>before(?a, ?c).</p>
      <p>
        Resulting in:
(19) before (Giving_1, SpeechTimeInterval)
before (Giving_2, SpeechTimeInterval)
The subgraph in (
        <xref ref-type="bibr" rid="ref16">16</xref>
        ) plus (19) gives us the answer to (2b) “What did John give to Peter?”
      </p>
    </sec>
    <sec id="sec-8">
      <title>8 Facticity and Uncertainty</title>
      <p>Now we can apply the definition of Giving:
(20) Rule Giving:</p>
      <p>Giving(?giving)
Interdefinition:
hasAgent(?giving, ?agent) &amp; Agent(?agent) &amp;
hasRecipient(?giving, ?agent2) &amp; Agent(?agent2) &amp;
hasObject(?giving, ?object)
Implication:</p>
      <p>Own(?own1) &amp;
hasAgent(?own1, ?agent) &amp;
hasObject(?own1, ?object) &amp;
meetsTemporally(own1, ?giving) &amp;
Own(?own2) &amp;
hasAgent(?own2, ?agent2) &amp;
hasObject(?own2, ?object) &amp;
meetsTemporally(?giving, own2).</p>
      <p>This rule says that Giving results in changing the owner. The rule has an Implication
section and no Definition because not every change of the owner is Giving. The
Interdefinition section without Definition works in the same way as Implication, but
it is preserved here for visual split between the arguments and the other type of content. The
application of this rule will add four Own events (two for each Giving):
(21) meetsTemporally (Own_1, Giving_1)
hasAgent (Own_1, Human_2)
hasObject (Own_1, CurrencyMeasure_1)
meetsTemporally (Giving_1, Own_2)
hasAgent (Own_2, Human_1)
hasObject (Own_2, CurrencyMeasure_1)
(22) meetsTemporally (Own_3, Giving_2)
hasAgent (Own_3, Human_1)
hasObject (Own_3, Umbrella_1)
meetsTemporally (Giving_2, Own_4)
hasAgent (Own_4, Human_2)
hasObject (Own_4, Umbrella_1)</p>
      <p>The predicate meetsTemporally means that two events follow each other, one event starts
right after the other finishes. By applying another transitivity rule:
(23)</p>
      <p>Rule TimeBeforeMeets2:
before(?a, ?b) &amp;
meetsTemporally(?a, ?c)
Implication:</p>
      <p>startsBefore(?c, ?b).</p>
      <p>We can conclude that Own_2 and Own_4 events started in the past:
(24)
startsBefore (Own_2, SpeechTimeInterval)
startsBefore (Own_4, SpeechTimeInterval)</p>
      <p>Do we now have enough information to answer the question (2c) “Who owns the umbrella?”
Yes and no. Strictly speaking, this question does not have a definite answer. If Peter started owning
the umbrella sometime in the past he could since then sell it again or lose it somewhere or pass on to
somebody else, etc. We cannot be sure that he still owns it now. But without any additional
information we choose to think that he does. This is called implicature [12], or invited inference [10].
This pragmatic phenomenon is based on the expectation that if it were not so then the speaker would
tell that in an explicit way.</p>
      <p>There are also other types of uncertain inferences which we generalize under the term
(plausible) expectations. Expectation is a proposition that is likely to be true based on the information
we have so far. It is not strict entailment, so it can be confirmed or disproved by a subsequent
discourse.</p>
      <p>SemETAP is able to capture plausible expectations at the level of individuals. Event objects
can be assigned to special predicates Fact or Implicature to mark their certainty status. It is also
possible that some event objects get assigned neither of the two. Consider the example:
(25)</p>
      <p>Peter wants to buy an umbrella.</p>
      <p>The semantic structure of this sentence will contain predicate Fact(Want_1) (by the rule:
“Trust the speaker”), but will contain neither Fact(Buying_1) nor Implicature(Buying_1)
since the facticity status of buying is not asserted in the sentence.</p>
      <p>Can we use Implicature predicate to mark the expectation that Peter still owns the
umbrella? Unfortunately, no. We could assign Implicature to Own_4 but it would not be what we
need. Moreover, Own_4 must have already been assigned the Fact predicate inherited through the
rule application process. It is a fact (if we trust the speaker) that Peter started to own the umbrella
sometime in the past. What we need to assign Implicature to is not the whole Own_4 event, but
the proposition that this event persists till now. This proposition can be expressed with the following
predicate:
(26)
during (SpeechTimeInterval, Own_4)</p>
      <p>But our system does not support (yet) having a proposition or a predicate as an argument of
another predicate. This is a topic for further development: how to model such a possibility within RDF
model and process it consistently.</p>
    </sec>
    <sec id="sec-9">
      <title>9 Disjunction, Negation and Universal Quantifier</title>
      <p>Another type of uncertainty is a situation when the agent does not know a particular thing
exactly, but knows the (closed) set of alternatives to which this thing can belong. This knowledge can
be represented by a disjunction. An apple can be green, yellow or red. If we encounter an apple in the
text we cannot be sure about its color, but at least we can be sure that it is not blue. A soccer pass can
be performed with the player’s leg, head or chest, but not with the arm etc.</p>
      <p>This leads to the demand for the ability to include disjunctive information (possible
alternatives) in the semantic structure and to allow disjunction in the consequent of the implication
rules. This feature is not yet supported by our system mainly because of the difficulties concerning the
introduction of disjunction into the RDF model.</p>
      <p>Another issue is the representation of the negative knowledge. We are working in the open
world paradigm and cannot rely on the negation as failure. If some proposition is missing in the
semantic structure then its status cannot be assumed to be false by default. So, if we need to be able to
capture negative sentences such as the following:
(27)</p>
      <p>Peter did not buy an umbrella
we need an explicit way to represent negation. This is partially supported in our system
through the use of Negation predicate. Similar to Fact and Implicature it can be assigned
only to event individuals, not to propositions. It denotes the absence of the whole event. The example
(27) will be represented as follows:
(28)
hasGivenName (Human_1, "Peter")
hasObject (Negation_1, Buying_1)
hasAgent (Buying_1, Human_1)
hasObject (Buying_1, Umbrella_1)
before (Buying_1, SpeechTimeInterval)</p>
      <p>In this example the Fact predicate will be assigned to Negation_1, not to Buying_1 (the
absence of Peter’s purchase is the fact). Negation, as any other predicate, can be used in a
nonfactive context as well, as in the sentence: Peter promised not to buy an umbrella.</p>
      <p>Since the scope of the Negation predicate is fixed to the whole event, it cannot cover all the
situations when the negation is needed. Consider the following sentence:
(29)</p>
      <p>It was not Peter who bought the umbrella from John</p>
      <p>In this example the scope of negation is only the following predicate:
(30) hasAgent (Buying_1, Human_1)</p>
      <p>As we mentioned in the previous section we cannot have a predicate or a proposition as an
argument of another predicate. So, we cannot represent (29) correctly.</p>
      <p>Another problem with Negation is that anonymous individuals within the scope of negation
must be universally quantified, but our system support only default existential quantification. The
sentence (27) entails that Peter did not buy an umbrella from anybody. Existential quantification leads
to the wrong understanding that there is somebody from whom Peter did not buy an umbrella. It will
not produce definite answer to the question “Did Peter buy an umbrella from John?” since John and
the person from whom Peter did not buy an umbrella do not necessarily coincide.</p>
      <p>10 Anonymous Individuals in Answers</p>
      <p>We are left with the last question (2d) “What did John get?”. To answer it we need to apply
the definition of Getting:
(31) Rule Getting:</p>
      <p>Getting(?getting)
Interdefinition:
hasRecipient(?getting, ?agent) &amp; Agent(?agent) &amp;
hasSource(?getting, ?agent2) &amp; Agent(?agent2) &amp;
hasObject(?getting, ?object) &amp;
sameTime(?getting, ?giving)
Definition:</p>
      <p>Giving(?giving) &amp;
hasAgent(?giving, ?agent2) &amp;
hasRecipient(?giving, ?agent) &amp;
hasObject(?giving, ?object).</p>
      <p>
        This rule says that Getting is a Giving with slightly different roles of the arguments. By
applying the rule in the opposite direction followed by the transitivity rule (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) we will get:
(32) hasRecipient (Getting_1, Human_1)
hasObject (Getting_1, CurrencyMeasure_1)
hasSource (Getting_1, Human_2)
sameTime (Getting_1, Giving_1)
before (Getting_1, SpeechTimeInterval)
(33) hasRecipient (Getting_2, Human_2)
hasObject (Getting_2, Umbrella_1)
hasSource (Getting_2, Human_1)
sameTime (Getting_2, Giving_2)
before (Getting_2, SpeechTimeInterval)
      </p>
      <p>The subgraph in (32) is what we need to answer (2d). Note that the answer is
CurrencyMeasure_1 which is anonymous individual created by the inference rules. Nevertheless
it is a meaningful answer since we know its class. We do not know which particular amount of money
John got but we can be sure that it was money and not something else. This can be useful information
for subsequent inferences. This example shows that anonymous individuals are worth being returned
by queries but only with (some) predicates involving them (in this example their class).
11 Optimization Issues</p>
      <p>In this case study we used simplified semantic structure and simplified rules, without modality
and other implications that can be made from the concepts we examined. And we even did not touch
the definition of other concepts in our semantic structure such as Human, Umbrella and
CurrencyMeasure. Nevertheless we had to go five levels deep through the rule application process
to find the answers for questions which a human can answer within a second. And our semantic
structure has grown significantly.</p>
      <p>This shows that probably forward chaining is not the best algorithm from the performance
point of view especially if we aim at processing large texts with many different concepts involved.</p>
      <p>The alternative would be to use backward chaining and one of the query rewriting algorithms
[11, 13, 15-16]. Instead of modifying the data, such algorithms modify the query extending it with new
propositions so the query can be successfully run against the original data.</p>
      <p>We will explore this option, but limitations of this method are already visible. For example,
the backward chaining would not give us the answer for (2d) “What did John get?” because there is
no CurrencyMeasure object in the original semantic structure. Also, there could be other tasks
involving deep semantic analysis and not related to queries such, as semantics-based translation or
making an abstract of a text.</p>
      <p>It might be sensible to build a hybrid system using both forward and backward chaining [14,
17, 19]. Yet the main question will be where and how to stop forward chaining in order not to
overload the semantic structure with lots of unnecessary data. We do not have a definite answer to this
challenge yet. But it needs to be emphasized that we are not trying to build a data-mining system or
something similar. We are trying to build a system which would be comparable to humans in the
performance of reasoning and not necessarily would outperform them. So the answer may lie in the
pragmatically induced constraints (e.g. limiting the depth of the forward chaining) rather than in the
theoretical ones (such as limiting the expressive power of the rule language).</p>
      <p>12 Summary: Requirements for the Reasoner
An ideal reasoner for our needs has to support the following:
1. Anonymous individuals in the consequent of the rule with an efficient “find or create”
algorithm for them.
2. Anonymous individuals in the result of a query with all or selected propositions involving
those individuals.
3. Representation of uncertainty and the ability to apply it not only to individuals but to a
particular predicate or proposition.
4. Disjunction, negation and universal quantification in the consequent of the rules.
5. Selected and directed reasoning depending on the task.
13 Conclusion</p>
      <p>In a case study we have demonstrated the process of the concept definition rules application in
the SemETAP inference engine, its capabilities and limitations, discussed various issues associated
with the inference process, and specified the requirements for an ideal reasoner that would suit our
needs.</p>
      <p>A collection of semantic concept definition rules of a particular knowledge domain can
potentially be used to build benchmark tests for the task of conjunctive query answering under
existential rules.
18. Niles I. and Pease A. 2001. Towards a Standard Upper Ontology. In: Proceedings of the 2nd
International Conference on Formal Ontology in Information Systems (FOIS-2001), Chris
Welty and Barry Smith, eds, Ogunquit, Maine, October 17-19, 2001.
19. Zhou Y. et al. 2014. Pay-as-you-go OWL Query Answering Using a Triple Store / Y. Zhou, Y.</p>
      <p>Nenov, B. C. Grau and I. Horrocks. AAAI 2014.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Allen</surname>
            ,
            <given-names>J.F.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Ferguson</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <year>1994</year>
          .
          <article-title>Actions and Events in Interval Temporal Logic</article-title>
          ,
          <source>J. Logic and Computation</source>
          <volume>4</volume>
          ,
          <issue>5</issue>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baget J.-F</surname>
          </string-name>
          . et al.
          <article-title>Graal: A Toolkit for Query Answering with Existential Rules /</article-title>
          J.-
          <string-name>
            <given-names>F.</given-names>
            <surname>Baget</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Leclère</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.-L. Mugnier</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Rocher</surname>
            , and
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Sipieter</surname>
          </string-name>
          . In: RuleML 2015 Conference,
          <year>August 2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Boguslavsky</surname>
            <given-names>I.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Semantic Analysis Based on Linguistic and Ontological Resources</article-title>
          .
          <source>In: Proceedings of the 5th International Conference on the Meaning - Text Theory. Barcelona, September 8 - 9</source>
          ,
          <year>2011</year>
          . Igor Boguslavsky and Leo Wanner (Eds.), p.
          <fpage>25</fpage>
          -
          <lpage>36</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Boguslavsky</surname>
            <given-names>I.</given-names>
          </string-name>
          <year>2017</year>
          .
          <article-title>Semantic Descriptions for a Text Understanding System</article-title>
          .
          <source>In: Computational Linguistics and Intellectual Technologies. Papers from the Annual International Conference “Dialogue”</source>
          (
          <year>2017</year>
          ), p.
          <fpage>14</fpage>
          -
          <lpage>28</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Boguslavsky</surname>
            <given-names>I.</given-names>
          </string-name>
          et al.
          <year>2010</year>
          .
          <article-title>Interfacing the Lexicon and the Ontology in a Semantic Analyzer / I.</article-title>
          <string-name>
            <surname>Boguslavsky</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Iomdin</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Sizov</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Timoshenko</surname>
          </string-name>
          .
          <source>In: COLING 2010. Proceedings of the 6th Workshop on Ontologies and Lexical Resources (Ontolex</source>
          <year>2010</year>
          ), Beijing,
          <year>August 2010</year>
          , pages
          <fpage>67</fpage>
          -
          <lpage>76</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Boguslavsky</surname>
            <given-names>I.</given-names>
          </string-name>
          et al.
          <year>2013</year>
          .
          <article-title>Semantic representation for NL understanding / I.</article-title>
          <string-name>
            <surname>Boguslavsky</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Dikonov</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Iomdin</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Timoshenko</surname>
            . In: Computational Linguistics and
            <given-names>Intellectual</given-names>
          </string-name>
          <string-name>
            <surname>Technologies</surname>
          </string-name>
          .
          <source>Papers from the Annual International Conference “Dialogue”</source>
          (
          <year>2013</year>
          ), p.
          <fpage>132</fpage>
          -
          <lpage>144</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Boguslavsky</surname>
            <given-names>I.</given-names>
          </string-name>
          et al.
          <year>2015</year>
          .
          <article-title>Semantic Analysis and Question Answering: a System Under Development / I.</article-title>
          <string-name>
            <surname>Boguslavsky</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Dikonov</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Iomdin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Lazursky</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Sizov</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Timoshenko</surname>
            . In: Computational Linguistics and
            <given-names>Intellectual</given-names>
          </string-name>
          <string-name>
            <surname>Technologies</surname>
          </string-name>
          .
          <source>Papers from the Annual International Conference “Dialogue”</source>
          (
          <year>2015</year>
          ), p.
          <fpage>62</fpage>
          -
          <lpage>79</lpage>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Boguslavsky</surname>
            <given-names>I.</given-names>
          </string-name>
          et al.
          <year>2016</year>
          .
          <article-title>Plausible Expectations-Based Inference for Semantic Analysis / I.</article-title>
          <string-name>
            <surname>Boguslavsky</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Dikonov</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Frolova</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Iomdin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Lazurski</surname>
            , I. Rygaev,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Timoshenko</surname>
          </string-name>
          .
          <source>In: Proceedings of the 2016 International Conference on Artificial Intelligence (ICAI</source>
          "
          <year>2016</year>
          ). USA: CSREA Press,
          <year>2016</year>
          . pp.
          <fpage>477</fpage>
          -
          <lpage>483</lpage>
          . ISBN:
          <fpage>1</fpage>
          -
          <lpage>60132</lpage>
          -438-3.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Cali</surname>
            <given-names>A.</given-names>
          </string-name>
          et al.
          <year>2010</year>
          . Datalog+/
          <article-title>-: A Family of Logical Knowledge Representation and Query Languages for New Applications / A</article-title>
          . Cali, G. Gottlob, Th. Lukasiewicz,
          <string-name>
            <given-names>B.</given-names>
            <surname>Marnette</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          .
          <source>Keynote Lecture. 2010 25th Annual IEEE Symposium on Logic in Computer Science.</source>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Geis</surname>
            <given-names>M. L.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Zwicky</surname>
            <given-names>A. M.</given-names>
          </string-name>
          <year>1971</year>
          .
          <article-title>On Invited Inferences</article-title>
          .
          <source>Linguistics Inquiry</source>
          ,
          <volume>2</volume>
          .
          <year>1971</year>
          :
          <fpage>561</fpage>
          -
          <lpage>566</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Gottlob</surname>
            <given-names>G.</given-names>
          </string-name>
          et al.
          <year>2014</year>
          . Query Rewriting and Optimization for Ontological Databases / G. Gottlob ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Orsi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          .
          <source>In: ACM Transactions on Database Systems (TODS)</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Grice</surname>
            <given-names>H. P.</given-names>
          </string-name>
          <year>1975</year>
          .
          <article-title>Logic and Conversation</article-title>
          .
          <source>Syntax and Semantics</source>
          , Vol.
          <volume>3</volume>
          ,
          <string-name>
            <given-names>Speech</given-names>
            <surname>Acts</surname>
          </string-name>
          , ed. by Peter Cole and Jerry L. Morgan. New York: Academic Press 1975:
          <fpage>41</fpage>
          -
          <lpage>58</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Kikot S</surname>
          </string-name>
          . et al.
          <year>2012</year>
          .
          <article-title>Conjunctive Query Answering with OWL2QL / S</article-title>
          . Kikot ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          . KR-2012.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Kontchakov R</surname>
          </string-name>
          . et al.
          <year>2011</year>
          .
          <article-title>The Combined Approach to Ontology-Based Data Access /</article-title>
          R. Kontchakov,
          <string-name>
            <given-names>C.</given-names>
            <surname>Lutz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Toman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Wolter</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <source>In: Proceedings of IJCAI</source>
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>König</surname>
            <given-names>M.</given-names>
          </string-name>
          et al.
          <year>2012</year>
          .
          <article-title>A Sound and Complete Backward Chaining Algorithm for Existential Rules / M.</article-title>
          <string-name>
            <surname>König</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Leclère</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.-L. Mugnier</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Thomazo</surname>
          </string-name>
          .
          <source>Proc. of the 6th International Conference on Web Reasoning and Rule Systems (RR</source>
          <year>2012</year>
          ),
          <year>September 2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>König</surname>
            <given-names>M.</given-names>
          </string-name>
          et al.
          <year>2013</year>
          .
          <article-title>On the Exploration of the Query Rewriting Space with Existential Rules / M.</article-title>
          <string-name>
            <surname>König</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Leclère</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.-L. Mugnier</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Thomazo</surname>
          </string-name>
          .
          <source>Proc. of the 7th International Conference on Web Reasoning and Rule Systems (RR</source>
          <year>2013</year>
          ),
          <year>July 2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Lutz</surname>
            <given-names>C.</given-names>
          </string-name>
          et al.
          <year>2009</year>
          .
          <article-title>Conjunctive query answering in the description logic EL using a relational database system / C. Lutz</article-title>
          , Toman,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Wolter</surname>
          </string-name>
          , F. In
          <source>: Proc. of IJCAI</source>
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>