Copyright © 2007 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
Rules interchanged using the Rule Interchange Format RIF may depend on or used in combination with RDF data and/or RDF Schema or OWL data models. This document, developed by the Rule Interchange Format (RIF) Working Group, specifies compatibility of RIF with the Semantic Web languages RDF and RDFS. A future version will address compatibility with OWL.
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/.
Working Group participants please send comments as soon as possible, for a 30 October publication decision.
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.
(Editor's Note: This text is maintained on wiki page Overview of RDF and OWL Compatibility).
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 ontologies are interpreted, specifically how the RIF BLD and RDF(S) semantics interact. A future version of this document will address combination with OWL ontologies.
This document does not, as yet, whether or how address 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 interchange choosing routes, but using some other (out of bounds) mechanism.
The RIF working group plans to develop further dialects besides BLD, for example, a dialect based on Production Rules; 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].
Both RDF data and RDFS 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 which can be used for representing RDF graphs.
A typical scenario for the use of RIF with RDF includes the exchange of rules which either use RDF data, or which use an RDFS ontology. In terms of rule interchange the scenario is the following: interchange partner A has a rules language which is RDF-aware, i.e. it allows to use RDF data, its uses an RDFS ontology, or it extends RDF(S). A sends its rules (using RIF), 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-aware. The use case Vocabulary Mapping for Data Integration [RIF-UCR] is an example of the interchange of RIF rules related to 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.
Future versions of this document are expected to address the use case Interchanging Rule Extensions to OWL [RIF-UCR].
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, and the entailments defined for the combination. The interaction between RIF and RDF is realized by connecting the model theories of RIF (specified in [RIF-BLD]) and RDF (specified in [RDF-Semantics]).
[RDF-Semantics] specifies 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.
*** Currently, this document only defines how combinations of RIF rule sets and RDF graphs 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. A possible way to refer to RDF graphs and RDFS/OWL ontologies is through metadata in RIF rule sets. 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). *** |
In the Appendix: Embeddings we describe how reasoning with combinations of RIF rules with RDF graphs 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.
*** The status of the appendix with the embedding is currently unclear. 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. If we decide not to include it in this document, we might consider publishing it as a separate note (not recommendation-track document). *** |
(Editor's Note: This text is maintained on wiki page RDF Compatibility).
When speaking about RDF compatibility in RIF, we speak about RIF-RDF combinations, which are combinations of RIF rule sets and 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.
First of all, 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 with the symbol space xsd:string | "literal string"^^xsd:string |
Plain literal with a language tag | "literal string"@en | String plus language tag with 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, but not a blank node itself.
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 both 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 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.
This remainder of this section formally defines combinations of RIF rules with RDF graphs, as well as the semantics of these 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.
(Editor's Note: This text is maintained on wiki page Syntax).
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, a formal definition of RIF-RDF combinations is given.
An RDF vocabulary V consists of sets of names:
absolute IRIs VU, (correspond to the Concepts and Abstract Syntax term "RDF URI reference"; see End note on RDF URI references)
plain literals VPL (i.e. character strings with an optional language tag), and
typed literals VTL (i.e. pairs of character strings and datatype IRIs).
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, which may be used in RDF graphs.
Given an RDF vocabulary V and a set of blank nodes B, a generalized RDF graph of V is a set of generalized RDF triples s p o ., where s, p and o are blank nodes, IRIs, or plain or typed literals. (See End note on generalized RDF graphs)
*** Note that our notion of generalized RDF graphs is more liberal than the notion of RDF graphs used by SPARQL; we additionally allow blank nodes and literals in predicate positions. *** |
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 datatype rdf:XMLLiteral. Furthermore, RDF allows to express typed literals such that the literal string is not in the lexical space of the datatype; such literals are called ill-typed literals. RIF, on the contrary, recognizes a number of different data types, and does not allow ill-typed literals in the syntax. To facilitate discussing datatypes, and specifically supported datatypes in a context, we use the notion of datatype maps.
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, in contrast, has a fixed list of datatypes. We define the notion of a conforming datatype map as a datatype map which recognizes those datatypes in this fixed list of types in RIF BLD, but which may go beyond this list. Thereby, RIF-RDF combinations may extend the datatype support in RIF.
A datatype map D is a conforming datatype map if it satisfies the following conditions:
No RIF-supported symbol space which is not an RIF-supported primitive data type (i.e. rif:local and rif:iri in RIF BLD) is in the domain of D.
The IRIs identifying all RIF-supported primitive datatypes are in the domain of D. For RIF BLD, these IRIs are: xsd:long, xsd:string, xsd:integer, xsd:decimal, xsd:time, xsd:dateTime, rdf:XMLLiteral, and rif:text.
D maps IRIs identifying XML schema datatypes to the respective data types, rdf:XMLLiteral to the rdf:XMLLiteral datatype, and rif:text to the rif:text primitive datatype.
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.
Given a conforming datatype map D, a typed literal (s, d) is a well-typed literal if
d is in the domain of D and s is in the lexical space of D(d),
d is the IRI of a symbol space supported by RIF BLD and s is in the lexical space of the symbol space, or
d is not in the domain of D and does not identify a symbol space supported by RIF.
Otherwise (s, d) is an ill-typed literal. (See End note on well-typed literals)
*** The value space of RDF plain literals without language tags consists of all Unicode strings. Both in the current specification of XML schema datatypes and in the current working draft of XML schema 1.1 data types the value space of the string datatype is restricted to the sequences of Unicode characters excluding the surrogate blocks, FFFE, and FFFF; these characters are not actual Unicode characters, but rather reserved codes in UTF-16 encoding. There are some further differences between the specification of the string datatype in XML schema 1.0 and XML schema 1.1; in the former case, the datatype is based on the Char production in XML 1.0; in the latter case, the datatype is based on the Char production in XML 1.1; so, the string datatype in 1.1 is a superset of the string datatype in 1.0. All in all, it appears that the value space of the string datatype in XML Schema 1.1 is a superset of the value space of the RDF plain literals without language tags, but there are RDF plain literals which are not strings in XML Schema 1.0. So, if RIF uses the XML Schema 1.0 data types, then we have an issue here. See also http://lists.w3.org/Archives/Public/public-rif-wg/2007Sep/0002.html and the subsequent messages in the thread. *** |
*** The correspondence between ill-typed literals and IRIs of a specific form has been removed. It is now no longer possible to name ill-typed literals in the RIF rules. *** |
We can now formally define combinations.
An RIF-RDF combination is a tuple C=< R,S>, where R is a Rule set and S is a set of generalized RDF graphs of a vocabulary V. When clear from the context, RIF-RDF combinations are referred to simply as combinations.
(Editor's Note: This text is maintained on wiki page Semantics).
The semantics of both RIF and RDF is defined in terms of a model-theoretic semantics. Hence, the semantics of combinations is defined through a combination of the two semantics, in terms of common models. These models are then used to define entailment in the usual way. Combined entailment extends of entailment in RIF and entailment in RDF.
The RDF Semantics document [RDF-Semantics] defines 4 (normative) kinds of interpretations: simple interpretations (which do not pose any conditions on the RDF and RDFS vocabularies), RDF interpretations (which impose additional conditions on the RDF vocabulary), RDFS interpretations (which impose additional conditions on the RDFS vocabulary), and D-interpretations (which impose additional conditions on the treatment of datatypes, relative to a datatype map D). 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 both an RIF rule set and an RDF graph. 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.
As defined in [RDF-Semantics], a simple interpretation of a vocabulary V is a tuple I=< IR,IP,IEXT,IS,IL,LV >, where
IS is a mapping from IRIs in V into (IR union IP),
IL is a mapping from typed literals in V into IR, and
LV is the set of literal values, which is a subset of IR, and includes all plain literals in V.
Rdf-, rdfs-, and D-interpretations are simple interpretations which satisfy certain conditions:
A simple interpretation I of a vocabulary V is an rdf-interpretation if V includes the RDF vocabulary and the conditions on rdf-interpretations described in [RDF-Semantics] hold for I.
An rdf-interpretation I of a vocabulary V is an rdfs-interpretation if V includes the RDFS vocabulary and the conditions on rdfs-interpretations described in [RDF-Semantics] hold for I.
Given a datatype map D, an rdfs-interpretation I of a vocabulary V is a D-interpretation if V includes the IRIs in the domain of D and the conditions on each of the <IRI, datatype> pairs in D described in [RDF-Semantics] hold in I.
As defined in [RIF-BLD], a semantic structure is a tuple of the form I = <D,IC, IV, IF, IR, Islot, ISF, ISR, Isub, Iisa>. We restrict our attention here to D, IC, IV, and Islot. The other mappings which are parts of a semantic structure are not used in the definition of combinations.
D is a non-empty set (the domain),
IC is a mapping from Const to D,
IV is a mapping from Var to D, and
Islot is a mapping from D to truth-valued functions of the form D × D → TV.
Note that, in RIF, given a conforming datatype map D, the value spaces of all datatypes in the range of D are subsets of D.
A common interpretation is a pair (I, I), where I = <D,IC, IV, IF, IR, Islot, ISF, ISR, Isub, Iisa> is an RIF semantic structure and I=<IR, IP, IEXT, IS, IL, LV> is an RDF interpretation of a vocabulary V, such that the following conditions hold:
IR is a subset of D;
IP is a superset of the set of all k in D such that there exist a, b in D and Islot(k)(a,b)=t (i.e. the truth value of Islot(k)(a,b) is true);
(IR union IP) = D;
LV is a subset of IR and a superset of (D intersection (union of all value spaces of the primitive datatypes supported by RIF BLD));
IEXT(k) = the set of all pairs (a, b), with a, b in D, such that Islot(k)(a,b)=t, for every k in D;
IS(i) = IC("i"^^rif:iri) for every absolute IRI i in VU;
IL((s, d)) = IC("s"^^d) for every well-typed literal (s, d) in VTL.
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- or rdfs-interpretation, IP is a subset of IR, and thus IR=D. Condition 4 ensures that all literal values in D are included in LV. Condition 5 ensures that RDF triples are interpreted in the same way as properties frames. 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.
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 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 sets and an RDF graph which contains the triple
<http://a> <http://p> "http://b"^^rif:iri .
This combination allows to derive, among others, 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]
RIF includes two specific kinds of formulas for expressing class membership and subclassing. We note that the inclusion of such formulas in RIF BLD is currently under debate, see http://www.w3.org/2005/rules/wg/track/issues/41
If the working group decides to include such formulas in RIF BLD, the following two conditions should be added to connect typing and subclassing in RIF with the corresponding constructs in RDF:
IEXT(IS(rdf:type)) is equal to the set of all pairs <a,b> in D × D such that Iisa(< a,b >)=t; and
IEXT(IS(rdfs:subClassOf)) is equal to the set of all pairs <a,b> in D × D such that Isub(< a,b >)=t.
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 subclassing in RDFS and subclassing in RIF correspond, i.e. a rdfs:subClassOf b . is true iff a ## b is true.
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 C=< 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 C=< R,S> if I satisfies R and I satisfies S.
A common interpretation (I, I) simple-satisfies an RIF-RDF combination C=< R,S> if I satisfies R and I satisfies every RDF graph S in S; in this case (I, I) is called a simple model, or model, of C, and C is satisfiable. (I, I) satisfies an RDF graph S if I satisfies S.(I, I) satisfies an RIF condition formula φ if Itruth(φ),,=t.
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.
Rdf-, rdfs-, and D-satisfiability are defined through additional restrictions on I:
A model (I, I) of C rdf-satisfies C if I is an rdf-interpretation; in this case (I, I) is called an rdf-model of C, and C is rdf-satisfiable.
A model (I, I) of C rdfs-satisfies C if I is an rdfs-interpretation; in this case (I, I) is called an rdfs-model of C, and C is rdfs-satisfiable.
Given a conforming datatype map D, a model (I, I) of C D-satisfies C if I is a D-interpretation; in this case (I, I) is called a D-model of C, and C is D-satisfiable.
Using the notions of models defined above, we define entailment in the usual way, i.e. through inclusion of sets of models.
A combination C D-entails an RDF graph S if every D-model of C satisfies S. Likewise, C D-entails a closed RIF condition formula φ if every D-model of C satisfies φ.
The other notions of entailment are defined analogously:
A combination C simple-entails S (resp., φ) if every simple model of C satisfies S (resp., φ).
A combination C rdf-entails S (resp., φ) if every rdf-model of C satisfies S (resp., φ).
A combination C rdfs-entails S (resp., φ) if every rdfs-model of C satisfies S (resp., φ).
(Editor's Note: This text is maintained on wiki page References).
Resource Description Framework (RDF): Concepts and Abstract Syntax, G. Klyne, J. Carroll (Editors), W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/. Latest version available at http://www.w3.org/TR/rdf-concepts/.
RDF Semantics, P. Hayes, Editor, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-mt-20040210/. Latest version available at http://www.w3.org/TR/rdf-mt/.
RIF Basic Logic Dialect, H. Boley, M. Kifer (Editors), W3C Editor's Draft, http://www.w3.org/2005/rules/wg/bld/draft-2007-10-19.html. Latest version available at http://www.w3.org/2005/rules/wg/wiki/Core.
RDF Vocabulary Description Language 1.0: RDF Schema, D. Brickley, R.V. Guha, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-schema-20040210/. Latest version available at http://www.w3.org/TR/rdf-schema/.
RDF/XML Syntax Specification (Revised), D. Beckett, Editor, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/. Latest version available at http://www.w3.org/TR/rdf-syntax-grammar/.
RFC 3066 - Tags for the Identification of Languages, H. Alvestrand, IETF, January 2001. This document is http://www.isi.edu/in-notes/rfc3066.txt.
RIF Use Cases and Requirements, A. Ginsberg, D. Hirtle, F. McCabe, P.-L. Patranjan (Editors), W3C Working Draft, 10 July 2006, http://www.w3.org/TR/2006/WD-rif-ucr-20060710/. Latest version available at http://www.w3.org/TR/rif-ucr.
OWL Web Ontology Language Reference, M. Dean, G. Schreiber, Editors, W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-owl-ref-20040210/. Latest version available at http://www.w3.org/TR/owl-ref/.
XML Schema Part 2: Datatypes, W3C Recommendation, World Wide Web Consortium, 2 May 2001. This version is http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/. Latest version available at http://www.w3.org/TR/xmlschema-2/.
(Editor's Note: This text is maintained on wiki page Appendix: Embeddings).
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 in B | Variable symbols ?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.
*** alternatively, sk could be defined to replace variables with new globally unique constants with the datatype rif:bNode, as proposed by DaveReynolds. However, as this embedding is only used for reasoning, I (JosDeBruijn) don't think this is necessary. This datatype might be necessary for the exchange of RDF rule languages; see the corresponding preliminary section in the architecture document. *** |
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), ..., tr(xn) And(tr(t1) ... tr(tm)), where x1, ..., xn are the blank nodes occurring in S and t1, ..., tm are the triples in S |
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.
*** Alternatively, these predicates might be axiomatized. To built-ins required will be updated as the definition of built-ins in RIF BLD evolves. *** |
Given a vocabulary V,
the unary predicate wellxmlV/1 is interpreted as the set of XML values,
the unary predicate illxmlV/1 is interpreted as the set of objects corresponding to ill-typed XML literals in VTL, and
the unary predicate illDV/1 is interpreted as the set of objects corresponding to ill-typed literals in VTL, and
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
RRDF | = | (Forall tr(s p o .)) for every RDF axiomatic triple s p o .) union (Forall ?x ?x[rdf:type -> rdf:Property] :- Exists ?y,?z (?y[?x -> ?z]), Forall ?x ?x[rdf:type -> rdf:XMLLiteral] :- wellxml(?x), Forall ?x "1"^^xsd:integer="2"^^xsd:integer :- And(?x[rdf:type -> rdf:XMLLiteral] illxml(?x))) |
*** The last rule in RRDF will cause an inconsistency whenever there is an ill typed XML literal which is of type rdf:XMLLiteral ("1"xsd:integer="2"xsd:integer is not true in every RIF BLD model). *** |
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 RDFS axiomatic triple s p o .) union (Forall ?x ?x[rdf:type -> rdfs:Resource], Forall ?u,?v,?x,?y ?u[rdf:type -> ?y] :- And(?x[rdfs:domain -> ?y] ?u[?x -> ?v]), Forall ?u,?v,?x,?y ?v[rdf:type -> ?y] :- And(?x[rdfs:range -> ?y] ?u[?x -> ?v]), Forall ?x ?x[rdfs:subPropertyOf -> ?x] :- ?x[rdf:type -> rdf:Property], Forall ?x,?y,?z ?x[rdfs:subPropertyOf -> ?z] :- And (?x[rdfs:subPropertyOf -> ?y] ?y[rdfs:subPropertyOf -> ?z]), Forall ?x,?y,?z1,?z2 ?z1[y -> ?z2] :- And (?x[rdfs:subPropertyOf -> ?y] ?z1[x -> ?z2]), Forall ?x ?x[rdfs:subClassOf -> rdfs:Resource] :- ?x[rdf:type -> rdfs:Class], Forall ?x,?y,?z ?z[rdf:type -> ?y] :- And (?x[rdfs:subClassOf -> ?y] ?z[rdf:type -> ?x]), Forall ?x ?x[rdfs:subClassOf -> ?x] :- ?x[rdf:type -> rdfs:Class], Forall ?x,?y,?z ?x[rdfs:subClassOf -> ?z] :- And (?x[rdfs:subClassOf -> ?y] ?y[rdfs:subClassOf -> ?z]), Forall ?x ?x[rdfs:subPropertyOf -> rdfs:member] :- ?x[rdf:type -> rdfs:ContainerMembershipProperty], Forall ?x ?x[rdfs:subClassOf -> rdfs:Literal] :- ?x[rdf:type -> rdfs:Datatype], Forall ?x ?x[rdf:type -> rdfs:Literal] :- lit(?x), Forall ?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) union (Forall "s"^^u[rdf:type -> "u"^^rif:iri] | for every well-typed literal (s , u ) in VTL) union (Forall ?x, ?y dt(?x,?y) :- And(?x[rdf:type -> ?y] ?y[rdf:type -> rdfs:Datatype]), Forall ?x "1"^^xsd:integer="2"^^xsd:integer :- And(?x[rdf:type -> rdfs:Literal] illD(?x))`)) |
***Note that the existence of certain built-ins corresponding to data types (e.g. a built-in string/1 which is always interpreted as the set of xsd:strings) would simplify the axiomatization. *** |
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').
*** Since this condition is very complex we might want to leave out 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 φ.
*** 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. *** |
(Editor's Note: This text is maintained on wiki page End Notes).
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.
Well-typed literals: The notion of well-typed literal is stricter than the notion of well-formed constant symbols in RIF, since it considers all datatypes in some conforming datatype map D, whereas the notion of well formed constant symbol only considers symbols in the set of RIF-supported symbol spaces.
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.