<!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>GeospatialRules: A Datalog + RuleML Rulebase for Geospatial Reasoning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gen Zou</string-name>
          <email>gen.zou@unb.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science, University of New Brunswick</institution>
          ,
          <addr-line>Fredericton</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Representing and reasoning with qualitative geospatial relationships among regions is an important task in many geospatial applications. In this paper, we present a Datalog + rulebase, GeospatialRules, which can be used for this task. The rulebase is built on top of the Region Connection Calculus (RCC). It includes rules, facts, and queries. The rules in GeospatialRules consist of a set of rules that are equivalent to the Datalog+ fragment of the RCC axioms and additional rules which express part of the RCC knowledge that are not captured by the Datalog + fragment. The XML version of the rulebase complies to the Deliberation RuleML 1.01 standard, so that it allows the use of RuleML-compatible implementations for geospatial reasoning.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Introduction</p>
      <p>
        Datalog+
Datalog+ is an extension of Datalog with existential quantiers, equality, and
falsity in rule conclusions. This extension addresses the modeling needs of many
applications, e.g. of knowledge-based data access [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. A family of decidable
sublanguages of Datalog +, Datalog , has been proposed for ontological querying [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
A reasoning engine, Nyaya [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], has been developed to answer queries in Datalog .
The new release of the Deliberation RuleML 1.01 1 standard introduces Relax
NG and XSD schemas for the Datalog + language, leaving Datalog restrictions
to a future release.
2.2
      </p>
      <p>
        Region Connection Calculus
The Region Connection Calculus (RCC) is an axiomization of spatial relations
between regions in rst-order logic [
        <xref ref-type="bibr" rid="ref1 ref2">1,2</xref>
        ]. The theory assumes one primitive binary
relation C(x; y), which represents x connects with y. The relation C is reexive
and symmetric, captured by the axioms
      </p>
      <p>On top of C, several binary spatial relations can be dened. The meanings and
rst-order denitions of these relations are shown in Table 1. All top-level free
variables are implicitly universally quantied. Among these relations, P,PP,TPP,
and NTPP are asymmetric and their inverses can be dened. The notation i
is used to represent the inverses for 2 fP; PP; TPP; NTPPg, e.g. PPi is the
inverse of PP. The rst-order denition for the inverses are i(x; y) def (y; x).
1 http://deliberation.ruleml.org/1.01</p>
      <p>
        Among these relations, the set fDC; EC; PO; EQ; TPP; NTPP; PPi; NTPPig are
provably jointly exhaustive and pairwise disjoint [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. This set of eight relations
is usually referred to as RCC8. Figure 1 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] gives a graphical view of all RCC8
relations.
      </p>
      <p>
        The rst-order denitions of Table 1 with inverses imply a lattice of all dened
relations, as shown in Figure 2 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        To assist with consistency checking and query answering in RCC, composition
tables are used [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The RCC8 composition table can be seen as a set of
rstorder rules of the form 8x; y; z : R1(x; y) ^ R2(y; z) ! Win=1 Si(x; z), where R1,
R2, and S1; : : : ; Sn are RCC8 relations. The table enables a quick retrieval of all
possible RCC8 relations S1; : : : ; Sn between regions x and z given R1(x; y) and
R2(y; z). A Datalog+ subset of these rules, i.e. the ones with i = 1, are included
in GeospatialRules.
      </p>
      <p>
        Development of GeospatialRules
The GeospatialRules rulebase contains rules, facts and queries. The rules consist
of two parts of knowledge: (1) the Datalog + fragment of the rst-order RCC
denitions; (2) rules which express part of the RCC knowledge that are not
captured by (1). We will explain all the parts in the following paragraphs. The
rulebase will be shown here in the presentation syntax of PSOA RuleML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and
converted to RuleML 1.01/XML for Appendix A.
      </p>
      <p>In GeospatialRules, we use RCC-prexed CamelCase for the relation names
to improve readability. The mapping between RCC relations and
GeospatialRules relations is shown in Table 2:</p>
      <p>The rst part of rules in GeospatialRules is the Datalog + fragment of the
axioms (1)(12) and the denitions of inverse RCC relations shown in Section 2.2.
Axioms (1) and (2) are kept unchanged in GeospatialRules:
Forall ?X ( RCCConnected(?X ?X) )
Forall ?X ?Y ( RCCConnected(?Y ?X) :- RCCConnected(?X ?Y) )
Axiom (4) is equivalent to</p>
      <p>(P(x; y) ! 8z[C(z; x) ! C(z; y)]) ^ (8z[C(z; x) ! C(z; y)] ! P(x; y))
The second conjunct is non-Horn, hence cannot be expressed in Datalog +. The
rst conjunct can be transformed to the equivalent Datalog rule</p>
      <p>C(z; x) ^ P(x; y) ! C(z; y);
which is written in GeospatialRules as</p>
    </sec>
    <sec id="sec-2">
      <title>Forall ?X ?Y ?Z ( RCCConnected(?Z ?Y) :- And(RCCConnected(?Z ?X) RCCPartOf(?X ?Y))</title>
      <p>The correctness of the transformation can be shown by the following rst-order
equivalences:</p>
      <p>The axioms (3),(5)(12), and the denitions of the inverse relations are all of
the form r Vim=1 pi ^ Vjn=1 :qj, where pi and qj are relational atoms or
existential formulas. Such a formula is equivalent to the conjunction of two formulas
(r !
m n m n
^ pi ^ ^ :qj) ^ (^ pi ^ ^ :qj ! r)
i=1 j=1 i=1 j=1
The rst formula is further separated into m + n rules fr ! pigim=1 and
fr ^ qj ! ?gjn=1, where ? denotes falsity (represented by Or() in the
presentation and XML syntaxes in a queryable manner). The second formula is in
Datalog+ only if there are no negations in the premise, i.e. for n = 0. In such
a case the formula is of the form Vim=1 pi ! r. For any pi being an existential
formula, we move all premise-side existentially quantied variables to top-level
universally quantied variables. Following are the rules belonging to this part.
The rules employing Or() conclusions are negative-constraint rules which can
be used for checking the consistency of the rulebase by querying Or().
)
)</p>
    </sec>
    <sec id="sec-3">
      <title>Forall ?X ?Y (</title>
      <p>Or() :- And(RCCConnected(?X ?Y) RCCDisconnected(?X ?Y))
)
Forall ?X ?Y ?Z (</p>
      <p>RCCOverlapped(?X ?Y) :- And(RCCPartOf(?Z ?X) RCCPartOf(?Z ?Y))
)
Forall ?X ?Y (</p>
      <p>Exists ?Z (And(RCCPartOf(?Z ?X) RCCPartOf(?Z ?Y)))
:</p>
      <p>RCCOverlapped(?X ?Y)
The above existential rule is transformed from axiom (5) in Table 1. The rule
says if a region ?X overlaps with a region ?Y, then there exists a region ?Z that
is part of both ?X and ?Y.</p>
      <p>Forall ?X ?Y ( Or() :- And(RCCDiscrete(?X ?Y) RCCOverlapped(?X ?Y)) )
Forall ?X ?Y (</p>
      <p>RCCExternallyConnected(?X ?Y)
:</p>
      <p>And(RCCConnected(?X ?Y) RCCDiscrete(?X ?Y))
)
Forall ?X ?Y ( RCCConnected(?X ?Y) :- RCCExternallyConnected(?X ?Y) )
Forall ?X ?Y ( RCCDiscrete(?X ?Y) :- RCCExternallyConnected(?X ?Y) )
Forall ?X ?Y ( RCCEqual(?X ?Y) :- And(RCCPartOf(?X ?Y) RCCPartOf(?Y ?X)) )
Forall ?X ?Y ( RCCPartOf(?X ?Y) :- RCCEqual(?X ?Y) )
Forall ?X ?Y ( RCCPartOf(?Y ?X) :- RCCEqual(?X ?Y) )
Forall ?X ?Y ( RCCOverlapped(?X ?Y) :- RCCPartiallyOverlapped(?X ?Y) )
Forall ?X ?Y ( Or() :- And(RCCPartiallyOverlapped(?X ?Y) RCCPartOf(?X ?Y)) )
Forall ?X ?Y ( Or() :- And(RCCPartiallyOverlapped(?X ?Y) RCCPartOf(?Y ?X)) )
Forall ?X ?Y ( RCCPartOf(?X ?Y) :- RCCProperPartOf(?X ?Y) )
Forall ?X ?Y ( Or() :- And(RCCProperPartOf(?X ?Y) RCCPartOf(?Y ?X)) )
Forall ?X ?Y ?Z (</p>
      <p>RCCTangentialProperPartOf(?X ?Y)
:</p>
      <p>And(RCCProperPartOf(?X ?Y)</p>
      <p>RCCExternallyConnected(?Z ?X)</p>
      <p>RCCExternallyConnected(?Z ?Y))
)
Forall ?X ?Y (</p>
      <p>Exists ?Z (</p>
      <p>And (RCCExternallyConnected(?Z ?X) RCCExternallyConnected(?Z ?Y))
) :- RCCTangentialProperPartOf(?X ?Y)</p>
    </sec>
    <sec id="sec-4">
      <title>Forall ?X ?Y ?Z (</title>
      <p>Or()
:</p>
      <p>And(RCCNonTangentialProperPartOf(?X ?Y)</p>
      <p>RCCExternallyConnected(?Z ?X)</p>
      <p>RCCExternallyConnected(?Z ?Y))
)
Forall ?X ?Y ( RCCProperPartOf(?X ?Y) :- RCCTangentialProperPartOf(?X ?Y) )
Forall ?X ?Y ( RCCProperPartOf(?X ?Y) :- RCCNonTangentialProperPartOf(?X ?Y) )
The following rules are transformed from the denitions of the inverses of
nonsymmetric RCC relations. For each relation 2 fP; PP; TPP; NTPPg, there are
two rules (x; y) ! i(y; x) and i(x; y) ! (y; x).</p>
      <p>Forall ?X ?Y ( RCCInversePartOf(?Y ?X) :- RCCPartOf(?X ?Y) )
Forall ?X ?Y ( RCCPartOf(?Y ?X) :- RCCInversePartOf(?X ?Y) )
Forall ?X ?Y ( RCCInverseProperPartOf(?Y ?X) :- RCCProperPartOf(?X ?Y) )
Forall ?X ?Y ( RCCProperPartOf(?Y ?X) :- RCCInverseProperPartOf(?X ?Y) )
Forall ?X ?Y (</p>
      <p>RCCInverseTangentialProperPartOf(?Y ?X) :- RCCTangentialProperPartOf(?X ?Y)
)
Forall ?X ?Y (</p>
      <p>RCCTangentialProperPartOf(?Y ?X) :- RCCInverseTangentialProperPartOf(?X ?Y)
)
Forall ?X ?Y (</p>
      <p>RCCInverseNonTangentialProperPartOf(?Y ?X) :- RCCNonTangentialProperPartOf(?X ?Y)
)
Forall ?X ?Y (</p>
      <p>RCCNonTangentialProperPartOf(?Y ?X) :- RCCInverseNonTangentialProperPartOf(?X ?Y)</p>
      <p>The second part of rules in GeospatialRules contain rules that express part of
the RCC knowledge that are not captured by the extracted Datalog + fragment.
We rst add all subsumptions in Figure 2 that are not implied by those extracted
rules:
Forall ?X ?Y ( RCCConnected(?X ?Y) :- RCCOverlapped(?X ?Y))
Forall ?X ?Y ( RCCOverlapped(?X ?Y) :- RCCPartOf(?X ?Y))
Forall ?X ?Y ( RCCDiscrete(?X ?Y) :- RCCDisconnected(?X ?Y) )
Besides these subsumption rules, we also add rules for inferring new geospatial
relations among entities from the relations explicitly expressed as facts in the
rulebase. These rules are the Datalog + subset of the rst-order form of the RCC8
composition table.</p>
    </sec>
    <sec id="sec-5">
      <title>Forall ?X ?Y ?Z ( RCCDisconnected(?X ?Z) :And(RCCPartOf(?X ?Y) RCCDisconnected(?Y ?Z)) )</title>
      <p>Forall ?X ?Y ?Z (</p>
      <p>RCCDiscrete(?X ?Z)
:</p>
      <p>And(RCCTangentialProperPartOf(?X ?Y) RCCExternallyConnected(?Y ?Z))
)
Forall ?X ?Y ?Z (</p>
      <p>RCCProperPartOf(?X ?Z)
:</p>
      <p>And(RCCTangentialProperPartOf(?X ?Y) RCCTangentialProperPartOf(?Y ?Z))
)
Forall ?X ?Y ?Z (</p>
      <p>RCCNonTangentialProperPartOf(?X ?Z)
:</p>
      <p>And(RCCPartOf(?X ?Y) RCCNonTangentialProperPartOf(?Y ?Z))
)
Forall ?X ?Y ?Z (</p>
      <p>RCCDisconnected(?X ?Z)
:</p>
      <p>And(RCCNonTangentialProperPartOf(?X ?Y) RCCExternallyConnected(?Y ?Z))
)
Forall ?X ?Y ?Z (</p>
      <p>RCCNonTangentialProperPartOf(?X ?Z)
:</p>
      <p>And(RCCNonTangentialProperPartOf(?X ?Y)</p>
      <p>RCCTangentialProperPartOf(?Y ?Z))
)
Forall ?X ?Y ?Z (</p>
      <p>RCCProperPartOf(?X ?Z)
:</p>
      <p>And(RCCProperPartOf(?X ?Y) RCCProperPartOf(?Y ?Z))
)</p>
      <p>The rules in the second part compensate for a portion of information that is
lost when the Datalog + fragment is extracted. These rules do not recover all the
lost knowledge since some of it cannot be expressed in Datalog +. However, they
ensure that all subsumptions between the RCC relations are preserved in our
rulebase. Moreover, the rules from the RCC8 composition table allow the users
to make inferences that are usually needed in geospatial applications, which we
will show in the next paragraph.</p>
      <p>The remaining of GeospatialRules consists of example facts and queries. The
facts in the KB describe geospatial relationships among certain regions in North
America, as well as the Pacic and the Atlantic oceans:
RCCProperPartOf(USA NorthAmerica)
RCCProperPartOf(California USA)
RCCProperPartOf(Virginia USA)
RCCExternallyConnected(Pacific California)
RCCExternallyConnected(Atlantic Virginia)
RCCExternallyConnected(Pacific USA)
RCCExternallyConnected(Atlantic USA)
State(California)
State(Virginia)
Ocean(Pacific)
Ocean(Atlantic)
Based on the above rules and facts, the following example queries can be asked:
1. RCCProperPartOf(California NorthAmerica)</p>
      <p>The ground query asks whether California is a proper part of North America.
This query atom can be inferred by applying the rule</p>
    </sec>
    <sec id="sec-6">
      <title>Forall ?X ?Y ?Z (</title>
      <p>RCCProperPartOf(?X ?Z)
:</p>
      <p>And(RCCProperPartOf(?X ?Y) RCCProperPartOf(?Y ?Z))
to the facts RCCProperPartOf(California USA) and RCCProperPartOf(USA
NorthAmerica).
2. And(State(?St) RCCTangentialProperPartOf(?St USA))</p>
      <p>The query asks which states in the rulebase are tangential proper parts of
the USA. From the geospatial relations among Pacific, California, and
USA, and the denition rule of RCCTangentialProperPartOf :
the atom RCCTangentialProperPartOf(California USA) can be derived.
Hence California is an answer of the query. Similarly, another answer,
Virginia, can also be derived.
3. And( State(?St)</p>
      <p>Ocean(?O)
RCCProperPartOf(?St NorthAmerica)</p>
      <p>RCCConnected(?St ?O))
This query asks for any state ?St which is a proper part of North
America and connects with an ocean ?O. From the rst query, we know that
California is a proper part of North America. And since
RCCConnected is a super-relation of RCCExternallyConnected ,
RCCConnected(California Pacific) can also be inferred. Therefore, one
answer of the query is ?St=California, ?O=Pacific . Another answer,
?St=Virginia,?O=Atlantic , can be obtained in a similar way.</p>
      <p>The full RuleML/XML version of the rulebase, 2 which complies to the
Deliberation RuleML 1.01 specication, is included in Appendix A. It uses an
abbreviated encoding allowed by the specication, which omits some edge tags and
default attribute values to make the document more compact and easier to read.
The compact version can be expanded to a normalized version using the
Deliberation RuleML Normalizer XSLT stylesheet for Disjunctive Hornlog+ with Naf
and Neg.3 To increase readability and comprehensibility of the rulebase, we use
proper indentations and add verbal denitions to each of the RCC relation as
comments.
4</p>
      <p>Conclusions and Future Work
In this paper, we describe a Datalog + rulebase, GeospatialRules, which can be
used in geospatial applications for reasoning with geospatial relations. The
rulebase is built on top of RCC relations. It contains rules, facts, and queries, where
the rules consist of: (1) a Datalog + fragment of the rst-order RCC relation
denitions; (2) additional rules expressing part of the RCC knowledge that are
not captured in (1), which ensure all subsumptions between RCC relations are
preserved. The rulebase enables the use of RuleML-compatible implementations
for qualitative geospatial reasoning.</p>
      <p>
        In Semantic Web applications, graph representations are widely used for
modeling knowledge and answering queries. In these representations, an object
consists of a globally unique Object IDentier (OID) typed by a class and
described by an unordered collection of n attribute-value slots, where the value can
again identify an object. Future versions of the rulebase can represent regions
by OIDs with slots describing its connections with other regions, using graph
versions of RCC relations as slot names, e.g. dened in the GeoSPARQL
standard [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], in order to allow graph querying over the rulebase. The transformation
from the relational to graph versions of RCC relations can be expressed in PSOA
RuleML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which combines the graph and relational paradigms of modeling.
      </p>
      <p>Further evaluation of the eciency of reasoning in GeospatialRules is also an
important research topic for the wide use of the rulebase. More facts and test
queries will need to be developed for the evaluation. The rulebase and queries
2 The le can be validated at and downloaded from http://deliberation.ruleml.</p>
      <p>
        org/1.01/exa/RulebaseCompetition2014/GeospatialRulesRCC.ruleml
3 http://wiki.ruleml.org/index.php/Specification_of_Deliberation_RuleML_
1.01#Appendix_4:_Normalizing_or_Upgrading_RuleML_Files_with_XSLT
will be posed to existing implementations of RuleML, e.g. PSOATransRun [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
to test the eciency of query answering.
A
      </p>
      <p>GeospatialRules in RuleML/XML
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- Symmetry of RCCConnected --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCConnected&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCConnected&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- In RCC, a region X is part of a region Y if and only if all regions</p>
      <p>that connect to X also connect to Y.
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCEqual&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCEqual is a subrelation of RCCPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCEqual&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCEqual&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- In RCC, two region X and Y are partially overlapped if and only if X and Y
are overlapped, X is not part of Y, and Y is not part of Y. --&gt;
&lt;Assert&gt;
&lt;!-- RCCPartiallyOverlapped is a subrelation of RCCOverlapped --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;</p>
      <p>&lt;if&gt;
&lt;Assert&gt;
&lt;!-- RCCProperPartOf is a subrelation of RCCPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;</p>
      <p>&lt;Or/&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- In RCC, a region X is a tangential proper part of a region Y if and only if</p>
      <p>X is a proper part of Y and there exists a region Z such that Z is
externally connected to both X and Y. --&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Exists&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/Exists&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- In RCC, a region X is a nontangential proper part of a region Y if and only if
X is a proper part of Y and there does not exist a region Z such that Z is
externally connected to both X and Y.
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;</p>
      <p>&lt;Or/&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCTangentialProperPartOf is a subrelation of RCCProperPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCNonTangentialProperPartOf is a subrelation of RCCProperPartOf</p>
      <p>--&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- Definitions of the inverses of non-symmetric RCC relations: RCCPartOf,</p>
      <p>RCCProperPartOf, RCCTangentialProperPartOf, and RCCNonTangentialProperPartOf.
--&gt;
&lt;Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCInverseProperPartOf and RCCProperPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCInverseProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCTangentialProperPartOf and RCCInverseTangentialProperPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCInverseTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCTangentialProperPartOf and RCCInverseTangentialProperPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCInverseTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCNonTangentialProperPartOf and RCCInverseNonTangentialProperPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCInverseNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCNonTangentialProperPartOf and RCCInverseNonTangentialProperPartOf --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCInverseNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- Additional rules expressing subsumptions between RCC relations that are not implied by
the Datalog+ fragment.
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCPartOf is a subrelation of RCCOverlapped --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCOverlapped&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- RCCDisconnected is a subrelation of RCCDiscrete --&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCDisconnected&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCDiscrete&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;!-- Additional rules extracted from the RCC8 composition table. --&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCDisconnected&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCDisconnected&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;</p>
      <p>&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCNonTangentialProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;Forall&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;Implies&gt;
&lt;if&gt;
&lt;And&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;Y&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/And&gt;
&lt;/if&gt;
&lt;then&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Var&gt;X&lt;/Var&gt;
&lt;Var&gt;Z&lt;/Var&gt;
&lt;/Atom&gt;
&lt;/then&gt;
&lt;/Implies&gt;
&lt;/Forall&gt;
&lt;/Assert&gt;
&lt;Assert&gt;
&lt;!-- Facts of the rulebase --&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Ind&gt;USA&lt;/Ind&gt;
&lt;Ind&gt;NorthAmerica&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Ind&gt;California&lt;/Ind&gt;
&lt;Ind&gt;USA&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Ind&gt;Virginia&lt;/Ind&gt;
&lt;Ind&gt;USA&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Ind&gt;PacificOcean&lt;/Ind&gt;
&lt;Ind&gt;California&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Ind&gt;AtlanticOcean&lt;/Ind&gt;
&lt;Ind&gt;Virginia&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Ind&gt;PacificOcean&lt;/Ind&gt;
&lt;Ind&gt;USA&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCExternallyConnected&lt;/Rel&gt;
&lt;Ind&gt;AtlanticOcean&lt;/Ind&gt;
&lt;Ind&gt;USA&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;State&lt;/Rel&gt;
&lt;Ind&gt;California&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;State&lt;/Rel&gt;
&lt;Ind&gt;Virginia&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;Ocean&lt;/Rel&gt;
&lt;Ind&gt;PacificOcean&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;Atom&gt;
&lt;Rel&gt;Ocean&lt;/Rel&gt;
&lt;Ind&gt;AtlanticOcean&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;/Assert&gt;
&lt;Query&gt;
&lt;!-</p>
      <p>Is California a proper part of North America?
Answer: True
The query atom is obtained by applying the rule
Forall ?X ?Y ?Z (</p>
      <p>RCCProperPartOf(?X ?Z) :- And(RCCProperPartOf(?X ?Y) RCCProperPartOf(?Y ?Z))
)
to the facts RCCProperPartOf(California USA) and RCCProperPartOf(California USA).
--&gt;
&lt;Atom&gt;
&lt;Rel&gt;RCCProperPartOf&lt;/Rel&gt;
&lt;Ind&gt;California&lt;/Ind&gt;
&lt;Ind&gt;NorthAmerica&lt;/Ind&gt;
&lt;/Atom&gt;
&lt;/Query&gt;
&lt;Query&gt;
&lt;!-</p>
      <p>Which states are tangential proper part of the USA?
Answers:
St: California</p>
      <p>St: Virginia
)
to the facts of relations RCCProperPartOf and RCCExternallyConnected.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Randell</surname>
            ,
            <given-names>D.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cui</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cohn</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>A spatial logic based on regions and connection</article-title>
          . In Nebel, B.,
          <string-name>
            <surname>Rich</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swartout</surname>
          </string-name>
          , W., eds.
          <source>: KR'92. Principles of Knowledge Representation and Reasoning: Proceedings of the Third International Conference</source>
          . Morgan Kaufmann, San Mateo, California (
          <year>1992</year>
          )
          <fpage>165176</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Cohn</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bennett</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gooday</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gotts</surname>
          </string-name>
          , N.:
          <article-title>Qualitative spatial representation and reasoning with the Region Connection Calculus</article-title>
          .
          <source>GeoInformatica</source>
          <volume>1</volume>
          (
          <issue>3</issue>
          ) (
          <year>October 1997</year>
          )
          <fpage>275316</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Boley</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grtter</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zou</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Athan</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Etzold</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>A Datalog + RuleML 1.01 architecture for rule-based data access in ecosystem research</article-title>
          . To appear in RuleML
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Cal</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukasiewicz</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A general Datalog-based framework for tractable query answering over ontologies</article-title>
          .
          <source>Journal of Web Semantics</source>
          <volume>14</volume>
          (
          <year>July 2012</year>
          )
          <fpage>5783</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>De</surname>
            <given-names>Virgilio</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Orsi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Tanca</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Torlone</surname>
          </string-name>
          , R.:
          <article-title>NYAYA: A system supporting the uniform management of large sets of semantic data</article-title>
          .
          <source>In: IEEE 28th International Conference on Data Engineering. (April</source>
          <year>2012</year>
          )
          <fpage>13091312</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Boley</surname>
          </string-name>
          , H.:
          <article-title>A RIF-Style Semantics for RuleML-Integrated Positional-Slotted, ObjectApplicative Rules</article-title>
          .
          <source>In: Proc. 5th International Symposium on Rules: Research Based and Industry Focused (RuleML-2011 Europe)</source>
          ,
          <source>Barcelona, Spain. Lecture Notes in Computer Science</source>
          , Springer (July
          <year>2011</year>
          )
          <fpage>194211</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Perry</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Herring</surname>
            ,
            <given-names>J.: OGC</given-names>
          </string-name>
          <article-title>GeoSPARQL - a geographic query language for RDF data</article-title>
          . Open Geospatial Consortium Standard (
          <year>September 2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Zou</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peter-Paul</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boley</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riazanov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>PSOATransRun: Translating and Running PSOA RuleML via the TPTP Interchange Language for Theorem Provers</article-title>
          . In Ait-Kaci,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.J.</given-names>
            ,
            <surname>Nalepa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.J.</given-names>
            ,
            <surname>Palmirani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Roman</surname>
          </string-name>
          , D., eds.
          <source>: Proceedings of the RuleML2012@ECAI Challenge, at the 6th International Symposium on Rules, CEUR-874</source>
          (
          <year>August 2012</year>
          )
          <article-title>The answers are obtained by applying the definition rule of RCCTangentialProperPartOf Forall ?X ?</article-title>
          <string-name>
            <surname>Y ?Z ( RCCTangentialProperPartOf(?X ?Y) :- And(RCCProperPartOf(?X ?Y) RCCExternallyConnected(?Z ?X) RCCExternallyConnected(?Z ?Y))</surname>
          </string-name>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>