=Paper= {{Paper |id=Vol-2317/article-04 |storemode=property |title=None |pdfUrl=https://ceur-ws.org/Vol-2317/article-04.pdf |volume=Vol-2317 |dblpUrl=https://dblp.org/rec/conf/semweb/Gimenez-GarciaZ18 }} ==None== https://ceur-ws.org/Vol-2317/article-04.pdf
        NdProperties: Encoding Contexts in RDF
         Predicates with Inference Preservation

                José M. Giménez-Garcı́a1 and Antoine Zimmermann2
    1
      Univ Lyon, UJM-Saint-Étienne, CNRS, Laboratoire Hubert Curien UMR 5516,
                             F-42023 Saint-Étienne, France
                       jose.gimenez.garcia@univ-st-etienne.fr
    2
      Mines Saint-Étienne, Univ Lyon, Univ Jean Monnet, IOGS, CNRS, UMR 5516
              LHC, Institut Henri Fayol, F - 42023 Saint-Étienne France
                             antoine.zimmermann@emse.fr



         Abstract. Annotating RDF triples within a context (such as prove-
         nance) is becoming more and more important in the recent years. A
         number of approaches exist to represent this annotations, but how to dis-
         tinguish the information of each context and be able to reason with it is
         still a challenge. In this work, we present formalizations of the necessary
         transformations in the RDF graph to encode the contextual informa-
         tion as contextualization function in RDF, and describe the existing ap-
         proaches according to this formalization. We then present NdProperties,
         an OWL-DL ontology inspired by NdFluents and singleton properties,
         and present alternative contextualization functions for it.

         Keywords: RDF · OWL · Contexts · Reasoning · Reification


1       Introduction
In the recent years, the necessity of annotating RDF statements with contex-
tual information have been increasing. However, a triple can only represent a
binary relations between a subject and an object. To make explicit the rela-
tionship between the statement and its context, either the information must be
encoded outside of the RDF syntax, or the statement and its context must be
split into multiple triples, possibly resulting in the subject and the object being
disconnected.
    With most common approaches for representing contextual information, in-
ferences that were following from the original statement are not preserved. Re-
cent approaches allow for some inferences to be preserved. However, the result
of the inference has no connection with the context. This makes impossible to
separate the knowledge in different context, and can lead to data that is inconsis-
tent or that does not correspond with the ground truth, due to some undesirable
inference results.
    In this work we present NdProperties, an OWL-DL ontology to use triple
predicates to relate statements to their context. This approach is inspired by Sin-
gleton Properties [8] (which also use the predicates to represent the statement)


Copyright c 2018 for this paper by its authors. Copying permitted for private
and academic purposes.
2       J.M. Giménez-Garcı́a and A. Zimmermann

and NdFluents [5] (which is able to better separate the contexts), NdProperties
can be seen as a concrete implementation of a generic approach where a subset
of the terms is contextualized, explored also for all the terms in NdTerms [10].
The NdProperties ontology can be implemented in different ways, in order to
allow more or less inferences.
    The rest of the document is organized as follows: Section 2 presents some def-
initions, necessary to understand the rest of the work; Section 3 present current
approaches to annotate statements with additional data; Section 4 describes the
NdProperties ontology, with Section 5 studying its inference capabilities; finally,
we provide some discussion possible future work in Section 6.


2    Preliminaries
In order to go from a set of triples, plus the desired contextual annotations,
to a set of contextualized triples (i.e., a set of reified or modified triples, plus
additional triples that express the annotations), it is necessary to perform a
transformation. In this section we introduce the notation we will use for the rest
of the paper, formalize this transformation as a contextualization function, and
present some desired properties that such a function should have. This section
summarizes and updates previous work in the topic [5, 10].
    We assume infinite disjoint sets I (IRIs), B (blank nodes), and L (literals).
An RDF triple is a tuple (s, p, o) ∈ (I ∪ B) × I × (I ∪ B ∪ L), where s is called
the subject, p is the predicate and o is the object. We write T the infinite set of
triples. An RDF graph G is a set of RDF triples. For the sake of simplicity, we
will assume that a contextual annotation is a single IRI. We assume an infinite
set of contexts C ⊂ I.
Definition 1 (Contextualization function). A contextualization function in RDF
is any function f : C × 2T → 2T .

    Usually, contextualization functions need to create fresh terms that will be
used to reify the statements. This is often done by renaming existing terms us-
ing one or more injective functions ren, which may or may not depend on the
context or the type or term being renamed. This function is in practice usually
arbitrary. The idea of a contextualization function is that it expresses that the
knowledge of the original graph holds in the context. However, many meaning-
less contextualization functions are possible that do not necessarily encode that
knowledge. In order to identify useful contextualization functions, we propose
the following property:
Definition 2 (Inference preservation). A contextualization function f preserves
inferences wrt a set of graphs G iff for all c ∈ C and all graphs G, G0 ∈ G, iff G |= G0
then f (c, G) |= f (c, G0 ).

    Inference preservation expresses the idea that knowledge that can be inferred
in the original graph should also be inferred within the context. It is also pos-
sible that the contextualization function preserves some inferences, but it is not
                                                                          NdProperties            3

able to encapsulate the inferred knowledge in the context. We call this property
Non-contextual Inference preservation. Although this property can be useful if
the goal of contextualization function is to simply annotate triples that are con-
sidered universally true, it can lead to undesirable inferences if that is not the
case, as we will see in Section 5.
Definition 3 (Non-contextual Inference preservation). A contextualization func-
tion f preserves entailments wrt a set of ontologies O iff for all c ∈ C and all ontologies
O, O0 ∈ O, iff O |= O0 then f (c, O) |= O.
    This definitions will be used to study existing reification approaches, as well
as the newly defined NdProperties.

3    Existing approaches for representing context
In this section we present and describe the most relevant reification approaches
(namely RDF reification, n-ary relations, the singleton and companion prop-
erties, and NdFluents), and formalize their contextualization functions. In the
following definitions, we will use t as the parameter of the ren function when the
fresh term does not depend on a concrete term of the triple. Note that for RDF
reification and n-ary relations more than one contextualization function could
be possible. For the sake of simplicity, we consider an elementary transformation
were the added term will be used to represent the context.
    RDF reification [2, Sec. 5.3] is the standard W3C model to represent infor-
mation about a statement. A contextualization function for reification can be
defined as follows.
Definition 4 (RDF reification contextualization function). Let c ∈ C and G ∈
2T be a context and a graph respectively. We define the contextualization function fR
such that fR (c, G) = {(renc (t), type, Statement), (renc (t), subject, s), (renc (t), predicate, p),
(renc (t), object, o) | (s, p, o) = t ∈ G}.
    Techniques for representing n-ary relations in RDF [9] were published in 2006
as a W3C note. A contextualization function for them can be defined as follows.
Definition 5 (N-ary relations contextualization function). Let c ∈ C and G ∈
2T be a context and a graph respectively. We define the contextualization function fnary
such that fnary (c, G) = {(s, rensc (p), renrc (p)), (renrc (p), renvc (p), o) | (s, p, o) = t ∈ G}.
   Singleton properties [8] are a recent proposal based on creating a unique
property for each triple and using it to reify the triple. It extends the RDF
semantics in order to make each singleton property unique and to include its
extension in the extension of the original property. However, these semantics
can be emulated with the following contextualization function.
Definition 6 (Singleton Property contextualization function). Let c ∈ C and
G ∈ 2T be a context and a graph respectively. We define the contextualization func-
tion fsp such that fsp (c, G) = {(s, ren(p), o), (ren(p), type, SingletonP roperty), (ren(p),
singletonP ropertyOf, p), (ren(p), type, F unctionalP roperty), (ren(p), type,
InverseF unctionalP roperty) | (s, p, o) = t ∈ G} ∪ ((singletonP ropertyOf,
subP ropertyOf, subP ropertyOf )).
4        J.M. Giménez-Garcı́a and A. Zimmermann

    The Companion Property [4] is an attempt to reduce the number of unique
properties that are generated by singleton properties. Its contextualization func-
tion can be defined as follows.

Definition 7 (Companion Property contextualization function). Let c ∈ C
and G ∈ 2T be a context and a graph respectively. We define the contextualization
function fcp such that fcp (c, G) = {(s, ren1 (p), o), (ren1 (p), companionP ropertyOf, p),
(s, ren2 (p), ren3 (t)), (ren3 (t), idP ropertyOf, ren1 (p)) | (s, p, o) = t ∈ G} ∪
(companionP ropertyOf, subP ropertyOf, subP ropertyOf ).

    NdFluents [5] was created with the purpose of improving inference preserva-
tion. It consists in considering individuals as separate entities that exist accord-
ing to each context. Its contextualization function can be defined as follows.

Definition 8 (NdFluents contextualization function). Let c ∈ C and G ∈ 2T be a
context and a graph respectively. We define the contextualization function fndf such that
fndf (c, G) = {(renc (s), p, renc (o)), (renc (s), type, renc (contextualP art)), (renc (o), type,
renc (contextualP art)), (renc (ContextualP art), subClassOf, ContextualP art), (renc (s),
renc (contextualP artOf ), s), (renc (o), renc (contextualP artOf ), o), (renc (s),
renc (contextualExtent), (renc (o), renc (contextualExtent), renc (t)), (renc (t), type,
renc (Context)), | (s, p, o) = t ∈ G} ∪ {(renc (Context), subClassOf, Context),
(renc (contextualExtent), subP ropertyOf, contextualExtent), (renc (contextualP artOf ),
subP ropertyOf, contextualP artOf )}.

    NdTerms [10] is a generalization of NdFluents that has been specifically stud-
ied in the context of Description Logics. It extends the approach to every term
in the ontology instead of just the individuals. If the initial ontology is in OWL,
then it can be represented in RDF, and the contextualization could be expressed
according to the above Def. 1. However, it also introduces several notions that
are required to ensure other desirable properties, that are fairly long to give in
detail here. So we do not formalize the related contextualization function.
    In addition to these approaches, there are diverse ways to express context
with extensions of the syntax of RDF. Most prominently Named graphs [3],
RDF* [6], and Notation 3 [1] are three such cases. Named graphs extend the
syntax of RDF by adding a fourth element to the triples. RDF* extends RDF
with the possibility to use an RDF* triple in subject and object positions of an-
other RDF* triple. Notation-3 extends this further with more constructs, such
as rule definitions, variable quantifications. These approaches do not conform to
the definition of contextualization function, since the result of their transforma-
tion is not an RDF graph. Hence, they will be kept out of scope for comparisons
in the rest of the paper.


4    The NdProperties Ontology and Contextualization
     Function

NdFluents [5] and NdTerms [10] are based on the idea if creating contextual
terms (individuals for the former, all terms for the latter) that mirror the terms
                                                                                      NdProperties   5

     of the graph or ontology. They can be seen as concrete instantiations of a general
     approach in which a subset of the terms is contextualized. NdProperties is a
     new instantiation where the relations are contextualized. It creates a different
     property for each existing property in the graph and each different context we
     want to use to annotate the data. The ontology can be seen down below, and
     the contextualization function is shown in Definition 9.
1    Prefix( rdf:= )
2    Prefix( owl:=)
3    Prefix( ndp:= )
4    Ontology( 
5           Declaration( Class( ndp:Context ) )
6           Declaration( Class( ndp:ContextualProperty ) )
7           SubClassOf( ndp:ContextualProperty rdf:Property ) )
8           Declaration( Class( ndp:ContextualObjectProperty ) )
9           SubClassOf( ndp:contextualObjectProperty ndp:ContextualProperty ) )
10          SubClassOf( ndp:contextualObjectProperty owl:ObjectProperty ) )
11          Declaration( Class( nd:ContextualDatatypeProperty ) )
12          SubClassOf( ndp:contextualDatatypeProperty ndp:ContextualProperty ) )
13          SubClassOf( ndp:contextualDatatypeProperty owl:DatatypeProperty ) )
14          Declaration( ObjectProperty( ndp:contextualPropertyOf ) )
15          ObjectPropertyDomain( ndp:contextualPropertyOf rdf:Property ) )
16          ObjectPropertyRange( ndp:contextualPropertyOf ndp:ContextualProperty )
17          Declaration( ObjectProperty( ndp:contextualExtent ) )
18          ObjectPropertyDomain( ndp:contextualExtent ndp:ContextualProperty )
19          ObjectPropertyRange( ndp:contextualExtent ndp:Context )
20   )

        While the ontology can be used “as is”, in order to represent more than one
     context it is necessary to be extended for each context (in a similar fashion as
     NdFluents [5]). In 1 we show the representation of a statement with temporal
     annotations using this ontology. The non-dashed parts belong to the temporal
     extension, while the dashed parts correspond to the NdProperties ontology plus
     other possible extensions. Other dimensions, such as provenance, can be modeled
     similarly to the temporal dimension by replacing the appropriate classes and
     properties. We will use the function ren in order to generate these terms in
     Definition 9.


                            ContextualProperty



                            TemporalProperty      ···    ProvenanceProperty    ···   TrustProperty


                  Paris        capitalOf@1              France      Context

                   temporalPropertyOf

                capitalOf                        temporalExtent     Interval

                  contextualPropertyOf

                                               contextualExtent        t1


                            Fig. 1: Temporal Extension of NdProperties
