W3C


RIF RDF and OWL Compatibility

W3C Editor's Draft 18 May09 June 2008

This version:
http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20080518/http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20080609/
Latest editor's draft:
http://www.w3.org/2005/rules/wg/draft/rif-rdf-owl/
Previous version:
http://www.w3.org/TR/2008/WD-rif-rdf-owl-20080415/http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20080518/ (color-coded diff)
Editors:
Jos de Bruijn, Free University of Bozen/Bolzano


Abstract

Rules interchanged using the Rule Interchange Format RIF may depend on or be used in combination with RDF data and RDF Schema or OWL data models (ontologies). This document, developed by the Rule Interchange Format (RIF) Working Group, specifies the interoperation between RIF and the data and ontology languages RDF, RDFS,RDF Schema, and OWL.

Status of this Document

May Be Superseded

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 56 documents:

  1. RIF Use Cases and Requirements
  2. RIF Basic Logic Dialect
  3. RIF Framework for Logic Dialects
  4. RIF RDF and OWL Compatibility (this document)
  5. RIF Production Rule Dialect
  6. RIF Data Types and Built-Ins

RIF Use Cases and RequirementsPlease Comment By 2008-05-252008-06-13

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. You may also wish to check the Wiki Version of this document for internal-review comments and changes being drafted which may address your concerns.

No Endorsement

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.

Patents

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

1 Overview of RDF and OWL Compatibility

The Rule Interchange Format (RIF), specifically the(RIF) Basic Logic Dialect (BLD) (RIF-BLD ),) is a format for interchanging logical rules over the Web. Rules that are exchanged using RIF may refer to external data sources and may be based on data models that 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 OWL Web Ontology Language (OWL-Reference) are Web-based languages for representing and exchanging ontologies (i.e., data models). This document specifies how combinations of RIF BLD Rulesetsdocuments and RDF data and RDFS and OWL ontologies are interpreted; i.e., it specifies how RIF interoperates with RDF/OWL.

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 may address compatibility of these dialects with RDF and OWL as well.OWL. In the remainder of this document,remainder, RIF is understood to refer to 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). RIF does not provide a format for exchanging RDF graphs, since this would be a duplication. 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.

A typical scenario for the use of RIF with RDF/OWL is the exchange of rules that eitheruse RDF data or an RDFS or OWL ontology: an interchange partner A has a rules language that is RDF/OWL-aware, i.e., it supports the use of RDF data, it uses an RDFS or OWL ontology, or it extends RDF(S)/OWL. A sends its rules using RIF, possibly with references to the appropriate RDF graph(s), to partner B. B receives the rules and retrieves the referenced RDF graph(s) (published as, e.g., RDF/XML (RDF-SYNTAX)). The rules are translated to the internal rules language of B and are processed, together with the RDF graphs, using the RDF/OWL-aware rule engine of B. The use case Vocabulary Mapping for Data Integration (RIF-UCR) is an example of the interchange of RIF rules that use RDF data and RDFS ontologies.

A specialization of this scenario is the publication of RIF rules that refer to RDF graphs:graphs; publication is a special kind of interchange: one to many, rather than one-to-one. When a rule publisher A publishes its rules on the Web, it is hoped that there are several consumers that retrieve the RIF rules and RDF graphs from the Web, translate the RIF rules to their own rules language, and process them together with the RDF graphs in their own rules engine. The use case Publishing Rules for Interlinked Metadata (RIF-UCR) illustrates the publication scenario.

Another specialization of the exchange scenario 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 a RIF ruleset,document, publishes the OWL ontology, and sends (or publishes) the RIF ruleset,document, which includes a reference to the OWL ontology. A consumer of the rules retrieves the OWL ontology and translates the ontology and rulesetdocument into a combined ontology+rules description in its own rule extension of OWL.


