{? X1 ? pr op X1 m ? yX1 m .
? yX 1m rd fs : la be l ? l yX 1 m .
FI LT ER ( re gex (? ly X1 m , m . mo dT ex tX 1 )) .}
UN ION
{? y X1m ? p rop X1 m ? X1 .
? yX 1m rd fs : la be l ? l yX 1 m .
FI LT ER ( re gex (? ly X1 m , m . mo dT ex tX 1 )) .}
}
4.3 Entity Linking
Object properties relate different individuals. In the
Query Ontology, actions (verbs) are marked as DRs
during the Partial Semantic Representation phase,
generating an individual of the Action subclass. In
the solution, a ternary relation between the subject
and the object complement (or place/date if the object
complement is absent) is found through the action. In
Example Question 1 can be seen that the subject Per-
son1 is related to Place2 through the action Born3.
In the target KB, i.e. DBpedia, unlike the Query On-
tology, actions are often represented through Object
Properties between objects. Therefore, two different
approaches are used to correctly translate the pair of
triples: the relation representing the subject of the ac-
tion and the latter is translated as equality between the
two individuals of the triple. In this way, the subject
will be directly related to the second triple. the second
triple, on the other hand, is translated using the lemma
present in the Action (thus the verb related to it) to de-
fine the type of object property between the two enti-
ties. Below, the translation of two object properties in
Example Question 2 representing the described case:
who make and make what
who make(X1,X2) -> re pl ace ( X2 , X1 )
ha s_ te xt ( X2 , t ex tX2 )
ha s_ mod ( X2 , t ext X2 )
make what(X1,X3) ->
{? X1 ? p r op M2 O1 ? X3 .
? pr op M2 O1 r dfs : l abe l ? nP ro pM2 O1 .
FI LT ER ( re gex (? n Pro pM2 O1 , t ex tX1 ) ) }
UN ION
{? X3 ? p r op O1 M2 ? X1 .
? pr op O1 M2 r dfs : l abe l ? nP ro pO1 M2 .
FI LT ER ( re gex (? n Pro pO1 M2 , t ex tX1 ) ) }
Since the relation type is based on the lemma, it
must include the possibility that the subject may be
the domain or range of the relation in DBpedia, in-
cluded by UNION. Similar to identifying the class
when analyzing has text, synonyms can define the ob-
ject property in DBpedia. Currently, synonym map-
ping rules are defined manually.
There are two special cases: when the Action is ‘to
be’ or ‘to have’. For ‘to have’, the lemma text is not
analyzed as it does not help identify the relation type.
For ‘to be’, the variables defining three individuals
in the Query Ontology are equated. The correct in-
terpretation is determined by constraints on variables
from other Query Ontology relations. Below are the
mapping description rules for three object properties,
illustrated by Example Question 3.: what is(X1,X2),
is what(X1,X3), and conceptOfPlace(X2,X4).
what is(X1,X2) -> re pl ace ( X2 , X1 )
ha s_ te xt ( X2 , t ex tX2 )
ha s_ mod ( X2 , t ext X2 )
is what(X1,X3) -> re pl ace ( X3 , X1 )
ha s_ te xt ( X2 , t ex tX3 )
ha s_ mod ( X2 , t ext X3 )
conceptOfPlace(X2,X4) ->
ha s_ te xt ( X2 , t ex tX2 )
if ( not ex is tT yp e ( ha s La be l ( te x tX 2 )) an d not e xi s tP ro pe rt y (
ha sL ab el ( te xt X2 ) )) {
FI LT ER ( X2 = X4 )
}
4.4 Query Building Process
In the last section, the construction of a query will
be shown step by step. Although the creation of the
query will be described in steps to understand how it
is done, in practice it is not necessary to use an order
in the analysis of the solution triples.
4.4.1 SPARQL Query for Question 1
In the first step, the SELECT clause is constructed.
The Query Ontology identifies Place1 as the target
via the object property select, with no modifier. Next,
the data property has name for Person2 is translated
in the query body by defining Person2 as individ-
uals labeled ‘Bill Gates’. Next, the object proper-
ties who born and action date are found. who born
equates ?Person2 and ?Born3, while action place is
defined by the class assigned to the property action,
implying the translation ?birthProp with rdfs:label
‘birth place’. Since Place has ‘country’ as the value
of has text, it’s assumed the country is specified. The
translation adds a UNION to handle two triples in
DBpedia: one for ?Person2’s city of birth (?birthProp)
and another linking the city to its country (?country)
with rdfs:label ‘country’.
who born(X1,X2) -> re pl ace ( X2 , X1 )
action place(X1,X3) ->
sw it ch ( ge tC la ss ( X1 ))
ca se " Bor n ":
? bi rt hP ro p rd fs : la bel ? lb P .
FI LT ER ( re gex (? lbP ," bi rth p l ac e " , "i ") ) .
{? X1 ? b i rt hP ro p ? X3 .
if ( ex is tT yp e ( ha sL ab el ( t e xt X3 ) )) {
? X3 rd f : t ype ? tX 3.
? tX3 rd fs : la bel ? l t X3 .
FI LT ER ( re gex (? ltX 3 , te xt X3 , "i ") ) .
}}
UN ION
{? X1 ? b i rt hP ro p ? c it yX3 .
? ci ty X3 ? cP rop ? X3 .
? cP rop rd fs : la bel ? l cP rop .
FI LT ER ( re gex (? lc Pro p ," co un try " ," i" )) .}
[. ..]
Below, the final result of the mapping through the
mapping description rules of the Ontology query so-
lution in a SPARQL query for DBpedia is presented.
SE LE CT D IS TI N CT ? P la c e1
WH ERE {
? Bo rn3 rd fs : la bel ? n Pe rs on2 .
KEOD 2024 - 16th International Conference on Knowledge Engineering and Ontology Development
180