6       J.M. Giménez-Garcı́a and A. Zimmermann

Definition 9 (NdP– contextualization function). Let c ∈ C and G ∈ 2T be a
context and a graph respectively. We define the contextualization function fN dP − such
that fN dP − (c, G) =
    {(s, renc (p), o) | (s, p, o) = t ∈ G}∪
    {(renc (p), type, renc (ContextualP roperty)) | p ∈ t ∈ G}∪
    {(renc (p), renc (contexualP ropertyOf ), p) | p ∈ t ∈ G}∪
    {renc (p), renc (contextualExtent), renc (t)}
    {(renc (ContextualP roperty), subClassOf, ContextualP roperty)}∪
    {renc (contextualP ropertyOf ), subP ropertyOf, contextualP ropertyOf }∪
    {renc contextualExtent, subP ropertyOf, contextualExtent}∪
    {renc (t), type, renc (Context)}∪
    {renc (Context), subClassOf, Context}

    Note that the semantics of the property p are lost in fN dP − (e.g., it’s domain
and range, or as a functional property, transitive property, etc.). However, it is
also possible to have contextualization functions that retain totally or partially
the semantics of p. For the sake of comparison, we will define a contextualiza-
tion function fN dP + , in which we the contextual properties are described in an
identical way as the original ones.
Definition 10 (NdP+ contextualization function). Let c ∈ C and G ∈ 2T be a
context and a graph respectively. We define the contextualization function fN dP + such
that fN dP + (c, G) = fN dP − (c, G) ∪ {(renc (p), q, r) | (p, q, r) = t ∈ G}

  In the following section we will compare the inference preservation of the two