A RIF rulesetdocument that refers to (imports) RDF graphs and/or RDFS/OWL ontologies, or any use of a RIF rulesetdocument with RDF graphs, is viewed as a combination of a rulesetdocument and a number of graphs and ontologies. This document specifies how, in such a combination, the rulesetdocument and the graphs and ontologies interoperate in a technical sense, i.e., the conditions under which the combination is satisfiable (i.e., consistent), as well as the entailments (i.e., logical consequences) of the combination. The interaction between RIF and RDF/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.


Throughout this documentThe following conventions are used when writing RIFnotation of certain symbols, particularly IRIs and RDF statementsplain literals, in examples and definitions.RIF constantsis slightly different from the notation in RDF/OWL. This difference is illustrated in the symbol space rif:iri , i.e., constants that are absolute IRIs, are abbreviated. Specifically, constants ofSection Symbols in RIF Versus RDF/OWL.

The form " absolute-IRI "^^rif:iri are written as compact IRIsRDF semantics specification ( CURIE ), i.e., as prefix : localname , where prefix is understood to refer to an IRI namespace-IRI , and prefix : localname standsRDF-Semantics) defines four notions of entailment for RDF graphs. The IRIOWL semantics specification ( absolute-IRIOWL-Semantics) obtained by concatenating namespace-IRIdefines two notions of entailment for OWL ontologies, namely OWL Lite/DL and localname . RDF triples are written usingOWL Full. This document specifies the Turtle syntax ( Turtle ):interaction between RIF and RDF/OWL for all six notions. The purposesSection RDF Compatibility is concerned with the combination of this document, triples are written as s p o , where s, p, o are IRIs delimited with ' < 'RIF and ' > ', compact IRIs prefix : localname , or typed literals "literal" ^^ datatype-IRI . The following namespace prefixes are used throughout this document: ex refers to the example namespace http://example.org/example# , xsd refers to the XML schema namespace http://www.w3.org/2001/XMLSchema# , rdf refers toRDF/RDFS. The RDF namespace http://www.w3.org/1999/02/22-rdf-syntax-ns# , rdfs refers to the RDFS namespace http://www.w3.org/2000/01/rdf-schema# ,combination of RIF and OWL refers tois addressed in the Section OWL namespace http://www.w3.org/2002/07/owl# , and rif refers to the RIF namespace http://www.w3.org/2007/rif#Compatibility. The RDF semantics specification ( RDF-Semantics ) defines four notions of entailment for RDF graphs. The OWLsemantics specification ( OWL-Semantics ) defines two notionsof entailment for OWL ontologies, namely OWL Lite/DL and OWL Full. This document specifiesthe interaction between RIF and RDF/OWL for all six notions.OWL DL is close in spirit to (SWRL).

RIF provides a mechanism for referring to (importing) RDF graphs and a means for specifying the context of this import, which corresponds to the intended entailment regime. The Section Importing RDF Graphs in RIF specifies how such import statements are used for representing RIF-RDF and RIF-OWL combinations.

The Appendix: Embeddings (Informative) describes how reasoning with combinations of RIF rules with RDF and a subset of OWL DL can be reduced to reasoning with RIF rulesets,documents, which can be seen as a guide to describing how a RIF processor could be turned into an RDF/OWL-aware RIF processor. This reduction can be seen as a guide for interchange partners that do not have RDF-aware rule systems, but want to be able to process RIF rules that refer to RDF graphs. In terms of the aforementioned scenario: if the interchange partner B does not have an RDF/OWL-aware rule system, but B can process RIF rules, then the appendix explains how B's rule system could be used for processing RIF-RDF.

2 RDF CompatibilityThroughout this section specifies how adocument the following conventions are used when writing RIF ruleset interacts with a set ofand RDF graphs in a RIF-RDF combination. In other words, how rules can "access" datastatements in the RDF graphsexamples and how additional conclusions that may be drawn from thedefinitions.

2 Symbols in RIF Versus RDF/OWL (Informative)

