Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is being published as one of a set of 5 documents:
The Rule Interchange Format (RIF) Working Group seeks public feedback on these Working Drafts. Please send your comments to public-rif-comments@w3.org (public archive). If possible, please offer specific changes to the text that would address your concern.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
Contents |
The Rule Interchange Format (RIF), specifically the Basic Logic Dialect (BLD) [ RIF-BLD ], defines a means for the interchange of (logical) rules over the Web. Rules which are exchanged using RIF may refer to external data sources and may be based on certain data models which are represented using a language different from RIF. The Resource Description Framework RDF [ RDF-Concepts ] is a Web-based language for the representation and exchange of data; RDF Schema (RDFS) [ RDF-Schema ] and the Web Ontology Language OWL [ OWL-Reference ] are Web-based languages for the representation and exchange of ontologies (i.e., data models). This document specifies how combinations of RIF BLD Rule sets and RDF data and RDFS and OWL ontologies must be interpreted.
The RIF working group plans to develop further dialects besides BLD, most notably a dialect based on Production Rules [ RIF-PRD ]; these dialects are not necessarily extensions of BLD. Future versions of this document will address compatibility of these dialects with RDF and OWL as well. In the remainder of the document, when mentioning RIF, we mean RIF BLD [ RIF-BLD ].
RDF data and RDFS and OWL ontologies are represented using RDF graphs. Several syntaxes have been proposed for the exchange of RDF graphs, the normative syntax being RDF/XML [ RDF-Syntax ], which is an XML-based format. RIF does not provide a format for exchanging RDF; instead, it is assumed that RDF graphs are exchanged using RDF/XML, or any other syntax that can be used for representing or exchanging RDF graphs.
This document does not, as yet, define whether or how RDF documents/graphs should be referred to from RIF rule sets. The specification of combinations in this document does not depend on (the existence of) this mechanism: it applies in case an RIF rule sets explicity points to (one or more) RDF documents, but also in case the references to the RDF document(s) are not interchanged using RIF, but using some other (out of bounds) mechanism.
A typical scenario for the use of RIF with RDF/OWL includes the exchange of rules which either use RDF data or an RDFS or OWL ontology. In terms of rule interchange the scenario is the following: interchange partner A has a rules language which is RDF/OWL-aware, i.e., it allows to use RDF data, it uses an RDFS or OWL ontology, or it extends RDF(S)/OWL. A sends its rules (using RIF), possibly with a reference to the appropriate RDF graph(s), to partner B. B can now translate the RIF rules into its own rules language, retrieve the RDF graph(s) (which is published most likely using RDF/XML), and process the rules in its own rule engine, which is also RDF/OWL-aware. The use case Vocabulary Mapping for Data Integration [ RIF-UCR ] is an example of the interchange of RIF rules which use RDF graphs.
A specialization of this use case is the publication of RIF rules which refer to RDF graphs (notice that publication is a specific kind of interchange). In such a scenario, a rule publisher A publishes its rules on the Web. There may be several consumers who retrieve the RIF rules and RDF graphs from the Web, and translate the RIF rules to their own rules languages. The use case Publishing Rules for Interlinked Metadata [ RIF-UCR ] is an example of the publication of RIF rules related to RDF graphs.
Another specialization of this use case is the interchange of rule extensions to OWL [ RIF-UCR ]. The intention of the rule publisher in this scenario is to extend an OWL ontology with rules: interchange partner A has a rules language that extends OWL. A splits its ontology+rules description into a separate OWL ontology and an RIF rule set, publishes the OWL ontology, and sends (or publishes) the RIF rule set, which includes a reference to the OWL ontology. The consumers of rules retrieves the OWL ontology, and translates the ontology and the rule set into a combined ontology+rules description in its own rules language which also extends OWL.
An RIF rule set which refers to RDF graphs, or any use of an RIF
rule set with RDF graphs, is viewed as a combination of an RIF rule
set and a number of RDF graphs. This document specifies how, in
such a combination, the rule set interacts with the RDF graphs.
With "interaction" we mean the conditions under which the
combination is satisfiable, as well as the entailments defined for
the combination. The interaction between RIF and RDF and OWL is
realized by connecting the model theory of RIF (specified in [
RIF-BLD ]) with the model
theories of RDF (specified in [ RDF-Semantics ]) and OWL (specified in [ OWL-Semantics ]),
respectively.
The RDF semantics specification [ RDF-Semantics ] defines 4 notions of entailment for RDF graphs. At this stage it has not yet been decided which of these notions are of interest in RIF. Therefore, we specify the interaction between RIF and RDF for all 4 notions.
EDITOR'S NOTE: Currently, this document only defines how combinations of RIF rule sets and RDF/OWL should be interpreted; it does not suggest how references to RDF graphs are specified in RIF, nor does it specify which of the RDF entailment regimes (simple, RDF, RDFS, or D) should be used. Possible ways to refer to RDF graphs and RDFS/OWL ontologies include annotations in RIF rule sets and extensions of the syntax of RIF. Note that no agreement has yet been reached on this issue, and that especially the issue of the specification of entailment regimes is controversial (see http://lists.w3.org/Archives/Public/public-rif-wg/2007Jul/0030.html and the ensuing thread). See the Annotations page for a proposal for extending RIF with annotations.
The #Appendix: Embedding RDF Combinations describes how reasoning with combinations of RIF rules with RDF can be reduced to reasoning with RIF rule sets, which can be seen as a guide to describing how an RIF processor could be turned into an RDF-aware RIF processor. This reduction can be seen as a guide for interchange partners which do not have RDF-aware rule systems, but still want to be able to process RIF rules which refer to RDF graphs. In terms of the scenario above: if the interchange partner B does not have an RDF-aware rule system, but B can process RIF rules, then the appendix explains how the rule system could be used for processing combinations.
EDITOR'S NOTE: The future status of the appendix with the embedding is uncertain. The appendix is not about interchange, but rather about possible implementation, so it can be argued that it should not be included in this document. On the other hand, many think the appendix is useful. If we decide not to include it in this document, we might consider publishing it as a separate note (not recommendation-track document).
When speaking about RDF compatibility in RIF, we speak about RIF-RDF combinations, which are combinations of RIF rule sets and sets of RDF graphs. This section specifies how, in such a combination, the rule set and the graphs interact. In other words, how rules can "access" data in the RDF graphs and how additional conclusions which may be drawn from the RIF rules are reflected in the RDF graphs.
There is a correspondence between constant symbols in RIF rule sets and names in RDF graphs. The following table explains the correspondences of symbols.
RDF Symbol | Example | RIF Symbol | Example |
---|---|---|---|
Absolute IRI | <http://www.w3.org/2007/rif> | Absolute IRI | "http://www.w3.org/2007/rif"^^rif:iri |
Plain literal without a language tag | "literal string" | String in the symbol space xsd:string | "literal string"^^xsd:string |
Plain literal with a language tag | "literal string"@en | String plus language tag in the symbol space rif:text | "literal string@en"^^rif:text |
Literal with a datatype | "1"^^xsd:integer | Symbol in a symbol space | "1"^^xsd:integer |
There is, furthermore, a correspondence between statements in RDF graphs and certain kinds of formulas in RIF. Namely, there is a correspondence between RDF triples of the form s p o . and RIF frame formulas of the form s'[p' -> o'], where s', p', and o' are RIF symbols corresponding to the RDF symbols s, p, and o, respectively. This means that whenever a triple s p o . is satisfied, the corresponding RIF frame formula s'[p' -> o'] is satisfied, and vice versa.
Consider, for example, a combination of an RDF graph which contains the triples
john brotherOf jack . jack parentOf mary .
saying that john is a brother of jack and jack is a parent of mary, and an RIF rule set which contains the rule
Forall ?x, ?y, ?z (?x["uncleOf"^^rif:iri -> ?z] :- And( ?x["brotherOf"^^rif:iri -> ?y] ?y["parentOf"^^rif:iri -> ?z]))
which says that whenever some x is a brother of some y and y is a parent of some z, then x is an uncle of z. From this combination we can derive the RIF frame formula "john"^^rif:iri["uncleOf"^^rif:iri -> "mary"^^rif:iri], as well as the RDF triple john uncleOf marry.
Note that blank nodes cannot be referenced directly from RIF rules, since blank nodes are local to a specific RDF graph. Variables in RIF rules do, however, range over objects denoted by blank nodes. So, it is possible to "access" an object denoted by a blank node from an RIF rule using a variable in a rule.
Typed literals in RDF may be ill-typed, which means that the literal string is not part of the lexical space of the datatype under consideration. Examples of such ill-typed literals are "abc"^^xsd:integer, "2"^^xsd:boolean, and "<non-valid-XML"^^rdf:XMLLiteral. Rules which include ill-typed symbols are not well-formed RIF rules, so there are no RIF symbols which correspond to ill-typed literals. However, variables may quantify over such literals. The following example illustrates the interaction between RDF and RIF in the face of ill-typed literals and blank nodes.
Consider a combination of an RDF graph which contains the triple
_:x hasName "a"^^xsd:integer .
saying that there is some blank node which has a name, which is an ill-typed literal, and an RIF rule set which contains the rules
Forall ?x, ?y ( ?x[rdf:type -> "nameBearer"^^rif:iri] :- ?x["hasName"^^rif:iri -> ?y] ) Forall ?x, ?y ( "http://a"^^rif:iri["http://p"^^rif:iri -> ?y] :- ?x["hasName"^^rif:iri -> ?y] )
which say that whenever there is a some x which has some name y, then x is of type nameBearer and http://a has a property http://p with value y.
From this combination we can derive the RIF condition formulas
Exists ?z ( ?z[rdf:type -> "nameBearer"^^rif:iri] ) Exists ?z ( "http://a"^^rif:iri["http://p"^^rif:iri -> ?z] )
as well as the RDF triples
_:y rdf:type nameBearer . <http://a> <http://p> "a"^^xsd:integer .
However, "http://a"^^rif:iri["http://p"^^rif:iri -> "a"^^xsd:integer] cannot be derived, because it is not a well-formed RIF formula, due to the fact that "a" is not an integer; it is not in the lexical space of the datatype xsd:integer.
This remainder of this section formally defines combinations of RIF
rules with RDF graphs and the semantics of such combinations.
Combinations are pairs of RIF rule sets and sets of RDF graphs. The
semantics of combinations is defined in terms of combined models,
which are pairs of RIF and RDF interpretations. The interaction
between the two interpretations is defined through a number of
conditions. Entailment is defined as model inclusion, as usual.
This section first reviews the definitions of RDF vocabularies and RDF graphs, after which definitions related to datatypes and ill-typed literals are reviewed. Finally, RIF-RDF combinations are formally defined.
An RDF vocabulary V consists of the following sets of names:
The syntax of the names in these sets is defined in RDF Concepts and Abstract Syntax [ RDF-Concepts ]. Besides these names, there is an infinite set of blank nodes, which is disjoint from the sets of literals and IRIs.
(See the [ End note on generalized RDF graphs ])
Even though RDF allows the use of arbitrary datatype IRIs in typed literals, not all such datatype IRIs are recognized in the semantics. In fact, simple entailment does not recognize any datatype and RDF and RDFS entailment recognize only the datatype rdf:XMLLiteral. Furthermore, RDF allows expressing typed literals for which the literal string is not in the lexical space of the datatype; such literals are called ill-typed literals. RIF, in contrast, does not allow ill-typed literals in the syntax. To facilitate discussing datatypes, and specifically datatypes supported in specific contexts (required for D-entailment), we use the notion of datatype maps [ RDF-Semantics ].
A datatype map is a partial mapping from IRIs to datatypes.
RDFS, specifically D-entailment, allows the use of arbitrary datatype maps, as long as the rdf:XMLLiteral datatype is considered. RIF BLD additionally requires the following datatypes to be considered: xsd:long, xsd:string, xsd:integer, xsd:decimal, xsd:time, xsd:dateTime, and rif:text; we call these datatypes the RIF-required datatypes. We define the notion of a conforming datatype map as a datatype map which recognizes at least the RIF-required datatypes.
We now define the notions of well- and ill-typed literals, which loosely correspond to the notions of well-formed and ill-formed symbols in RIF.
Otherwise (s, d) is an ill-typed literal.
We now formally define combinations.
When clear from the context, RIF-RDF combinations are referred to simply as combinations.
The semantics of RIF rule sets and RDF graphs are defined in terms of model theories. The semantics of RIF-RDF combinations is defined through a combination of the two model theories, using a notion of common models. These models are then used to define satisfiability and entailment in the usual way. Combined entailment extends both entailment in RIF and entailment in RDF.
The RDF Semantics document [ RDF-Semantics ] defines 4 (normative) kinds of interpretations, as well as corresponding notions of satisfiability and entailment:
This distinction is reflected in the definitions of satisfaction and entailment in this section.
We define the notion of common interpretation, which is an interpretation of an RIF-RDF combination. This common interpretation is the basis for the definitions satisfaction and entailment in the following sections.
The correspondence between RIF semantic structures and RDF interpretations is defined through a number of conditions which ensure the correspondence in the interpretation of names (i.e., IRIs and literals) and formulas, i.e., the correspondence between RDF triples of the form s p o . and RIF frames of the form s'[p' -> o'], where s', p', and o' are RIF symbols corresponding to the RDF symbols s, p, and o, respectively.
We first review the notions of RDF interpretations and RIF semantic structures, after which we define common interpretations.
As defined in [ RDF-Semantics ], a simple interpretation of a vocabulary V is a tuple I=< IR, IP, IEXT, IS, IL, LV >, where
Rdf-, rdfs-, and D-interpretations are simple interpretations which satisfy certain conditions:
As defined in [ RIF-BLD ], a semantic structure is a tuple of the form I = <TV, DTS, D, IC, IV, IF, Iframe, ISF, Isub, Iisa, I=, ITruth>. We restrict our attention here to DTS, D, IC, IV, and Islot. The other mappings which are parts of a semantic structure are not used in the definition of combinations.
Condition 1 ensures that all resources in an RDF interpretation correspond to elements in the RIF domain. Condition 2 ensures that the set of properties at least includes all elements which are used as properties in the RIF domain. Condition 3 ensures that the combination of resources and properties corresponds exactly to the RIF domain; note that if I is an rdf-, rdfs-, or D-interpretation, IP is a subset of IR, and thus IR=D. Condition 4 ensures that all concrete values in D are included in LV. Condition 5 ensures that RDF triples are interpreted in the same way as frame formulas. Condition 6 ensures that IRIs are interpreted in the same way. Finally, condition 7 ensures that typed literals are interpreted in the same way. Note that no correspondences are defined for the mapping of names in RDF which are not symbols of RIF, e.g., ill-typed literals and RDF URI references which are not absolute IRIs. Condition 8 the ensures that typing in RDF and typing in RIF correspond, i.e. a rdf:type b is true iff a # b is true. Condition 9 the ensures that whenever an RIF subclass statement holds, the corresponding RDF subclass statement holds as well, i.e., a rdfs:subClassOf b is true if a ## b is true.
One consequence of conditions 6 and 7 is that IRIs of the form http://iri and typed literals of the form "http://iri"^^rif:iri which occur in an RDF graph are treated the same in RIF-RDF combinations, even if the RIF component is empty. For example, consider an RIF-RDF combination with an empty rule set and an RDF graph which contains the triple
<http://a> <http://p> "http://b"^^rif:iri .
This combination allows to derive, among other things, the following triples:
<http://a> <http://p> <http://b> . <http://a> "http://p"^^rif:iri "http://b"^^rif:iri . "http://a"^^rif:iri <http://p> "http://b"^^rif:iri .
as well as the following frame formula:
"http://a"^^rif:iri ["http://p"^^rif:iri -> "http://b"^^rif:iri]
We now define the notion of satisfiability for common interpretations, i.e., the conditions under which a common interpretation (I, I) is a model of a combination < R, S>. We define notions of satisfiability for all 4 entailment regimes of RDF (simple, RDF, RDFS, and D). The definitions are all analogous. Intuitively, a common interpretation (I, I) satisfies a combination < R, S> if I satisfies R and I satisfies S.
Notice that not every combination is satisfiable. In fact, not every RIF rule set has a model. For example, the rule set consisting of the rule
Forall ("1"^^xsd:integer="2"^^xsd:integer)
does not have a model, since the symbols "1"^^xsd:integer and "2"^^xsd:integer are mapped to the (distinct) numbers 1 and 2, respectively, in every semantic structure.
Rdf-, rdfs-, and D-satisfiability are defined through additional restrictions on I:
Using the notions of models defined above, entailment is defined in the usual way, i.e., through inclusion of sets of models.
The other notions of entailment are defined analogously:
Two kinds of combinations of RIF rules with OWL ontologies are considered. The combination of RIF rules with the Full species of OWL is a straightforward extension of RIF-RDF compatibility (see the definition below), in which RDF triples correspond to RIF frame formulas. The combination of RIF rules with the DL and Lite species of OWL is slightly different; OWL classes and properties correspond to RIF unary and binary predicates, respectively. The discrepancy between the two kinds of combinations is overcome by interpreting frame formulas as unary and binary predicates and imposing certain restrictions on the use of variables in the rules.
OWL [ OWL-Reference ] specifies three increasingly expressive species, namely Lite, DL, and Full.
OWL Lite is a syntactic subset of OWL DL, but the semantics is the same [ OWL-Semantics ]. Since every OWL Lite ontology is an OWL DL ontology, the Lite species is not explicitly considered in the remainder.
Syntactically speaking, OWL DL is a subset of OWL Full. The semantics of the DL and Full species are different, though [ OWL-Semantics ]. While OWL DL has an abstract syntax with a direct model-theoretic semantics, the semantics of OWL Full is an extension of the semantics of RDFS, and is defined on the RDF syntax of OWL. Consequently, the OWL Full semantics does not extend the OWL DL semantics; however, every OWL DL entailment is an OWL Full entailment.
Finally, the OWL DL RDF syntax does not extend the RDF syntax, but rather restricts it: every OWL DL ontology is an RDF graph, but not every RDF graph is an OWL DL ontology. OWL Full and RDF have the same syntax: every RDF graph is an OWL Full ontology and vice versa.
Note that the abstract syntax form of OWL DL allows so-called punning (this is not allowed in the RDF syntax), i.e., the same IRI may be used in an individual position, a property position, and a class position; the interpretation of the IRI depends on its context. Since combinations of RIF and OWL DL are based on the abstract syntax of OWL DL, punning may also be used in these combinations. This paves the way towards combination with OWL 1.1, which is envisioned to allow punning in all its syntaxes.
Since RDF graphs and OWL Full ontologies cannot be distinguished, we use the notion of RIF-RDF combinations for the syntax of combinations of RIF rule sets with OWL Full ontologies.
For the combination of RIF rule sets with OWL DL ontologies we define the notion of RIF-OWL DL combinations based on the abstract syntax of OWL DL. We need to furthermore impose certain restrictions on the syntax of the rules. Specifically, we can only allow constant symbols in class and property positions.
When clear from the context, RIF-OWL DL combinations are referred to simply as combinations.
The semantics of RIF-OWL Full combinations is a straightforward extension of the #Semantics of RIF-RDF Combinations.
The semantics of RIF-OWL DL combinations cannot straightforwardly extends the semantics of RIF RDF combinations, because OWL DL does not extend the RDF semantics. In order to keep the syntax of the rules uniform between RIF-Full and RIF-OWL DL combinations, the semantics of RIF frame formulas is slightly altered in RIF-OWL DL combinations.
The semantics of RIF-OWL Full combinations is a straightforward extension of the semantics of RIF-RDF combinations. It is based on the same notion of common interpretations, but defines additional notions of satisfiability and entailment.
The semantics of RIF-OWL DL combinations is similar in spirit to the semantics of RIF-RDF combinations. We define a notion of common interpretations, which are pairs of RIF and OWL DL interpretations, and define a number of conditions which relate these interpretations. In contrast to RIF-RDF combinations, the conditions below define a correspondence between the interpretation of OWL DL classes and properties and RIF unary and binary predicates.
It is now the case that elementary class and property statements in OWL DL of the forms A and P correspond to the unary and binary predicates expressions in RIF of the forms A(?x) and P(?x,?y), whereas elementary statements in OWL Full, which are triples, correspond to frame formulas in RIF, e.g., a class membership statement x rdf:type A corresponds to x[rdf:type -> A]. Therefore, rules which essentially express the same thing will look quite different, depending on whether they are used in OWL DL and OWL Full ontologies. For example, in an RIF-OWL DL combination, the uncle rule looks something like:
hasUncle(?x,?y) :- And(hasParent(?x,?y) hasBrother(?y,?z))
whereas, in an RIF-OWL Full combination, the rule will look something like:
?x[hasUncle -> ?y] :- And(?x[hasParent -> ?y] ?y[hasBrother -> ?z])
To overcome this problem we define a slightly modified semantics for RIF rules to enable the use of the latter kind of rules in RIF-OWL DL combinations. The modified semantics essentially corresponds to a rewriting of atomic formulas of the form x[rdf:type -> y] to y(x) and x[p -> y] to p(x, y).
We define a new truth valuation function for RIF formulas, which is the same as the truth valuation function defined in RIF-BLD, with the exception of frame formulas.
Condition 1 ensures that the domains of interpretation are the same. Condition 2 ensures that the set of literal values includes the value spaces of all considered datatypes. Condition 3 ensures that the interpretation (extension) of an OWL DL class u corresponds to the interpretation of the unary predicate with the same name in RIF. Condition 4 ensures that the interpretation (extension) of an OWL DL object or datatype property u corresponds to the interpretation of the binary predicates with the same name in RIF. Condition 5 ensures that typed literals of the form (s, d) in OWL DL are interpreted in the same way as constants of the form "s"^^d in RIF. Finally, condition 6 ensures that individual identifiers in the OWL ontologies and the RIF rule sets are interpreted in the same way.
Using the definition of common interpretation, satisfaction,
models, and entailment are defined in the usual way:
Note that the above definition of RIF-OWL DL compatibility does not consider ontology and annotation properties, in contrast to the definition of compatibility of RIF with OWL Full, where there is no clear distinction between annotation and ontology properties and other kinds of properties. Therefore, it is not possible to "access" or use the values of these properties in the RIF rules. This limitation is overcome in the following definition. It is envisioned that the user will choose whether annotation and ontology properties are to be considered. It is noted that it is envisioned that OWL 1.1 will not define a semantics for annotation and ontology properties; therefore, the below definition cannot be extended to the case of OWL 1.1.
Condition 7 ensures that the interpretation of all properties (also
annotation and ontology properties) in the OWL DL ontologies
corresponds with their interpretation in the RIF rules.
We illustrate the difference between the two kinds of OWL DL entailment using an example. Consider the following OWL DL ontology in abstract syntax form
Ontology (ex:myOntology Annotation(dc:title "Example ontology"))
which defines an ontology with a single annotation (title). Consider also a rule set which consists of the following rule:
Forall ?x, ?y ( ?x[ex:hasTitle -> ?y] :- ?x[dc:title -> ?y])
which says that whenever something has a dc:title, it has the same ex:hasTitle.
The combination of the ontology and the rule set OWL DL annotation entails the RIF condition formula ex:myOntology[ex:hasTitle -> "Example ontology"^^xsd:string]; the combination does not OWL DL entail the formula.
RIF-RDF combinations can be embedded into RIF Rule sets in a fairly straightforward way, thereby demonstrating how an RIF-compliant translator without native support for RDF can process RIF-RDF combinations.
For the embedding we use the concrete syntax of RIF and the N-Triples syntax for RDF.
Throughout this section the function tr is defined, which maps symbols, triples, and RDF graphs to RIF symbols, statements, and rule sets.
Given a combination C=< R,S>, the function tr maps RDF symbols of a vocabulary V and a set of blank nodes B to RIF symbols, as defined in following table.
RDF Symbol | RIF Symbol | Mapping |
---|---|---|
IRI i in VU | Constant with symbol space rif:iri | tr(i) = "i"^^rif:iri |
Blank node x<em> in <em>B<em></td> | Variable symbols ?<em>x | tr(x) = ?x |
Plain literal without a language tag xxx in VPL | Constant with the datatype xsd:string | tr("xxx") = "xxx"^^xsd:string |
Plain literal with a language tag (xxx,lang) in VPL | Constant with the datatype rif:text | tr("xxx"@lang) = "xxx@lang"^^rif:text |
Well-typed literal (s,u) in VTL | Constant with the symbol space u | tr("s"^^u) = "s"^^u |
Ill-typed literal (s,u) in VTL | Constant s^^u' with symbol space rif:local which is not used in C | tr("s"^^u) = "s^^u'"^^rif:local |
The embedding is not defined for combinations which include RDF graphs with RDF URI references which are not absolute IRIs.
The mapping function tr is extended to embed triples as RIF statements. Finally, two embedding functions, trR and trQ embed RDF graphs as RIF rule sets and conditions, respectively. The following section shows how these embeddings can be used for reasoning with combinations.
We define two mappings for RDF graphs, one (trR) in which variables are Skolemized, i.e. replaced with constant symbols, and one (trQ) in which variables are existentially quantified.
The function sk takes as arguments a formula R with variables, and returns a formula R', which is obtained from R by replacing every variable symbol ?x in R with "new-iri"^^rif:iri, where new-iri is a new globally unique IRI.
</table>
The following theorem shows how checking simple-entailment of combinations can be reduced to checking entailment of RIF conditions by using the embeddings of RDF graphs of the previous section.
Theorem A combination C=<R,{S1,...,Sn}> simple-entails a generalized RDF graph S iff (R union trR(S1) union ... union trR(Sn)) entails trQ(S). C simple-entails an RIF condition φ iff (R union trR(S1) union ... union trR(Sn)) entails φ.
The embeddings of RDF and RDFS entailment require a number of built-in predicate symbols to be available to appropriately deal with literals.
EDITORS NOTE: It is not yet clear which built-in predicates will be available in RIF. Therefore, the built-ins mentioned in this section may change. Furthermore, built-ins may be axiomatized if they are not provided by the language.
Given a vocabulary V,
We axiomatize the semantics of the RDF vocabulary using the following RIF rules and conditions.
The compact URIs used in the RIF rules in this section and the next are short for the complete URIs with the rif:iri datatype, e.g. rdf:type is short for "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"^^rif:iri
RDF Construct | RIF Construct | Mapping |
---|---|---|
Triple s p o . | Property frame tr(s)[tr(p) -> tr(o)] | tr(s p o .) = tr(s)[tr(p) -> tr(o)] |
Graph S | Rule set trR(S) | trR(S) = the set of all sk(Forall tr(s p o .)) such that s p o . is a triple in S |
Graph S | Condition (query) trQ(S) | trQ(S) = Exists tr(x1<tt>), ..., </tt>tr(xn<tt>) And(</tt>tr(t1<tt>) ... </tt>tr(tm<tt>))</tt>, where x1, ..., xn are the blank nodes occurring in S and t1, ..., tm are the triples in S |
RRDF | = | (Forall tr(s p o .)) for every <a
href="http://www.w3.org/TR/rdf-mt/#RDF_axiomatic_triples">RDF
axiomatic triple</a> s p o .) union(Forall ?x ?x[rdf:type -> rdf:Property] :- Exists ?y,?z (?y[?x -> ?z]),Forall ?x "1"^^xsd:integer="2"^^xsd:integer :- And(?x[rdf:type -> rdf:XMLLiteral] illxml(?x))) |
Theorem A combination <R,{S1,...,Sn}> is
rdf-satisfiable iff (RRDF union R union
trR(S1) union ... union trR(Sn)) has a
model.
Theorem A combination C=<R,{S1,...,Sn}> rdf-entails a generalized RDF graph T iff (RRDF union R union trR(S1) union ... union trR(Sn)) entails trQ(T). C simple-entails an RIF condition φ iff (RRDF union R union trR(S1) union ... union trR(Sn)) entails φ.
We axiomatize the semantics of the RDF(S) vocabulary using the following RIF rules and conditions.
RRDFS | = | RRDF union(Forall tr(s p o .)) for every <a href="http://www.w3.org/TR/rdf-mt/#RDFS_axiomatic_triples">RDFS axiomatic triple</a> s p o .) unionForall ?x "1"^^xsd:integer="2"^^xsd:integer :- And(?x[rdf:type -> rdfs:Literal] illxml(?x))) |
Theorem A combination <R1,{S1,...,Sn}> is
rdfs-satisfiable iff (RRDFS union R1
union trR(S1) union ... union trR(Sn)) has a
model.
Theorem A combination <R,{S1,...,Sn}> rdfs-entails generalized RDF graph T iff (RRDFS union R union trR(S1) union ... union trR(Sn)) entails trQ(T). C rdfs -entails an RIF condition φ iff (RRDFS union R union trR(S1) union ... union trR(Sn)) entails φ.
We axiomatize the semantics of the data types using the following RIF rules and conditions.
RD | = | RRDFS union(Forall u[rdf:type -> rdfs:Datatype] | for every IRI in the domain of D) unionForall ?x "1"^^xsd:integer="2"^^xsd:integer :- And(?x[rdf:type -> rdfs:Literal] illD(?x))`)) |
Theorem A combination <R,{S1,...,Sn}>, where R does not contain the equality symbol, is D-satisfiable iff (RD union R union trR(S1) union ... union trR(Sn)) is satisfiable and does not entail Exists ?x And(dt(?x,u) dt(?x,u')) for any two URIs u and u' in the domain of D such that the value spaces of D(u) and D(u') are disjoint, and does not entail Exists ?x dt(s^^u,"u'"^^rif:iri) for any (s, u) in VTL and u' in the domain of D such that s is not in the lexical space of D(u').
EDITOR'S NOTE: Since this condition is very complex we might consider discarding this theorem, and suggest the above set of rules (RD) as an approximation of the semantics.
Theorem A D-satisfiable combination <R,{S1,...,Sn}>,
where R does not contain the equality symbol, D-entails a
generalized RDF graphs T iff (RD union R union
trR(S1) union ... union trR(Sn)) entails
trQ(T). C D-entails an RIF condition φ iff
(RD union R union trR(S1) union ...
union trR(Sn)) entails φ.
EDITOR'S NOTE: The restriction to equality-free rule sets is necessary because D-interpretations impose stronger conditions on the interpretation of typed literals in case different datatype URIs are equal than RIF does.
RDF URI References: There are certain RDF URI references which are not absolute IRIs (e.g. those containing spaces). It is possible to use such RDF URI references in RDF graphs which are combined with RIF rules. However, such URI references cannot be represented in RIF rules and their use in RDF is discouraged.
Generalized RDF graphs: Standard RDF graphs, as defined in [ RDF-Concepts ], do not allow the use of literals in subject and predicate positions and blank nodes in predicate positions. The RDF Core working group has listed two issues questioning the restrictions that literals may not occur in subject and blank nodes may not occur in predicate positions in triples. Anticipating lifting of these restrictions in a possible future version of RDF, we use the more liberal notion of generalized RDF graph. We note that the definitions of interpretations, models, and entailment in the RDF semantics document [ RDF-Semantics ] also apply to such generalized RDF graphs.
We note that every standard RDF graph is a generalized RDF graph. Therefore, our definition of combinations applies to standard RDF graphs as well. We note also that the notion of generalized RDF graphs is more liberal than the notion of RDF graphs used by SPARQL; generalized RDF graphs additionally allow blank nodes and literals in predicate positions.