NdProperties contextualization functions against the other approaches.


5    Reasoning with NdProperties
Following a similar approach as for NdFluents [5], we analyze for which rules
from the pD* fragment of OWL [7] the contextualization functions preserve
inferences. For each rule, we check if the contextualization function for each
approach has Inference Preservation or Non-Contextual Inference Preservation
wrt a graph that contains the corresponding triples. Following NdFluents evalu-
ation, we apply the contextualization function only on triples that do not include


Table 1: Preserved D* entailments (P = Rule Preservation, PN C = Non-Contextual
Rule Preservation, ! = Risk of undesirable inference)

       Rule    Condition     Constraint       Conclusion      Reif. N-Ary    S.P.    NdF NdP– NdP+
       lg      v p l         l ∈ L            v p bl           P      P       P       P   P     P
       gl      v p bl        l ∈ L            v p l            P      P       P       P   P     P
       rdf1    v p w                          p type Property                 P       P   P     P
                                           +
       rdf2-D v p l          l = (s, a) ∈ L  b type a           P    P        P       P   P    P
                                           D l
       rdfs1  v p l             l ∈ Lp       bl type Literal    P    P        P       P   P    P
       rdfs2  p domain u
              v p w                           v type u                       P!                P!
       rdfs3  p range u
              v p w             w ∈ U ∪B      w type u                       P!                P!
       rdfs4a v p w                           v type Resource   P    P       P        P   P    P
       rdfs4b v p w             w ∈ U ∪B      w type Resource   P    P       P        P   P    P
       rdfs7x p subPropertyOf q
              v p w             q ∈ U ∪B      v q w                         PN C !    P
                                                                              NdProperties             7