Where RDF/OWL has four kinds of constants: URI references (i.e., IRIs), plain literalliterals without language tag "literal string" String in the symbol space xsd:string "literal string"^^xsd:stringtags, plain literalliterals with language tag "literal string"@en String plus language tag in the symbol space rif:text "literal string@en"^^rif:text Literaltags and typed literals (i.e., Unicode sequences with datatype "1"^^xsd:integer Symbol inIRIs) (RDF-Concepts), RIF has one kind of constants: Unicode sequences with symbol space "1"^^xsd:integer There is, furthermore, a correspondence between statements in RDF graphs and certain kindsIRIs (DTB).

Symbol spaces can be seen as groups of formulas in RIF. Namely, thereconstants. Every datatype is a correspondence between RDF triples ofsymbol space, but there are symbol spaces that are not datatypes. For example, the form s p osymbol space rif:iri groups all IRIs. The shortcut syntax for IRIs and RIF frame formulasstrings (RIF-DTB), used throughout this document, corresponds with the syntax for IRIs and plain literals in (Turtle).

saying that ex:john is a brother of ex:jackThe correspondence between constant symbols in RDF graphs and ex:jackRIF documents is a parent of ex:mary ,explained in Table 1.

Table 1. Correspondence between RDF and RIF symbols.
RDF Symbol Example RIF Symbol Example
IRI <http://www.w3.org/2007/rif> IRI <http://www.w3.org/2007/rif>
Plain literal without language tag "literal string" String "literal string"
Plain literal with language tag "literal string"@en String plus language tag in symbol space rif:text "literal string@en"^^rif:text
Constant "1"^^xs:integer Symbol in symbol space "1"^^xs:integer

RIF does not have a notion corresponding to RDF blank nodes. RIF ruleset that contains the rule Forall ?x, ?y, ?z (?x[ex:uncleOf -> ?z] :- And(?x[ex:brotherOf -> ?y] ?y[ex:parentOf -> ?z])) which says that wheneverlocal symbols, written _symbolname, have some x is a brothercommonality with blank nodes; like the blank node label, the name of some y and y isa parentlocal symbol is not exposed outside of some z , then x is an uncle of z . From this combination the RIF frame formula :john[:uncleOf -> :mary] , as well asthe RDF triple :john :uncleOf :mary , can be derived. Note that blank nodes cannot be referenced directly from RIF rules, sincedocument. However, in contrast to blank nodesnodes, which are essentially existentially quantified variables, RIF local to a specific RDF graph.symbols are constant symbols. Finally, variables in the bodies of RIF rules do, however, range over objects denoted by blank nodes. So, it is possiblemay be existentially quantified, and are thus similar to "access" an object denoted by ablank node from anodes; however, RIF BLD does not allow existentially quantified variables to occur in rule usingheads.

3 RDF Compatibility

This section specifies how a variableRIF document interacts with a set of RDF graphs in a rule. Typed literalsRIF-RDF combination. In other words, how rules can "access" data in the RDF graphs and how additional conclusions that may be ill-typed , which means thatdrawn from the literal stringRIF rules are reflected in the RDF graphs.

There is not parta correspondence between statements in RDF graphs and certain kinds of the lexical spaceformulas in RIF. Namely, there is a correspondence between RDF triples of the datatype under consideration. Examplesform s p o and RIF frame formulas of such ill-typed literals are "abc"^^xsd:integerthe form s'[p' -> o'], where s', "2"^^xsd:booleanp', and "<non-valid-XML"^^rdf:XMLLiteral . Ill-typed literalso' are not expectedRIF symbols corresponding to be used very often. However, asthe RDF recommendation ( RDF-Concepts ) allows creating RDF graphs with ill-typed literals, their occurrence cannot be completely ruled out. Rules that include ill-typed symbols are not legal RIF rules, so there are no RIFsymbols that correspond to ill-typed literals. As withs, 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 that contains the triples

ex:john ex:brotherOf ex:jack . 
ex:jack ex:parentOf ex:mary . 

saying that ex:john is a brother of ex:jack and ex:jack is a parent of ex:mary, and a RIF document that contains the rule

Forall ?x, ?y, ?z (?x[ex:uncleOf -> ?z] :- 
     And(?x[ex:brotherOf -> ?y] ?y[ex:parentOf -> ?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 the RIF frame formula :john[:uncleOf -> :mary], as well as the RDF triple :john :uncleOf :mary, can be derived.

Note that blank nodes,nodes cannot be referenced directly from RIF rules, since blank nodes are local to a specific RDF graph. Variables doin RIF rules do, however, range over objects denoted by such literals.blank nodes. So, it is possible to "access" an object denoted by a blank node from a RIF rule using a variable in a rule.

The following example illustrates the interaction between RDF and RIF in the face of ill-typed literals andblank nodes.

Consider a combination of an RDF graph that contains the triple

_:x ex:hasName  "a"^^xsd:integer"John" . 

saying that there is some blank node that has a name, which is an ill-typed literal,the name "John", and a RIF rulesetdocument that contains the rules

Forall ?x, ?y ( ?x[rdf:type -> ex:nameBearer] :- ?x[ex:hasName -> ?y] )
Forall ?x, ?y (  "http://a"^^rif:iri["http://p"^^rif:iri<http://a>[<http://p> -> ?y] :- ?x[ex:hasName -> ?y] )

which say that whenever there is some x that has some name y, then x is of type ex:nameBearer and http://a has a property http://p with value y.

From this combination the following RIF condition formula can be derived:

Exists ?z ( And( ?z[rdf:type -> ex:nameBearer]   "http://a"^^rif:iri["http://p"^^rif:iri<http://a>[<http://p> -> ?z] ))

as can the following RDF triples:

_:y rdf:type ex:nameBearer .
<http://a> <http://p>  "a"^^xsd:integer"John" . 

However, "http://a"^^rif:iri["http://p"^^rif:irithere is no RIF constant symbol t such that t[rdf:type -> "a"^^xsd:integer] cannotex:nameBearer] can be derived, because itthere is not a well-formed RIF formula, due to the factno constant that "a" is not an integer; it is not in the lexical space ofrepresents the datatype xsd:integer .name-bearer.


The remainder of this section formally defines combinations of RIF rules with RDF graphs and the semantics of such combinations. A combination consists of a RIF rulesetdocument and a set 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.

2.13.1 Syntax of RIF-RDF Combinations

This section first reviews the definitions of RDF vocabularies and RDF graphs, after which definitions related to datatypes and ill-typedtyped literals are reviewed. Finally, RIF-RDF combinations are formally defined.

2.1.13.1.1 RDF Vocabularies and Graphs

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.

DEFINITION:Definition. Given an RDF vocabulary V, a generalized RDF triple of V is a statement of the form s p o, where s, p and o are names in V or blank nodes. DEFINITION:  ☐

Definition. Given an RDF vocabulary V, a generalized RDF graph is a set of generalized RDF triples of V.   ☐

(See the (End note on generalized RDF graphs))

2.1.23.1.2 Datatypes and Typed Literals

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), the notion of datatype maps (RDF-Semantics) is used.

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 included in the map. RIF BLD additionally requires the following datatypes to be included: xsd:stringxs:string, xsd:decimalxs:decimal, xsd:timexs:time, xsd:datexs:date, xsd:dateTimexs:dateTime, and rif:text; these datatypes are the RIF-required datatypes. A conforming datatype map is a datatype map that recognizes at least the RIF-required datatypes.

DEFINITION:Editor's Note: The list of required data types is to be replaced with a link.

Definition. Let T be the set of considered datatypes (cf. Section 5 of (RIF-BLD)), i.e., T includes at least all data types used in the combination under consideration and all datatypes required for RIF-BLD (RIF-DTB). A datatype map D is a conforming datatype map if it satisfies the following conditions:

  1. No RIF-supported symbol space that is not a datatype (these are rif:local and rif:iri in RIF BLD) is in the domain of D.The IRIs identifying all RIF-requireddatatypes in T are in the domain of D.
  2. D maps IRIs identifying XML schema datatypes to the respective data types ( XML-SCHEMA2 ), rdf:XMLLiteraleach IRI in its domain to the rdf:XMLLiteralcorresponding datatype ( RDF-Concepts ), and rif:text toin T.   ☐

Editor's Note: The rif:text primitive datatype ( RIF-BLD ).terminology "considered datatype" might change if the notionsterminology is changed in BLD.

The notion of well- and ill-typed literalswell-typed literal loosely correspond towith the notionsnotion of legal and illegal symbolssymbol in RIF:

DEFINITION:Definition. Given a conforming datatype map D, a typed literal (s, d) is a well-typed literal if

  1. d is in the domain of D and s is in the lexical space of D(d) or
  2. d is the IRI of a symbol space supportedrequired by RIF BLD and s is in the lexical space of the symbol space. Otherwise ( s , d ) is an ill-typed literal . Editor's Note: The definition of "ill-typed literal" should be revisited. Namely, not all literals that are not well-typed are ill-typed. Perhaps the notion of ill-typed literal is not necessary at all. 2.1.3  ☐

3.1.3 RIF-RDF Combinations

A RIF-RDF combination consists of a RIF rulesetdocument and zero or more RDF graphs. Formally:

DEFINITION:Definition. A RIF-RDF combination is a pair < R,S>, where R is a RIF rulesetdocument 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.

2.23.2 Semantics of RIF-RDF Combinations

The semantics of RIF rulesetsdocuments and RDF graphs are defined in terms of model theories. The semantics of RIF-RDF combinations is defined through a combination of the RIF and RDF 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 four normative kinds of interpretations, as well as corresponding notions of satisfiability and entailment:

Those four types of interpretations are reflected in the definitions of satisfaction and entailment in this section.

2.2.13.2.1 Interpretations

This section defines the notion of common-rif-rdf-interpretation, which is an interpretation of a RIF-RDF combination. This common-rif-rdf-interpretation is the basis for the definitions of satisfaction and entailment in the following sections.

The correspondence between RIF semantic structures (interpretations) and RDF interpretations is defined through a number of conditions that 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 (cf. Table 1).

2.2.1.13.2.1.1 RDF and RIF Interpretations

The notions of RDF interpretation and RIF semantic structure (interpretation) are briefly reviewed below.

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 that satisfy certain conditions:

As defined in (RIF-BLD), a semantic structure is a tuple of the form I = <TV, DTS, D, Dind, Dfunc, IC, IV, IF, Iframe, ISF, Isub, Iisa, I=, Iexternal, Itruth>. The specification of RIF-RDF compatibility is only concerned with DTS, D, IC, IV, Iframe, Isub, Iisa, and Itruth. The other mappings that are parts of a semantic structure are not used in the definition of combinations.

Recall that Const is the set of constant symbols and Var is the set of variable symbols in RIF.

2.2.1.2 Common RIF-RDF Interpretations DEFINITION: A common-rif-rdf-interpretation is a pair ( I , I), where I = < TV , DTS , D , D ind , D func , I CFor the purpose of the interpretation of imported documents, RIF BLD defines the notion of semantic multi-structures, which are nonempty sets {I V1, ..., I F ,n} of semantic structures that are identical in all respects with the exception of the interpretation of local constants.

Given a semantic multi-structure I frame ,={I SF1, ..., I sub ,n}, we use the symbol I isa ,to denote both the multi-structure and the common part of the individual structures I =1, ..., In.

3.2.1.2