Table 2: Preserved P-Entailments (P = Rule Preservation, PN C = Non-Contextual
Rule Preservation, ! = Risk of undesirable inference)

   Rule     Condition                        Constraint   Conclusion Reif. N-Ary S.P.  NdF NdP– NdP+
   rdfp1    p type FunctionalProperty
            u p v
            u p w                            v ∈ U ∪B     v sameAs w              P!             P!
   rdfp2    p type InverseFunctionalProperty
            u p w
            v p w                                         v sameAs w              P!             P!
   rdfp3    p type SymmetricProperty
            v p w                            w ∈ U ∪B     w p v                 PN C !  P         P
   rdfp4    p type TransitiveProperty
            u p v
            v p w                                         u p w                 PN C !  P         P
   rdfp5a   v p w                                         v sameAs v  P      P    P     P   P     P
   rdfp5b   v p w                            w ∈ U ∪B     w sameAs w  P      P    P     P   P     P
   rdfp8ax p inverseOf q
            v p w                            w, q ∈ U ∪ B w q v                 PN C !  P         P
   rdfp8bx p inverseOf q
            v q w                            w ∈ U ∪B     w p v                 PN C !  P         P
   rdfp11   u p v
            u sameAs u0
            v sameAs v 0                     u0 ∈ U ∪ B   u0 p v 0    P      P  PN C !      P     P
   rdfp14a v hasValue w
            v onProperty p
            u p w                                         u type v                P!
   rdfp14bx v hasValue w
            v onProperty p
            u type v                         p ∈ U ∪B     u p w      PN C PN C PN C PN C PN C PN C
   rdfp15   v someValuesFrom w
            v onProperty p
            u p x
            x type w                                      u type v                P!
   rdfp16   v allValuesFrom w
            v onProperty p
            u type v
            u p x                            x ∈ U ∪B     x type w                P!




RDF, RDFS, or OWL vocabularies. The intuition behind this is that reification
approaches are usually used to annotate data on relations between resources.
Table 1 shows the D* (modified RDFS) entailment rules and rule preservations
for each one of the approaches, whereas Table 2 presents the same informa-
tion for P entailments (modified subset of OWL). Note that we remove those
rows where both condition and conclusion include only triples with RDF, RDFS,
or OWL vocabularies. A symbol P indicates that there is rule preservation for
the corresponding approach, while a symbol PN C denotes non-contextual rule
preservation. A symbol ! means that it is possible to have undesirable inferences
This happens when the contextualization function annotates at least one triple
of the condition, and either we have non-contextual inference preservation, or
we have inference preservation but the function does not modify the triple in
the conclusion.
    For other approaches the conclusions of NdFluents [5] hold: reification and
n-ry relations show poor preservation of rules, where most of those rules could be
considered tautologies. The Singleton Property provides a mixture of inference
preservation and non-contextual inference preservation for all the rules, that
can be useful when we want to annotate universally true facts, but it is not
usable when we want to have contextual information that is not universally
true. NdFluents, by contrast, has neither non-contextual rule preservation nor
rule preservation that can lead to undesirable inferences for any rule. As for
NdProperties, we can observe that NdP– behaves slightly better than reification
and n-ary relations, having inference preservation for tow additional rules: rdf1
8       REFERENCES

and rdfp11. NdP+ shows the potential of this approach: adding axioms to the
contextual property leads to having inference preservation for the associated
rules (which was not possible for NdFluents). However, in four out of eight cases
it can lead to undesirable inferences, which means that what axioms should be
added to the contextualization function needs to be carefully considered.


6    Conclusion and Future Work
NdProperties can be seen as a concrete instantiation of a general approach of
contextualizing a subset of the terms in an ontology. Other instantiations that
follow this approach are NdFluents [5] (where the individuals are contextualized)
and NdTerms [10] (where all the terms are contextualized). In this paper, we have
present an ontology to represent NdProperties in RDF and showed two possi-
ble contextualization function among many. We compare these contextualization
functions against existing reification approaches in terms of inference preserva-
tion and see that it preserves more desirable entailments, with the additional
advantage that can be tuned to preserve only a subset of desired inferences.
    In the future, we plan to continue our research in the general approach of
contextualizing terms, studying their instantiations and properties and how to
combine and relate different contexts, and performing a systematic comparison
of the different instantiations of the approach.

Acknowledgements: This work is supported by H2020 Marie Sklodowska-Curie ITN
No 642795. Authors would like to thank Prof. Pierre Maret for his comments.


References
 [1] Berners-Lee, T., Connolly, D.: Notation3 (N3): A readable RDF syntax. W#C
     member submission (2011).
 [2] Brickley, D., Guha, R.: RDF Schema 1.1. W3C Recommendation (2014).
 [3] Carroll, J.J., Bizer, C., Hayes, P.J., Stickler, P.: Named graphs. J. Web Sem.
     (2005).
 [4] Frey, J., Müller, K., Hellmann, S., Rahm, E., Vidal, M.-E.: Evaluation of Metadata
     Representations in RDF stores. Sem. Web. J. (2017).
 [5] Giménez-Garcı́a, J.M., Zimmermann, A., Maret, P.: NdFluents: An Ontology for
     Annotated Statements with Inference Preservation. ESWC (2017).
 [6] Hartig, O.: Foundations of RDF* and SPARQL* (An Alternative Approach to
     Statement-Level Metadata in RDF). AMW (2017).
 [7] Horst, H.J.t.: Completeness, decidability and complexity of entailment for RDF
     Schema and a semantic extension involving the OWL vocabulary. J.W.S. (2005).
 [8] Nguyen, V., Bodenreider, O., Sheth, A.: Don’t like RDF Reification?: Making
     Statements about Statements Using Singleton Property. WWW (2014).
 [9] Noy, N., Rector, A., Hayes, P., Welty, C.: Defining N-Ary Relations on the Se-
     mantic Web. W3C Working Group (2006).
[10] Zimmermann, A., Giménez-Garcı́a, J.M.: Contextualizing DL Axioms: Formaliza-
     tion, a New Approach, and Its Properties. WOMoCoE (2017).