W3C

RIF Combination with XML data

W3C Editor's Draft 11Working Group Note 13 May 20102011

This version:
http://www.w3.org/2005/rules/wg/draft/ED-rif-xml-data-20100511/http://www.w3.org/2005/rules/wg/draft/ED-rif-xml-data-20110513/
Latest editor's draft:
http://www.w3.org/2005/rules/wg/draft/rif-xml-data/
Previous version:
http://www.w3.org/2005/rules/wg/draft/ED-rif-xml-data-20100510/ ( color-coded diff )http://www.w3.org/2005/rules/wg/draft/ED-rif-xml-data-20100511/
Editors:
Christian de Sainte Marie, IBM

A color-coded version of this document showing changes made since the previous version is also available.

This document is also available in these non-normative formats: PDF version.


Abstract

This document, developed by the Rule Interchange Format (RIF) Working Group, specifies how a RIF document can be combined with XML data documents.data.

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/.

SetSummary of DocumentsChanges

@@@ tdb

Please Send Comments

Please send any comments to public-rif-comments@w3.org (public archive). Although work on this document by the Rule Interchange Format (RIF) Working Group is being publishedcomplete, comments may be addressed in the errata or in future revisions. Open discussion among developers is welcome at public-rif-dev@w3.org (public archive).

No Endorsement

Publication as one ofa set of 10 documents: RIF Overview RIF Core Dialect RIF Basic Logic Dialect RIF Production Rule Dialect RIF Framework for Logic Dialects RIF Datatypes and Built-Ins 1.0 RIF RDFWorking Group Note does not imply endorsement by the W3C Membership. This is a draft document and OWL Compatibility OWL 2 RL in RIF RIF Combination with XML data (this document) RIF Test Cases XML Schema Datatypes Dependency RIFmay be updated, replaced or obsoleted by other documents at any time. It is definedinappropriate to use datatypes defined in the XML Schema Definition Language (XSD) .cite this document as ofother than work in progress.

Patents

This writing,document was produced by a group operating under the latest5 February 2004 W3C Recommendation for XSD is version 1.0,Patent Policy. W3C maintains a public list of any patent disclosures made in connection with version 1.1 progressing toward Recommendation. RIF has been designed to take advantagethe deliverables of the new datatypes and clearer explanations available in XSD 1.1, butgroup; that page also includes instructions for now those advantages are being partially put on hold. Specifically, until XSD 1.1 becomesdisclosing a W3C Recommendation, the elementspatent. An individual who has actual knowledge of RIF which are based on it should be considered optional , as detailed in Datatypes and Builtins, section 2.3 . Upon the publication of XSD 1.1 as a W3C Recommendation, those elements will cease to be optional and are to be considered required as otherwise specified. We suggest that for now developers and users follow the XSD 1.1 Last Call Working Draft . Based on discussions between the Schema, RIF and OWL Working Groups, we do not expect any implementation changes will be necessary as XSD 1.1 advances to Recommendation. Summary of Changes There have been no substantive changes since the previous version . For details on the minor changes see the change log and color-coded diff . Please Comment By 8 June 2010 The Rule Interchange Format (RIF) Working Group seeks public feedback on this Editor's Draft. 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 and see if the relevant text has already been updated. No Endorsement Publication as a Editor's 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 . The group does not expect this document to become a W3C Recommendation. 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 patenta patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


Table of Contents

1 Overview

The Rule Interchange Format (RIF) is a format for interchanging 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. This document specifies how acombinations of RIF document can be combineddocuments and XML data, possibly associated with XML documents. It definesschemas, are interpreted.

Extensible Markup Language (XML) is a data model forsimple, flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML instance documents, thatis also playing an increasingly important role in the exchange of a simplified versionwide variety of the XQuery 1.0 and XPath 2.0data Model [ XDM ], and it specifies howon the RIF condition language can be interpreted with respect to an XML document,Web and what iselsewhere. The associated semantics, in accordance with that data model.XML Schema Definition Language offers facilities for describing the XQuery 1.0structure and XPath 2.0 Data Model (XDM) specifies what information is accessible in a collectionconstraining the contents of XML documents, but it does not specifydocuments. The language usedschema language, which is itself represented in an XML vocabulary, provides a way to represent or accessdescribe and to share the data:data model that is associated with the data in an XML document.

This document specifies an implementation, using the RIF condition language, ofa simplified versionstandard semantics for combinations of the XDM. This makes theRIF condition language comparable to other implementations of the XDM, such as [ XPath 2.0 ]documents and [ XQuery 1.0 ]. Essentially, this document specifies: how XML documents, possibly associated withXML schemas, are imported in a RIF document; how sets of elementsdata, with given nameor type properties, in an XML instance document, can be represented in RIF; and how the relation between parent elements and children elements and attributes, inwithout an associated XML instance document, can be represented in RIF, whenschema. The children have given name and type properties. Likespecification relies on the abstract XQuery 1.0 and XPath 2.0 Data Model , the simplified version used[XDM] to specify what information is accessible in this document supportsthe following classes of XML documents: Well-formed documents conformingdata, and on XPath 2.0 expressions [XPath 2.0] to [Namespaces in XML] or [Namespaces inselect pieces of that information. It relies on XML 1.1]. DTD-valid documents conformingSchema Component Designators [XSD-CD] expressions to [Namespaces in XML] or [Namespaces inprovide unambiguous designators for XML 1.1],schema types and W3C XML Schema-validated documents. Accordingly, this document specifies how a RIF document is combined with well-formed XML documents and,schema elements in combinations where available,the correspondingXML schemas, identified using the rif:Import construct. Editor's Note: Itdata is intended that, in a future draft,associated with an instanceXML schema.

XPath 2.0 is a non-XML expression language that allows the processing of values conforming to the data model can also be constructed from non-XML sources such as relational tables in a database or object instances.defined in this case, a RIF document will be interpreted with respect to[XDM]. The serializationresult of the source according toan XML schema that MUSTXPath expression may be imported ina selection of nodes from the RIF document.input data model, or an XML schema can also be combined with a RIF document withoutatomic value, or more generally, any sequence allowed by the associateddata source being specified: in that case,model. The selectionname of the data source to be combined with the RIF document is left tolanguage derives from its most distinctive feature, the RIF document consumer. Thispath expression, which provides a way to communicatemeans of hierarchic addressing of the data model that is intended,nodes in an XML tree.

XML Schema Component Designators (XSD-CD) is a RIF document,non-XML expression language that provides reliable and unambiguous designators for XML schema components. The data source, without specifyingspecification divides the problem of constructing schema component designators into two parts: defining a designator for an actual data source. Editor's Note:assembled schema, and defining a designator for a particular schema component or schema components, understood relative to a designated schema. This section will be completed, e.g. with typical usage scenarios, inspecification uses only a future draft. 2 Importing XML documentslimited subset of the schema component path expression language, from the second part.

According to this specification, XPath and schemascomponent designator expressions are represented as string constants in RIF In RIF,formulas. Although the Import directivesemantics of RIF and XML data combinations is usedspecified with respect to communicate the location of an external documentany valid XPath 2.0 expression, conforming implementations are required to be combined with the RIF documentsupport only a limited subset. Future versions of this specification may extend that containssubset.

The directive and, optionally, a profile that governs the combination. In [ RIF-Core ], [ RIF-PRD ]XQuery 1.0 and XPath 2.0 Data Model (XDM) is based on the infoset [ RIF-BLDInfoset], possibly augmented with information resulting from the usevalidation of the Import directive is limited to identifying an imported RIF document, orXML data against an RDF graphXML schema, or an OWL ontologypost-schema validation infoset (PSVI), according to be combined with a RIF document. An optional profile that governsthe combination of a RIF document with an RDF graph orspecification W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures [XSD 1.1 Part 1]. An OWL ontologyinstance of the data model can also be provided,constructed directly through application APIs, or from non-XML sources such as specified in [ RIF-RDF-OWL ]. This specification extends the Import directiverelational tables in two ways: a new allowed value anda new set of allowable values are specifieddatabase. The semantics for the profilecombination of an import, in additionRIF documents with XML data applies, therefore, to the values specified in [ RIF-RDF-OWL ]:combination of RIF documents with non-XML data as well, where the new value isXML binding of the URI: http://www.w3.org/2007/rif-import-profile#xml-data ;data is only used to refer to it in addition, any URI that identifiesthe interchanged rules. This is likely to be of particular interest when an XML schema documentis allowed as a profile.interchanged along with the location sub-element, that containsRIF document.

Like the IRI that identifiesXQuery 1.0 and XPath 2.0 Data Model, the importedsemantics of combinations of RIF documents and XML data document,that is made optional as well. Editor's Note:specified in this document supports the extended syntax is still under discussion. Another approach would befollowing classes of XML data:

Accordingly, this document providesspecifies how a schema-location , the profile must identify the sameRIF document is combined with well-formed, and, where an XML schema as the schema-location URI; Ifis specified, schema-valid XML documents. The profilesemantics is rif:xml-data ,independent on the provenance of the location URI must be present and it must identify anXML instance document. This specification does not prescribedata in a combination: it can be imported explicitly in a RIF document, or combined on the behaviour ofconsumer-side, or a conformant implementation when onecombination of both. However, only XML schemas that are explicitly imported in the above constraint is not satisfied. This specification does not prescribeRIF document are taken into account for the behaviourinterpretation of the combination. This provides a comformant implementation when an Import directive contains a profileway to communicate the data model that is neither rif:xml-data , nor an URI that identifies an XML schema. 3intended, in a simple data modelRIF document, for XML documentsthe data model described in thissource, without specifying an actual data source.

Section 2 specifies the information that is accessible in an XML document, possibly in combinationa normative standard semantics for RIF combinations with anXML schema,data: first, an XPath 2.0 and XSD-CD based syntax is specified, that is used to specifyrelate RIF formulas to XML data items in a combinations (section 2.1). Then, a model-theoretics semantics is given to RIF BLD combination with XML data, with and without associated XML schema (section 2.2); the interpretationoperational semantics of theRIF condition languagePRD combinations with respect to anXML instance document.data is, then, defined, based on the definition of a RIF BLD+XML data combined interpretation (section 2.3); finally, the semantics of RIF Core combinations with XML data modelis a stripped down versiondefined with respect to the model-theoretic semantics of the XQuery 1.0combination of RIF BLD and XPath 2.0XML data Model [ XDM ]. As a consequence,and the RIF condition language can be considered a partial implementationoperational semantics of the XQuery 1.0combination of RIF PRD and XPath 2.0XML data (section 2.4).

Section 3 specifies how the rif:Import directive is extend to support the import of XML data Model,and XML schemas in a RIF document.


Combination with XML data and/or schema constrains the interpretation of RIF formulas and give them special semantics. As a result, the semantics of RIF condition languagecombined with respect toXML documents can be specified in termsdata and schema is not the same as the semantics of RIF alone, even if the XQuery 1.0 and XPath 2.0XML data Model or its implementations, such as XPath 2.0 [and schema in the combination are empty.

Section 4 specifies the conformance criteria for this specification.

Implementation of this specification requires a good understanding of XPath 2.0 ]. This document will reuse definitions fromand the XQuery 1.0 and XPath 2.0 Data Model. However, this document can be read and understood without a deep knowledge of these two specifications. For the XPath 2.0 specifications, as appropriate, and otherwise provide pointers and examples where relevant. 3.1 Definitionsconvenience of the data model specifiesreader, the information itemsdefinition of terms from the XML infosetXPath 2.0, XSD-CD and the XDM specifications, that are of particular importance for this document, are repeated in the Appendix A: Glossary. However, the definition in the glossary are non-normative: the only normative definitions are as specified in the [ InfosetXPath 2.0] and from the post-schema validation infoset (PSVI), or derived fromthe infoset[XDM] recommendations, and in the PSVI, thatXSD-CD specification. Such terms are required to interpret some RIF constructsshown in square bracket, with respect to an XML instance document. Definition (Information item). (from [ Infoset ]) An information item is an abstract description of some part of an XML document: each information item hasa set of associated named properties.  ☐ In this document, an information item is said to be constructed from an infoset ,superscript indicating XP if the data item that it describesterm is containeddefined in a data source that is not associatedXPath 2.0: [thus]XP; or with an XML schema when it is imported in RIF.a superscript indicating XDM if the data sourceterm is associateddefined in XDM: [thus]XDM; or with an XML schema, all the information items used to describe the content of that data source are said to be constructed froma PSVI .superscript indicating CD if an information item is constructed from an infoset, all general and external parsed entities must be fully expanded beforethe data modelterm is constructed. In this specification, the property names are showndefined in square brackets,XSD-CD: [thus]CD.

This document follows the data model relies on three types of information items: Element information items , that describe the elementsconvention used in an XML instance document. The properties associatedother RIF specifications, to each element information item are: [namespace name], [local name], [children], [root], [attributes], [type name], [string value], [typed value], [is-id], [is-idrefs]; Attribute information items , that describestart definition with: Definition and end them with the attributes of elements.symbol ☐. In the properties associated to the attribute information item are: [namespace name], [local name], [attribute type], [owner element], [type name], [string value], [typed value], [is-id], [is-idrefs]; Character information items , that describe the data characters that appear in the XML document. The character information item has two properties: [character code]same way, examples start with: Example and [element content whitespace]. Given a data source,end with ☐. The relevant set of information itemsend symbol may be created by methods other than parsing and/or schema-validating an XML document. This specification does not describeomitted if the definition or prescribe any methodexample ends with the section.

Several prefixes are used throughout this document for retrievingnotational convenience. The required information from a data source, possibly combinedfollowing bindings are assumed.

  1. rif bound to http://www.w3.org/2007/rif
  2. xs bound to http://www.w3.org/2001/XMLSchema
  3. xml bound to http://www.w3.org/XML/1998/namespace
  4. fn bound to http://www.w3.org/2005/xpath-functions
  5. pred bound to http://www.w3.org/2007/rif-builtin-predicate
  6. func bound to http://www.w3.org/2007/rif-builtin-function
  7. xscd bound to http://www.w3.org/2009/xmlschema-ref

2 RIF combination with anXML schema.data

This specification distinguishes betweensection specifies the data model as a general concept and specific items (information items or atomic values) that are concrete examplesnormative semantics of the data model. Some concrete examples are being particularly distinguished by being identified as instancescombination of RIF formulas and XML data, for RIF Core, RIF PRD and RIF BLD, where the XML data model .may be associated with an XML schema.

Definition (Instance of the(RIF+XML data model). An instance of thecombination). A RIF+XML data modelcombination is a sequence of element information items, in document order. In particular, given an XML document Dtriple <R, the instanceE, S>, where R is a RIF formula (document or non-document), E is a, possibly empty, set of thedata model [nodes]XDM that contains the information that describes Dis represented in the sequenceXML data, and S is a, possibly empty, set of allXML schema definitions.  ☐

For the element information itemspurpose of evaluating the XPath 2.0 expressions that describe an element containedare used, in DR, in document order.  ☐ When there is no ambiguity with respectto D , the instance ofaccess the XML data modelthat describes D will be called, simply: the instance of the data model . Definition (Atomic value). An atomic valueis a valuerepresented in E, the value space of an atomic type[in-scope schema definitions]XP are the schema definitions in S and is labeled withall their components.

This specification does not describe or prescribe how the name of that atomic type.  ☐ Definition (Atomic type). An atomic type is oneset of the 20 primitive simple types defineddata model [nodes]XDM, in Section 3.3 Primitive Datatypes of [ XSD 1.1 Part 2 ] ora type derived by restrictionRIF+XML data combination, is obtained: it may result from another atomic type.  ☐ Types derived by listparsing one or union are not atomic. Definition (Sequence). A sequence is an ordered collection of zeromore XML documents and/or validating them against one or more information items.  ☐ A sequence cannotXML schemas, or it may be created by methods other than parsing and/or schema-validating XML documents.

However, in a member of a sequence.RIF+XML data combination <R, E, S>, any information item in E that represents an important characteristicinstance of the data model isa schema definition that thereis no distinction betweenan item (a information itemelement of S or an atomic value ) anda singleton sequence containing that item.component in an item is equivalentelement of S, must be valid with respect to a singleton sequence containingthat item and vice versa. Exceptschema definition.

This specification does not prescribe the behaviour of a conformant implementation when specified otherwise, sequences are ordered according tothe document order . Definition (Document order).set of data model [nodes]XDM in a document order is defined among allRIF+XML data combination does not satisfy the element information items that describeabove validity constraint, or any relevant constraint from the XPath 2.0, XDM or XSD-CD specifications.

2.1 Syntax

This section addresses how a givenRIF formula interacts with the XML instance document. Document order isdata, in a total ordering. Informally, document order isRIF+XML data combination; that is, this section specifies how the order in which nodes appearaccess to XML data, and to XML schema information, if available, is represented in RIF formulas, for the XML serializationpurpose of a document.  ☐ Within a tree, document order satisfiescombining them.

The following constraints:basic idea is that the root nodeobject-attribute-value semantics of RIF frame formulas is used, in the first node. Every node occurs before allcombination of its childrenRIF formulas and descendants.XML data, to exploit the relative orderintended semantics of siblings isthe order in which they occurrelation between a [context node]XP, an XPath 2.0 expression and the sequence that the expression matches in the children propertycontext of their parent node. Children and descendants occur before following siblings. XML element, attribute and type names are usually represented as XML qualified names, or QNames. However, xs:QName is not a RIF-Core built-in datatype.the node: in the context of a RIF+XML data model, all qualified names, including atomic values, are representedcombination <R, E, S>, frame formulas of the form object["some XPath expression"->val], where the object term is interpreted as expanded QNames . Definition (Expanded QName).an expanded QName isdata model [node]XDM in E, mean that val can be derived, in a pair of two values, consistingway to be specified in this document, from the sequence of a possibly empty namespace URI and a local name.  ☐ 3.2 Element informationitems There is an element information item for each element appearingthat the XPath expression matches in the XML document. Onecontext of the element information items corresponds tonode denoted by object.

This document specifies the rootsemantics of RIF+XML data combinations, in general terms, for any valid XPath 2.0 expression. But some of the element tree, and all other element information itemsdetails are accessiblespecified normatively for a limited subset of XPath 2.0 expressions only. Namely, conforming implementations must support the XPath 2.0 expressions specified by recursivelythe following its [children] property. An element information item has the following properties: [ namespace name ] The namespace name, if any, of the element type. If the element does not belong to a namespace, this property has no value. [ local name ] The local partEBNF grammar:

RIFexpr               ::= StepExpr | ValueExpr | AbbreviatedExpr
AbbreviatedExpr       ::= ElementName | '@' AttributeName
ValueExpr             ::= 'fn:data(' ( StepExpr | '.' ) ')'
StepExpr              ::= StepAxis ( NameTest | KindTest ) ('[' Position ']')?
StepAxis              ::= 'self::' | 'child::' | 'attribute::'
NameTest              ::= ElementName | AttributeName
KindTest              ::= ElementTest
                          | AttributeTest
                          | SchemaElementTest
                          | SchemaAttributeTest
ElementTest           ::= 'element' '(' (ElementNameOrWildcard (',' TypeName '?'?)?)? ')'
SchemaElementTest     ::= 'schema-element' '(' ElementDeclaration ')'
ElementDeclaration    ::= ElementName
AttributeTest         ::= 'attribute' '(' (AttribNameOrWildcard (',' TypeName)?)? ')'
SchemaAttributeTest   ::= 'schema-attribute' '(' AttributeDeclaration ')'
AttributeDeclaration  ::= AttributeName
ElementNameOrWildcard ::= ElementName | '*'
ElementName           ::= QName
AttribNameOrWildcard  ::= AttributeName | '*'
AttributeName         ::= QName
TypeName              ::= QName
Position              ::= [1..9] [0..9]*

Future versions of the element-type name.this does not include any namespace prefix or following colon; [ children ] An ordered list of child information items,specification may extend that subset.

XPath expressions are represented in document order. This list contains only element information items and character information itemsRIF as xs:string constants.

Editor's Note: Alternatively, an additional symbol space, rif:xpath, one for each element andcould be added to RIF built-in data character appearing immediately within the current element. It does not contain other kinds of information items, suchtypes: in that case, XPath expressions would be represented as attribute information items , even if the XML element described byrif:xpath constants.

XPath 2.0 unabbreviated syntax must be used in the information item has attributes. Ifnormative RIF/XML syntax, except when the elementexpression is empty, this list has no members; [ root ]a simple StepExpr and the element information itemtest is a NameTest: in that describescase, the root elementabbreviated syntax must be used in the XML document.normative RIF/XML syntax.

Both syntaxes, abbreviated and unabbreviated, are allowed in the [root] property allnon-normative RIF presentation syntax.

When a string constant is evaluated as an XPath expression, the element information items that describe elements contained in[statically known namespaces]XP are the same XML instance document point toin-scope namespaces for the same root element information item, including that rootcontaining element information item itself. Ifin the [root] property of an element information item points to that element information item itself,RIF formula.

Likewise, the [root] propertiesobject-class and subclass-superclass semantics of all the element information items that are accessible by following its [children] property, recursively, must pointRIF member and subclass formulas is used to that same root element information item; [ attributes ] An unordered set of attribute information items, one for each ofexploit the attributes of this element. This includes allintended semantics of the "special" attributes ( xml:lang , xml:space , xsi:type , etc.) but does not include namespace declarations (because they are not attributes). Defaultrelation between an XML element and fixed attributes, e.g. provided byits XML schema processing, are added to the [attributes]. If the element has no attributes, this set has no members; [ type name ] The [type name] property of an element information item is empty if,type, and only if, the element information item is constructed from an infoset. Ifof the elementrelation between two XML schema types, when information itemon classes and types definitions is constructedavailable from a PSVI,imported XML schemas. RIF member formulas of the type name is represented byform: object #  "an expanded QName. ItXSD-CD component path expression", where the object term is determinedinterpreted as described in Section 3.3.1.1.a element and Attribute Node Type Names from [[node]XDM ] (reproducedin APPENDIX TYPE NAME fore E, mean that the reader's convenience); [ string value ]XML fragment represented by e satisfies the normalised representation ofXML schema definition designated by the contentXSD-CD component path expression.

In the same way, subclass expressions of the element as a string.form: "sub" ## "SUP" where, both, "sub" and "SUP" are XSD-CD schema component path expressions, mean that the string valueschema types Tsub and TSUP, whose definitions are designated by the XSD-CD expressions "sub" and "SUP", respectively, satisfy [derived-from]XP(Tsub, TSUP), where the pseudo-function derives-from is calculateddefined as follows: Ifin XPath 2.0, section 2.5.4 - Sequence type matching.

This specification specifies the element is empty or if it does not have any character information item children nor descendants, its string value is the zero length string; Else, if the [type name] propertysemantics of the element information item is empty, or if the element has a complex type with element-only content,RIF+XML data combinations that contains such member or subclass formulas for a complex type with mixed content, its string value is the string comprisedlimited subset of charactersXSD-CD expressions, only. Namely, conforming implementations must support absolute XSD-CD expressions that correspond to the [character code] properties of each ofdesignate schema types, as specified by the character information item children offollowing EBNF grammar:

RIFSchemaComponentPath       ::=  StepSepator RelativeSchemaComponentPath 
RelativeSchemaComponentPath  ::=  Step (StepSeparator RelativeSchemaComponentPath)?
StepSeparator                ::=  '/'
Step                         ::=  AbbrevStep
AbbrevStep                   ::=  AbbrevElementStep | AbbrevTypeStep
AbbrevElementStep            ::=  NameTest
AbbrevTypeStep               ::=  '~' NameTest
NameTest                     ::=  QName | '0'

XSD-CD component path expressions are represented in RIF as xs:string constants.

Editor's Note: Alternatively, an additional symbol space, rif:xsd-cd, could be added to RIF built-in data types: in that case, XSD-CD expressions would be represented as rif:xsd-cd constants.

XSD-CD abbreviated syntax must be used in the elementnormative RIF/XML syntax. Both abbreviated and all its descendants,unabbreviated syntaxes are allowed in document order. Ifthe resulting string consists entirely of whitespace andnon-normative RIF presentation syntax.


For the [element content whitespace] propertypurpose of expanding QNames in NameTests, the character information items used to construct itin-scope namespace bindings are true,defined as all the string value isnamespace declaration in the zero-length string; Else, ifscope of which the element has a simple type or a complex type with simple content: itsstring value isis.


Example 2.1. Consider, for instance, the schema normalized value offollowing rule, that says that an EarlyCustomer is a Customer whose Account number is lower than 1000 (using the element; Note that, ifRIF presentation syntax and XPath abbreviated syntax):

Forall ?x, ?y
   (_EarlyCustomer(?y) :-
   And( ?x["ex:Name" -> ?y]
        Exists ?z (And ?x["ex:Account" -> ?z]
                       External(pred:numeric-less-or-equal(External(xs:integer(?z)) 1000)))))

Consider, further, the element has a typed value, any valid lexical representation offollowing XML fragment, representing data about customers:

<CustomerTable xmlns="http://example.org/customertable"
               xmlns:xml="http://www.w3.org/XML/1998/namespace">
  <Customer xml:lang="en">
    <Name> John </Name>
    <Account> 111 </Account>
  </Customer>
  <Customer xml:lang="fr">
    <Name> Jane </Name>
    <Account> 222 </Account>
    <PIN> 222 </PIN>
  </Customer>
</CustomerTable>

Assuming, like in all further examples, that the typed value can be usedpair (ex, <http://example.org/customertable>) belongs to determinethe [string value] property; [ typed value ]statically known namespaces when the typed-value is calculated as follows: IfXPath expressions are evaluated, the elementcombination, under the semantics described below, of the above rule and XML data, with no associated XML schema, will entail two new facts, namely:

 _EarlyCustomer("John")
 _EarlyCustomer("Jane")

This rule shows how an XPath expression is emptyused, in the rule, as an xs:string constant, e.g.: "child::schema-element(ex:Name)" or if it has element-only children, its typed value is"child::schema-element(ex:Account)", to access the element itself; more precisely, ifchildren of an element information item has no character information items[node]XDM as frame slots.

Notice that, in its [children] property,the valueabsence of its [typed value] property isclasses and types definitions as would be provided by an associated XML schema, NameTest are enough to exploit all the elementinformation item itself. Thisthat is a deviation from the XQuery 1.0 and XPath 2.0 Data Model ; Else, ifavalable in the [type name] property ofXML data, in the elementcombination. Notice further that, with no typing information item is empty, or ifavailable, atomic values retrieved from the element hasXML data can only be interpreted as strings. A complex type with mixed content (including xs:anyType), its typed valueconsequence is that such values have to be cast into the samerequired types when used as its string value; Otherwise,arguments to RIF buit-in functions and predicates.

Notice, also, that, for the element must have a simple type or a complex type with simple content. Its typed value is computed as described in Section 3.3.1.2 Typed Value Determination , in [ XDM ] (reproducedsame reason, member (or subclass) formulas cannot be used in Appendix B forcombination with the reader's convenience).XML data: the result is a sequence of zero or more atomic values.only way (based only on the relationship betweeninformation that is available in the values ofexample) to ensure that only the [type name], [typed value],ex:Name and [string value] propertiesex:Account sub-elements of anex:Customer elements are taken into account would be to add a frame formula to the condition, to check that the variable ?x is bound to an element information itemthat is, itself, named ex:Customer":

Forall ?x, ?y
   (_EarlyCustomer(?y) :-
   And( ?x["ex:Name" -> ?y]
        ?x["self::ex:Customer"->?x]
        Exists ?z (And ?x["ex:Account" -> ?z]
                       External(pred:numeric-less-or-equal(External(xs:integer(?z)) 1000)))))

Notice that, in the absence of an XML schema against which the data must be valid, the fact ?x["self::ex:Customer"->?x] does not entail anything with respect to other properties of ?x.

Now, assume that the following XML schema is consistentassociated with the above XML fragment:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xml="http://www.w3.org/XML/1998/namespace"
           targetNamespace="<nowiki>http://example.org/customertable</nowiki>"
           xmlns="<nowiki>http://example.org/customertable</nowiki>">  

  <xs:simpleType name="PIN">
    <xs:restriction base="xs:integer">
      <xs:minInclusive value="100"/>
      <xs:maxExclusive value="1000"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="Name" type="xs:string"/>
  <xs:element name="Account" type="xs:integer"/>
  <xs:element name="PIN" type="PIN"/>
  
  <xs:element name="Customer">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Name"/>
        <xs:element ref="Account"/>
        <xs:element ref="PIN" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
    <xs:attribute ref="xml:lang"/>
  </xs:element>

  <xs:element name="CustomerTable">
    <xs:complexType>
      <xs:all>
        <xs:element ref="Customer" minOccurs="0"/>
      </xs:all>
    </xs:complexType>
  </xs:element>

</xs:schema>

When the XML schema validation. Note thatis associated with the data, in the case of xs:QName s and xs:NOTATION s,RIF+XML data combination, typing information can be taken into account, both, to focus on the prefix is not preserved,data that represent customer information (that is, information represented in ex:Customer elements), and the typed valuesto ensure that arguments to built-in functions and predicates are representedproperly typed. The example rule could, then, be written as expanded QNames.follows (notice that this deviates fromversion of the [[#ref-xdm|XQuery 1.0 andrule uses unabbreviated XPath 2.0 Data Model]; [is-id] Ifsyntax):

Forall ?x, ?y
    (_EarlyCustomer(?y) :-
    And( ?x # "/ex:Customer"
         ?x["child::schema-element(ex:Name)" -> ?y]
         Exists ?z (And ?x["child::schema-element(ex:Account)" -> ?z]
                        External(pred:numeric-less-or-equal(?z 1000)))))

In that case, the [type name] propertyassertion of an element information item is empty, or ifthe elementclass membership: ?x # "/ex:Customer", entails that ?x has a complex type with element-only content,all the [is-id] property is false. Else, ifproperties that are required to validate against the typed valueschema definition of the element consists of exactly one atomic value, that value isex:Customer.

Another rule example, below, shows how another kind of type xs:IDXPath expression, used as an xs:string constant: "@xml:lang"</nowiki>>, oris used, in a type derived from xs:ID ,RIF+XML data combination, to access an attribute [node]XDM as a frame slot:

Forall ?x, ?y
   (_SpeaksEnglish(?y) :-
   And( ?x["@xml:lang" -> "en"^^xs:language])
        ?x["ex:Name" -> ?y])

Assuming that the [is-id] property is true, otherwise itpair (xml, <http://www.w3.org/XML/1998/namespace>) is false. [is-idrefs] Ifalso in the [type name] property of an element information item is empty, or ifstatically known namespaces, that rule, combined with the element hasexample XML data and XML schema, entails a complex type with element-only content,single new fact:

_SpeaksEnglish("John")

Notice that all the [is-idrefs] property is false. Else, ifrules, above, are well-formed RIF formulas, that can be validly consumed without being combined with any of the atomic valuesXML data and/or XML schemas. In the typed-valuethat case, of course, this specification adds nothing to the element isspecification of type xs:IDREF or xs:IDREFSthe RIF Core Dialect, or a type derived from one of those types,as regards the [is-idrefs] property is true, otherwise it is false. 3.3 Attribute information items There is an attribute information item for each attribute (specified or defaulted)semantics of each element in the document, excluding those which are namespace declarations (because they are not attributes). Attributes declared in the DTD with no default value and not specified in the element's start tag are not represented by attribute information items. An attribute information item has the following properties: [ namespace name ]the namespace name, if any,rules.

2.2 Model-theoretic semantics of RIF BLD+XML data combinations

The attribute. Otherwise, this property has no value; [ local name ] The local partspecification of the attribute name. This does not include any namespace prefix or following colon; [ attribute type ] An indicationmodel-theoretic semantics of the type declared for this attribute in the DTD. The only value that are relevant to this specification are IDa RIF BLD+XML data combination -- a RIF+XML data combination, IDREF and IDREFS . If there<R, E, S> where R is no declaration for the attributea RIF-BLD (document or if no declaration has been read, this property has no value.non-document) formula -- follows closely the valuespecification of this property is not affected bythe validitysemantics of a RIF BLD formula, except that the attribute value; [ owner element ]notion of semantic structures is replaced by the notion of RIF BLD+XML data combined interpretations: informally, RIF BLD+XML data combined interpretations are RIF BLD semantic structures, extended with an additional mapping, IDM, that interprets data model [nodes]XDM, and constrained with additional conditions, derived from the element information item which contains thisinformation itemin its [attributes] property; [ type name ] Empty ifE and S.

2.2.1 Semantic structures

Definition (Semantic structure). For the attribute information item is constructed from an infoset. Ifpurpose of defining the attribute information item is constructed frommodel-theoretic semantics of a PSVI, the type nameRIF BLD+XML data combination <R, E, S>, a semantic structure is representedas an expanded QName,a tuple I = <TV, DTS, D, Dind, Dfunc, IDM, IC, IV, IF, INF, Ilist, Itail, Iframe, Isub, Iisa, I=, Iexternal, Itruth>, where TV, DTS, D, Dind, Dfunc, IC, IV, IF, INF, Ilist, Itail, Iframe, Isub, Iisa, I=, Iexternal and it is determinedItruth are defined as describedin RIF-BLD ([RIF-BLD], section 3.3.1.1. Element3.2, Semantic structures), and Attribute Node Type Nameswhere

2.2.2 Combined interpretation of RIF BLD non-document formulas and XML data

Let Classifiers(S) denote the reader's convenience); [ string value ]set of all the schema normalized value PSVI property ifwell-formed RIFSchemaComponentPath expressions, expr, such that exists; otherwise,one of the normalized attribute value according to Section 3.3.3 Attribute-Value Normalizationfollowing holds, where c is the component selected by expr in [ XML ]). Note that, ifthe attribute has a typed value, any valid lexical representationcontext of S:

Let, further, Classes(S) Classifiers(S) denote the value ID , or ifsubset of classifier XSD-CD expressions that select the type namedeclarations of named complex types.

Definition (RIF BLD+XML data combined interpretation). A RIF BLD+XML data combined interpretation is xs:ID ora type derived from xs:IDtriple (E, the [is-id] property is true; otherwise, itI, S), where E is false. This specicification does not prescribe the behavioura set of data model [nodes]XDM, possibly empty; S is a RIF consumer application if an errorset of XML schema definitions, possibly empty; and I is encountered during [ xml:id ] processing. [ is-idrefs ] True ifa semantic structure, such that all the value offollowing holds:

  1. For all the [attribue type] property is IDREF or IDREFS[nodes]XDM e E, or ifItruth(Iframe(IDM(e))(IC("expr"^^xs:string), RIFValue(e, expr))) = t (true) for any of the atomic values in the typed-value of the attributewell-formed XPath expression, expr, for which RIFValue(e, expr) is of type xs:IDREF or xs:IDREFSdefined; and
  2. For all the individuals o DInd, or a type derived from one of those types. Otherwise, false. 3.4 Character information itemsthere is an element [node]XDM with a character information item for each data charactercomplex type, e E, such that appears in the document, whether literally, as a character reference, or within a CDATA section. Each characterIDM(e) = o, if and only if there is a logically separate information item, but applications are free to chunk characters into larger groups as necessary or desirable. A character information item has the following properties: [ character code ]an XSD-CD component path expression, expr Classifiers(S), such that Itruth(Iisa(o, IC("expr"^^xs:string))) = t (true) and
  3. DTS is no declaration forextended to include all the containing element, or if there are multiple declarations, or if no declaration has been read, this property has no value for white space characters. It is always false for characters that are not white space. 3.5 Resolution of references Definition (Reference information item). Given an information item, I , whose [is-id] is true, and given annamed atomic value, id ,types defined in the [in-scope schema definitions]XP;
  4. Itruth(Isub(IC("T1"^^xs:string), IC("T2"^^xs:string)) = t (true) for all the pairs of type ID , IDREF , xs:IDXSD-CD component expressions, (T1, or xs:IDREFT2) Classes(S) × Classes(S), that matches one of the atomic values in I' s [typed value] property, the reference information item identified by id is the element information item, Rselect two complex types, t1 and t2, such that its [root] property has[derives-from]XP(t1, t2) is true;

Notice that clause 2, in the same value asabove definition, implies that, if the [root] propertyclass membership of I , if I isan element information item, or asobject, that interprets the [root] property of[context node]XP e, in a classifier amongst the element information item pointed to byschema definitions in the [owner element] property of I , if Icombined interpretation is an attribute information element; and eitherasserted, then the [is-id] property of R is true and its [typed value] property matches id ; orobject must have all the [is-id] property of one ofproperties that are mandated by the attribute information items in R' s [attributes] property is true,classifier, and the [typed value]no property of that attribute information item matches id .  ☐ Notethat the reference information item is always an element . Wheredefinition of the classifier does not allow. This specification states, with respect tois a setconsequence of information items,the constraint that all the references are resolvedschema element [node]XDM, the following processing is applied to every information itemin the set whose [id-refs] property is true: If the information item is an element information item,E, and if its typed value is a single atomic valuemust be schema valid.

Editor's Note: Another possibility, to resolve the issue of type xs:IDREF or xs:IDREFS or a type derived fromincomplete instances, would be to introduce one of those types, E itself is replaced with its reference information item ; or, if its typed value is a sequence that containsor more than one atomic values, each atomic value thatnull values in the RIF vocabulary, e.g. rif:null.

RIFValue is of type xs:IDREF or xs:IDREFS ora type derivedtotal mapping from one of those typesE × EXPR to Dind, where EXPR is replaced withthe typedset of all the well-formed XPath expressions. RIFValue(e, expr) associates a value in Dind to the sequence of its reference information itemdata model [nodes]XDM, after the referencesin E, that typed value have been resolved, ifare matched by the [id-refs] property ofXPath expression expr when the reference information item[context node]XP is true; otherwise, the information item must be an attribute information item, A ,e and every atomic value inS contains the typed value of A is replaced with its reference information item[in-scope schema definitions]XP.

No property valueRIFValue is changeddefined as follows.

Let seq = (i1,...,in) be the sequence of items matched by expr EXPR in any information item:the references are resolved only on a "need-to-resolve" basis,context of e E, where n 0 is the specification of RIF as an implementationnumber of the data model requires them to be resolved. This specification does not prescribe a behavioritems in seq:


Val interprets items 3 and 4 in the data model instance, describingas follows:

In the previous element information item; [type name]: http://www.w3.org/2001/XMLSchema language [string value]: "en" [typed value]: en [is-id]: false; [type name]: http://example.org/customertable "some locally unique identifier forabove, fn:string and fn:data are the anonymous type Customer " [string value]: "John 111" [typed value]:accessors defined in the element information item itself; [is-id]: false; [is-idrefs]:false; an element information item representingXpath 2.0 and XQuery 1.0 Functions and Operators recommendation [XFO], sections 2.3 and 2.4 (for the Name sub-element ofreader's convenience, the first Customer elementdefinitions are copied, non-normatively, in the document,Glossary.)

A RIF BLD+XML data combined interpretation (E, I, S) determines the truth value, TVal(E,I,S)(φ), of a RIF-BLD non-document formula φ combined with the following values for its properties [namespace name]: http://example.org/customertable [local name]: Name [children]:XML data in E and XML schema definitions in S, like a sequence of four character information items, spelling j o h nRIF BLD semantic structure, IBLD, in that order; [root]: same value asdetermines the [root] propertytruth value TValIBLD(φ), of a RIF-BLD non-document formula φ. The previous element information item; [attributes]: empty; [type name]: http://www.w3.org/2001/XMLSchema string [string value]: "John" [typed value]: "John" [is-id]: false; [is-idrefs]:false; an element information item representingmapping TVal(E,I,S) is defined from the Account sub-elementset of all non-document formulas to TV, the first Customer elementset of truth values in the document,I, as follows.

Definition (Truth valuation of RIF BLD non-document formulas combined with XML data). Truth valuation of RIF BLD non-document formulas combined with XML data is determined using the following valuesfunction TVal(E,I,S), such that for its properties [namespace name]: http://example.org/customertable [local name]: Account [children]:all RIF BLD+XMl data combination, <φ, E, S>, where φ is a sequence of three character information items, spelling 1 1 1non-document RIF BLD formula, TVal(E,I,S)(φ) = TValI(φ), in that order; [root]: same valuewhere TValI is as the [root] propertydefined in [RIF-BLD], section 3.4 - Interpretation of non-document formulas, with I being the previous element information item; [attributes]: empty; [type name]: http://www.w3.org/2001/XMLSchema integer [string value]: "111" [typed value]: 111 [is-id]: false; [is-idrefs]:false; an element information itemsemantic structure in the RIF BLD+XML data combined interpretation (E, I, S).  ☐

Example 2.2. Assuming that describesE contains all the second Customer elementdata model [nodes]XDM in the document; an element information item representingdata model instance that describes the Name sub-element ofXML sample fragment in example 2.1; that etable denotes the second Customerelement node, in E, that represents the document; an elementinformation item representingthat is serialized in the Account sub-element ofCustomerTable element, in the example XML fragment; and that eJohn denotes the second Customerelement node, in E, that represents the document; an elementinformation item representingthat is serialized in the Idfirst Customer sub-element of(the one whose Name sub-element contains John), the second Customer elementfollowing ground frames must be true in all the document; 4RIF combination with XML documents This section specifies, for some constructs ofBLD+XML data combined interpretations, (E, I, ), that is, where E is constructed from the RIF condition language, an interpretation with respect toinfoset only, and where IC(_John) = IDM(eJohn) and IC(_Table) = IDM(etable):

  1. _John ["@xml:lang" -> "en"]
  2. _John ["ex:Name" -> "John"]
  3. _John ["ex:Account" -> "111" ]
  4. _Table ["ex:Customer[1]" -> _John ]

Assuming that S contains all the instances oftop-level schema definitions in the sample schema in example 2.1, ground frames #1 and #3 above data model that representmust be false in all the importedRIF BLD+XML data sources.combined interpretations, (E, I, S), everything else being equal; instead, ground frames #1 and #2, below, must be true:

  1. _John ["@xml:lang" -> "en"^^xs:language]
  2. _John ["ex:Account" -> 111 ]

The specification provides, therefore,class membership formula #1, below, may be true in a means to combineRIF documents with XML documents, with or withoutBLD+XML data combined interpretation, (E, I, ), but, in the absence of an associated XML schema, as well as a mechanism to associate withschema definition, the string /ex:Customer does not represent a RIF document,component designator, and the data model that is assumed, in the interchanged rules, forclass membership formula has no meaning specific to the RIF BLD+XML data sources,combined interpretation. Howver, that same class membership formula must be true in every RIF BLD+XML data combined interpretations, (E, I, S):

  1. _John # "/ex:Customer"

On the form of an XML schema (orother hand, the class membership formula: _PIN_Jane # "/ex:PIN" must never be true as a setconsequence of XML schemas). Editor's Note: This draft suggests that XMLbeing interpreted under a RIF BLD+XML data combined interpretations, (E, I, S). Indeed, ex:PIN is importeddefined as RIF facts, buta simple type: as such it doesis not specify precisely how RIF data types, constants, lists and individuals relatein Classe(S) (nor in Classifiers(S)); but it is, instead, added to type names and atomic types, typed values, sequencesDTS.

Example 2.3. Consider the following element with mixed-content, where the prefix ex is associated with the IRI http://example.org/, and information itemsassume that an element [node]XDM, e, that represents it is included in E.

<ex:letterBody>
  Thank you for ordering the <ex:item>widget</ex:item>.
  It should arrive by <ex:arrivalDate>09-09-09</ex:arrivalDate>
</ex:letterBody>

The following fact must be true in any RIF BLD+XML data model, respectively; nor doescombined interpretation, (E, I, S), such that IC(_myLetter) = IDM(e):

Indeed, the element has a RIF variable can be bound to, or interpreted with respect tomixed content: per [XDM] (section 6.2), its [typed value]XDM is, therefore, its string value as an information item, beyond requiring thatxs;untypedAtomic, which is represented, per the information items indefinition of RIFValue, above, by that same [string value]XDM as an imported data model instance be partxs:string.

2.2.3 Combined interpretation of RIF BLD documents and XML data

For the domainpurpose of the interpretation of imported documents, RIF BLD defines the variable ( Section 4.2. Variables ). This whole section will be reworked, in a future draft, to provide a proper semantics fornotion of semantic multi-structures, which are nonempty sets, {J,I; Ii1, Ii2, ...}, of semantic structures that differ only in interpretation of local constants.

In the same way, a RIF-BLD+XML data combination <R, E, S>, is interpreted using a RIF BLD+XML data combined multi-interpretation (E, Î, S), where Î is a nonempty set, {J,I; Ii1, Ii2, ...}, of semantic structures that determine a non-empty set, {(E, J, S), (E, I, S); (E, Ii1, S), (E, Ii2, S), ...} of RIF documents with XMLBLD+XML data (a model-theoretic semantics for combinations involving RIF-Core and RIF-BLD documents, and an operational semantics for combinations involving RIF-Corecombined interpretations that differ only in interpretation of local constants.

To keep this document simple, and RIF-PRD documents). 4.1 Constants Any constantin athe same way the definition of truth valuation of RIF document can be interpretedBLD formulas combined with respectXML data, above, refers to atomic valuesthe definition of truth valuation in the RIF-BLD recommendation, the definition of a RIF BLD+XML data model instance. Somecombined multi-interpretation refers to the definition of a semantic multi-structure in [RIF-BLD].

Definition (RIF BLD+XML data combined multi-interpretation). A RIF constant, those withBLD+XML data combined multi-interpretation is a DM-Nametriple, (E, can also be interpretedÎ, S), where Î is a semantic multi-structures as defined in [RIF-BLD] (section 3.5 - Interpretation of documents), with respect tothe expanded QNamesadditional condition that represent element, attribute and type names infor each semantic suctrure, i Î, (E, i, S) is a RIF BLD+XML data model instance. 4.1.1 DM-Namescombined interpretation.  ☐

Similarly, the truth valuation of a RIF+XML data model relies on expanded-QNames to represent qualified names. However, RIF-Core has no built-in datatype for qualified names. In ordercombination <R, E, S>, is specified with reference to specifythe interpretationtruth valuation of a RIF constructs with respect to data model instances that describe importedBLD document formulas, using the RIF BLD+XML data sources, we define a mapping, DM-Namescombined multi-interpretation (E, from xs:string constants to expanded QNames, and we use that mapping to define the DM-NameÎ, S) in place of constants. Definition (DM-Names). DM-Names isa mapping from xs:string constants to expanded QNames . An xs:string constantRIF-BLD semantic multi-structure.

Definition (Truth valuation of the form [URI '#']? NAMERIF BLD document formulas combined with XML data). Truth valuation of RIF BLD document formulas combined with XML data is mapped to an expanded QName wheredetermined using the optional URI is the, possibly empty, namespace URI and NAMEfunction TVal(E,Î,S), such that for all RIF BLD+XML data combination <Ρ, E, S>, where Ρ is the local name, if and only if the substring URIa document RIF BLD formula, TVal(E,Î,S)(Ρ) = TValÎ(Ρ), if present,where TValÎ is an Universal Resource Identifieras defined in [ RFC 3986 ] and extended in [ RFC 3987 ] with a new name "IRI"; and the substring NAME isRIF-BLD], section 3.5 - Interpretation of documents, with Î being the form: NAME := [ xs:NCName | 'type(' xs:NCName ')' | 'list(' xs:NCName ')' | 'attribute(' xs:NCName ')'] For all the other xs:string constants,semantic multi-structure in the mapping is undefined.   ☐ Definition (DM-Name). Given aRIF constant, c , of type rif:iri or xs:NCName , and its representation as an xs:string ,BLD+XML data combined multi-interpretation (E, Î, S , for which the DM-Names mapping is defined,).  ☐

The DM-Namenotions of c is the expanded QName onto which DM-Names maps s . RIF constants that cannotmodel and of logical entailment can be cast into an xs:string for which the DM-Names mapping isdefined do not have a DM-Name.  ☐ By extension, given a constant, cfor whicha DM-Name is defined, we will writeRIF BLD+XML data combination, based on the namespace URIdefinitions of cmodel and the local nameof c to refer to the namespace URIlogical entailment for RIF BLD (document and local name components of c'non-document) formulas: (E, Î, S DM-Name, respectively. Editor's Note: The definition) is a model of DM-Namea RIF BLD+XML data combination <R, E, S>, if and only if Î is still under discussion. It would be preferable if only rif:iri constants had DM-Names, but that would exclude element and attribute names that are not in a namespace (sincea rif:iri must be an absolute IRI). An related issue is whether it would be useful to be able to relate an element/attribute name with an imported document, and how. Example 4.1. The DM-Name of the rif:iri constant <http://example.org/customertable#Customer> is an expanded QName where the namespace URI is http://example.org/customertable and the local name is Customer ; The DM-Namemodel of R, in the xs:string constant <myElement> is an expanded QName where the namespace URI is emptysense defined in [RIF-BLD] (section 3.6 - Logical entailment), and the local name(E, Î, S) is myElement ; The namespace URIa RIF BLD+Xml data combined multi-interpretation.

Definition (Model of the rif:iri constant <http://www.w3.org/2001/XMLSchema#type(date)> is http://www.w3.org/2001/XMLSchemaa RIF BLD+XML data combination). A RIF BLD+XML data combined multi-interpretation (E, and its local name is type(date) ; The namespace URI of the xs:string constant <attribute(myAttribute)> is empty, and its local nameÎ, S) is attribute(myAttribute) ; The DM-Namea model of the xs:string constant "http://example.org/customertable#Customer" is an expanded QNamea RIF BLD+XML data combination <R, E, S>, where the namespace URI is http://example.org/customertable and the local nameR is Customer ; The rif:iri constant <http://example.org/> has no DM-Name.   ☐ 4.1.2 Class names Constants that occur ina position where the identifierRIF BLD document or non-document formula, if and only if TVal(E,Î,S)(R) = t (true).  ☐

Definition (Logical entailment of a class is expected, e.g. inRIF class membershipBLD+XML data combination). Let φ and subclass relationship formulas, canψ be interpreted as identifying subsets of the element information items in the instances of(document or non-document) formulas. We say that a RIF BLD+XML data combination <φ, E, S> entails the RIF BLD+XML data combination <ψ, E, S>, denoted <φ, E, S> |= <ψ, E, S>, if and only if every model that describeof the importedRIF BLD+XML data sources. Given a constant, C , for which the DM-Namecombination <φ, E, S> is defined, and an instancealso a model of the RIF BLD+XML data model , I DM , let us call: C-set , the set that contains an element information item, N I DM , if and only if the local name in C 's DM-Name has the form type(NAME) , and, either the namespace URI and NAMEcombination <ψ, E, S>.  ☐

Notice that, in the DM-Name of C matches the namespace URIcase where E and local name in N'S [type name] property, respectively; or the type identified by the namespace URI and local name in N 's [type name] propertyare empty, that is, if a RIF-BLD formula is derived by restriction from the type identified by the namespace URI and NAME in C 's DM-Name; or the namespace URIcombined with an empty XML data set and the local name in the DM-Namean empty set of C match the [namespace name] andXML schema definitions, the [local name] propertiesinterpretation of Nthat RIF BLD formula under a RIF BLD+XML data combined multi-interpretation (, respectively; or N has been constructedÎ, ) is still different from a PSVI, andits interpretation under the element that it describes belongs to a substitution group, occursstandard RIF BLD semantics as defined in [RIF BLD].

Example 2.4. Let expr be a position where the schema requires the head element, and the head element's namespace URIwell-formed XPath 2.0 expression, and local name matchlet

Notice that <φ, ∅, ∅> |= <ψ, ∅, ∅>, provided that the namespace URI andpair (fn, http://www.w3.org/2005/xpath-functions) belongs to the local name instatically known namespaces when the DM-Name of C , respectively.XPath expressions are evaluated; but φ |≠ ψ. This specification does not prescribe anything with respect tois because the interpretationxs:string constants "expr", "fn:data(expr)" and "fn:data(.)" are interpreted as class identifiers, ofsimple string constants for whichunder the DM-Name is not defined. Given an XML document, D ,standard RIF BLD semantics, whereas they are interpreted according to the XPath 2.0 semantics under the setssemantics of element information items selected byRIF+XML data combination.

Editor's Note: An alternative, less conservative definition for logical entailment in a constant C from theRIF BLD+XML data model instancecombination would be: Let φ and ψ be (document or non-document) formulas. We say that describes D corresponds to the sequences of elements selected,φ entails ψ in D , by the following XPath 2.0 expressions, where prefix is bound to URI : /descendant::element(*, [prefix:]NAME )a RIF BLD+XML data combination if C has form [URI#]type(NAME) ; or /descendant:: [prefix:]NAME (or /descendant::schema-element( [prefix:]NAME )and only if the namespaceevery model (E, Î, S) of any RIF BLD+XML data combination <φ, E, S> is thatalso a model of an in-scope schema definition), if C has form [URI#]NAME . Example 4.2. With respect tothe RIF BLD+XML data model instance that describescombination <ψ, E, S>. The XML document from Section 3.6. Exampleuse cases for the broader definition remain to be examined.


2.3 Operational semantics of aRIF PRD+XML data model instance , above, If C stands forcombinations

The rif:iri constant <http://www.w3.org/2001/XMLSchema#type(integer)> ,effect on the C-set containsoperational semantics of a RIF PRD formula of the element information itemscombination with XML data, with or without an associated XML schema, is that represent the following elements, <Account>111</Account> <Account>222</Account> <Id>222</Id> If C stands forall the rif:iri constant <http://example.org/customertable#Name>ground facts that must be true under a RIF BLD+XML data combined interpretation, must be added to the C-set will contain the element information itemsset of ground facts that describe the following elements: <Name>John</Name> <Name>Jane</Name> Inrepresents the schema-less case, that is, ifstate of the data model instance has been constructed fromfact base.

Notice that, whereas the infoset, withoutother clauses affect only the XML schema being associated toinitial state of the XML document,fact base, clause 2 in the first example, above, the C-set would be empty: the information aboutdefinition of a element's type comes from the schema, andRIF BLD+XML data combined interpretation modifies the [type name] properties would be empty for allsemantics of the element information items inAssert action, when the data model instance; inaction asserts the second example, the C-set would be unchanged, because the [namespace name] and [local name] propertiesmembership of an element information item depend on the XML instance element that it describes, only. 4.1.3 Slot names Constants that occur ina position wherenew object in a slot's nameclass that is expected, e.g. in RIF frame formulas, can beinterpreted as identifying subsets of an element information item's [children] or [attributes] properties,a schema classifier. Indeed, clause 2, in the instancesdefinition, implies that the object in a membership relationship with an XML schema classifier (element or type) must interpret an instance of the data modelclass: that describeis, the imported data sources. Givennew member object must validate against the schema definition associated to the class. As a frame o [ slot -> v ] , where o identifies an element information itemconsequence, in the context of a RIF PRD+XML data model instance, andcombination, <R, E, S>,

Assert( object # ClassExpr )

where slot isClassExpr Classifiers(S), requires, as a RIF constantprerequisite, that, for whichall the DM-Name is defined, let us call: o/slot -sequenceXPath 2.0 expressions, expr, that select a mandatory sub-element or attribute of the sequence constructed as follows, after references have been resolved : ifclass, the local name in slot 's DM-Namefollowing fact be true:

object [ "expr" -> value ]

where value has the form attribute(NAME) , the o/slot -sequencea value that is the, possibly empty, subset ofvalid with respect to the [attributes] propertyschema definition of the element information item identified by o ,selected sub-element or attribute.

Formally, that means that contains only the attribute information items whose [namespace name] property matchesthe namespace URIdefinition of slot 's DM-Name, and whose [local name] property matches NAME ; else, the o/slot -sequence isthe possibly empty sub-sequence,RIF-PRD transition relation, defined in document order,[RIF-PRD] (section 3.2, Operational semantics of atomic actions), is modified as follows.

Let W denote the [children] propertyset of all the element information item identified by o , that contains only element information items whose [namespace name] property matchstates of the namespace URI in slot 's DM-Name,fact base, and whose [local name] property matches either the local name in slot 's DM-Name, or NAME , ifL denote the local name in slot 's DM-Name isset of form list(NAME) ; and element information items constructed from a PSVI, and such that the element that they represent belongs to a substitution group, occur in a position where the schema requires the head element, and the head element's namespace URI matchesall the namespace URIground atomic actions in slot 's DM-Name and its name matches eitherthe local nameRIF-PRD action language, as defined in slot 's DM-Name, or NAME[RIF-PRD].

Let, further, expr-valid<R,E,S>, if the local name in slot 's DM-Name is of form list(NAME) . Editor's Note: Shall we adddenote a property that contains the expanded QNames of the relevant substitution groups' heads in the element information item partof the data model? This specification does not prescribe anythinga constant, o Const, with respect to the interpretationa state of slot names for whichthe DM-Name is not defined. Given a XML instance element, Efact base, w W, the element information item that describes itin the context of a RIF PRD+XML data model instance, e ,combination <R, E, S>. We say that o is expr-valid<R,E,S> in w if and a constant, C , for whichonly if expr Classifiers(S) and all the DM-Namefollowing are true, where Φ is defined, the sequence of information items selected from e bya constantset of ground atomic formulas that represents w:

Definition (RIF-PRD transition relation in thea RIF-PRD+XML data model instance representedcombination). In Section 3.6 ); if slot stands for the rif:iri constant: <http://www.w3.org/XML/1998/namespace#attribute(lang)> , the o/slot -sequence contains, froma RIF-PRD+XML data combination <R, E, S>, the [attribute] propertysemantics of RIF-PRD atomic actions is specified by the transition relation <R,E,S> W × L × W. A triple (w, α, w') <R,E,S> if and only if w W, w' W, α is a ground atomic action, and

The element information items inoperational semantics of a RIF PRD+XML data model instance. Notice that, in this example, the o/slot -sequences remain unchangedcombination is, then, exactly as specified in the schema-less case introduced[RIF-PRD], except that <R,E,S> replaces RIF-PRD in example 4.2 : indeed, there are no substitution groups involved.  ☐ 4.2 Variables Forthe purposedefinition of interpreting RIF constructs that occur in a RIF document, D , with respect tothe imported data sources,transition relation, PRS, that is one of the domaincomponents of interpretationa RIF-PRD production rule system, PRS (cf. [RIF-PRD], Section 4.2.4, Operation semantics of a production rule system).

Notice, further, that, since RIF-PRD, unlike RIF-BLD, allows class membership to be asserted for new objects only, the variables declaredobject in D must include, at least: the data model instances that describesuch an assertion cannot have some or all the statically imported data sources,required properties already. As a consequence, all the mandatory properties must be asserted in the same action block where the class membership is asserted.

Formally, the consequence is that is,the combination with schema-valid XML data sources that are identifiedputs an additional well-formedness constraints on RIF-PRD action blocks.

Definition (Well-formed action block in a RIF-PRD+XML data combination). In a RIF-PRD+XML data combination <R, E, S>, an action block is well-formed if an only if it is a well-formed RIF-PRD action block, according to the definition in [RIF-PRD] (section 3.1.3 - Well-formed action blocks) and it satisfies the location part offollowing additional constraint:

Editor's Note: Strictly speaking, since actions are constructedordered in RIF-PRD action blocks, and since the operational semantics of atomic actions is defined with respect to a production rule system state, independently from the PSVI if D contains at least one Import directive wheresystem state being a system cycle state or a system transitional state, the location URIground frame formulas that are required to make o expr-valid<R,E,S> in a state of facts should be asserted before the membership formula is. However, it is missing andconjectured that the profile identifiesatomic actions in an XML schema; or fromaction block that satisfies the weaker constraint can, always, be re-orderd to satisfy the infoset, otherwise;stronger constraint, without otherwise affecting the value spacesemantics of allthe data types mentioned inaction block as a whole; whence the [type name] property of anyabsence of the information itemsordering constraint in the data model instances identified above. One way to guarantee that this requirement is satisfied is to embed the imported data sources as RIF facts in D , as specified (non-normatively) inabove definition.

See also the (non-normative) appendix C:on embedding importedXML data sourcesas RIF facts . 4.3 Class membership: rif:Member A class membership atom, o # C , where C standsfor a RIF constant whose DM-Name is defined, is true if o identifies onean exhaustive description of the element information items in the C -set constructed fromfacts to be added to the unioninitial state of the imported data model instances. Example 4.4. Continuingfact base that is to be combined with the exampleXML instance document from Section 3.6 , and the data model instance that describes it, and assuming that the following RIF class membership atoms occurdata.

Example 2.5. In a RIF document that importsRIF-PRD+XML data combination <R, E, S>, where S contains all the XML document, associated withtop-level definitions in the XML schema fromin example 2.1 (all the example: ?customer#"http://example.org/customertable#Customer" is true ifexamples assume that the variable ?customer is boundpair (ex, <http://example.org/customertable>) belongs to an element information item that describes one ofthe two Customer elements in[statically known namespaces]small>XP</small> when the imported XML document; 111#<http://www.w3.org/2001/XMLSchema#type(integer)> is always false, as farXPath and XSD-CD expressions are evaluated):

Do ((?newPin New())
    Assert(?newPin["self::ex:PIN"->999]) )
Do ((?newPin New())
    Assert(?newPin["self::ex:PIN"->"999"^^ex:PIN]) )

(ex:PIN is an integer, but whether 111 identifies an element information item that describes an element ofatomic type xs:integerdefined in the data model instance that describes an imported data source. 4.4 Sub-class relationship: rif:Subclass A sub-class relationship atom, s ## C , whereS and C stand for RIF constants whose DM-Name are defined,. As a consequence, it is true if,included, per clause 3 in the s -set is a subsetdefinition of a RIF BLD+XML data combined interpretation, in the C -set for any given instanceset of thedata model. Notetypes that the sub-class relationship atomare taken into account to interpret RIF formulas.)

Do ((?newPin New())
    Assert(?newPIN # "/ex:PIN") )

(Since ex:PIN is a simple type, the XSD-CD expression /ex:PIN is defined in RIF-BLD and RIF-PRD only,not in RIF-CoreClassifiers(S). Example 4.5. Assuming that the following RIF subclass relationship atoms occur inAs a RIF document that imports the XML document fromconsequence, the exampleclass membership assertion, in Section 3.6 : Perthe example 4.2 ,above, the subclass relationship atomadds no well-formedness constraint that is represented below in RIF-PRD/XML (or in RIF-BLD/XML) is true ifspecific to the RIF PRD+XML data model instance is constructed fromcombination: its semantics are standard.)

Do ((?newCust New())
    Assert(?newCust # "/ex:Customer")
    Assert(?newCust["ex:Name"->"Jojo"])
    Assert(?newCust["ex:Account"->1111])
    Assert(?newPin["ex:PIN"->999])
    Assert(?newCust["@xml/lang"->"fr"^^xs:language]) )
Do ((?newCust New())
    Assert(?newCust # "/ex:Customer")
    Assert(?newCust["ex:Name"->"Jojo"])
    Assert(?newCust["ex:Account"->1111])
    Assert(?newCust["@xml/lang"->"fr"^^xs:language]) )
Do ((?newCust New())
    Assert(?newCust # "/ex:Customer")
    Assert(?newCust["ex:Name"->"Jojo"])
    Assert(?newCust["ex:Account"->1111])
    Assert(?newPin["ex:PIN"->-5])
    Assert(?newCust["@xml/lang"->"fr"^^xs:language]) )

(-5 is out of range for an ex:PIN value)

Do ((?newCust New())
    Assert(?newCust # "/ex:Customer")
    Assert(?newCust["ex:Name"->"Jojo"])
    Assert(?newCust["ex:Name"->"Le balafré"])
    Assert(?newCust["ex:Account"->1111])
    Assert(?newCust["@xml/lang"->"fr"^^xs:language]) )

(The schema from the example. Itdefinition requires a single ex:Name value for each ex:Customer information item).

2.4 Semantics of RIF Core+XML data combinations

RIF Core is false in the schema-less case introduced in example 4.2 , however, since, in that case,a syntactic subset of RIF BLD, and the super-classsemantics of RIF Core+XML data combinations is always empty: <Subclass> <sub> <Const type=" xs:string ">http://example.org/customertable#Account</Const> </sub> <super> <Const type=" rif:iri ">http://www.w3.org/2001/XMLSchema#type(integer)</Const> </super> </Subclass>identical to the subclass relationship atomsemantics of RIF BLD+XML data combinations for that subset.

RIF Core is represented below in RIF-PRD/XML (or in RIF-BLD/XML) is false, as far as this specification is concerned, ifalso a syntactic subset of RIF PRD, and the semantics of RIF Core+XML data model instance is constructed from the PSVI. However, itcombinations is true if the data model instance has been constructed fromalso identical to the infoset (and no othersemantics of RIF PRD+XML data source is imported), although an xs:integer element can never be an xs:string element as well:combinations for that is because both classes are empty,subset.

3 Importing XML data and XML schemas in that case. Indeed,RIF

In RIF, the subclass relationship tests thatImport directive is used to communicate the setlocation of an external document to be combined with the xs:integer elements inRIF document that contains the imported data sources is containeddirective and, optionally, a profile that governs the combination.

In [RIF-Core], [RIF-PRD] and [RIF-BLD], the setuse of the xs:string elements in the same imported data sources; not whether xs:integerImport directive is a subtype of xs:string : <Subclass> <sub> <Const type="xs:string">http://www.w3.org/2001/XMLSchema#type(integer)</Const> </sub> <super> <Const type="rif:iri">http://www.w3.org/2001/XMLSchema#type(string)</Const> </super> </Subclass> 4.5 Frames: rif:Frame A frame olimited to identifying an imported RIF document. [ slot -> vRIF-RDF-OWL] , where o identifiesextends it to permit the identification of an element information item inRDF graph or an imported data model instance, and where v identifies a constant whose DM-Name is defined, is true either if the local name in slot DM-Name has the form list(NAME) and v isOWL ontology to be combined with a RIF listdocument. An optional profile that containsgoverns the typed valuecombination of all the information items in the o/slot -sequence , ina RIF document order;with an RDF graph or if v matchesan OWL ontology can also be provided, as specified in [RIF-RDF-OWL].

This specification extends the [typed value] property of, at least, oneImport directive further to permit the identification of XML data and/or XML schemas to be combined with a RIF document.

One use case for the information items incombination of RIF and XML data is when a RIF document imports explicitly the o/slot -sequence . Example 4.6. Continuingdata with which the previous example :rules are to be combined: in that case, the frame ?x[<http://example.org/customertable#Customer> -> ?y] is true if ?xcombination is bound toimposed by the element information item that representsproducer of the root CustomerTable element, inRIF document, as well as the importeddata source, and if ?y is boundto one ofbe combined with the two element information itemsrules that describe its two Customer sub-elements, inthe data model instance.RIF document contains. We call that is becausecase: producer-side combination, and the element Customer hasXML data to be combined with the RIF document: imported XML data.

However, a complex typesignificant use case for RIF is rules being published or shared as a RIF document for consumers to combine them with element only content:their own data: in that case, the [typed value] propertyconsumer of a RIF document decides independently of the information item that describes it points, therefore,producer to combine the information item itself. Forrules contained in the same reason (element-only children),RIF document with the valuedata of his choice. We refer to that case as: consumer-side combination, and to the framedata that is combined with a RIF document as: consumer-side data.

3.1 The same in the schema-less case, introduced in example 4.2 ;extended Import directive

Specifically, the frame ?x[<http://example.org/customertable#list(Customer)> -> ?y]Import directive is true, forextended as follows:

The type offollowing constraints must be satisfied:

This specification is concerned, because "111" is an xs:string , whereasdoes not prescribe the schema typebehaviour of a conformant implementation when one of the Account elementabove constraints is xs:integer . However, the frame would be true, in the schema-less case, since onlynot satisfied.

This specification does not prescribe the string-valuebehaviour of the Account element would be known,a conformant implementation when an Import directive contains a location that is neither http://www.w3.org/2007/rif-import-location#consumer-side-data nor an IRI that identifies an XML document. And this specification does not its type;prescribe the frame ?y[<http://www.w3.org/XML/1998/namespace#attribute(lang)> -> "en"^^xs:language]behaviour of a conformant implementation when an Import directive contains a profile that is true, inneither http://www.w3.org/2007/rif-import-profile#xml-data nor an IRI that identifies an XML schema.

Example 3.1. The example, if ?yfirst three import directives, below, are valid; the fourth is bound tonot:

  1. Import(http://example.org/customertable.xml http://www.w3.org/2007/rif-import-profile#xml-data)
  2. Import(http://example.org/customertable.xml http://example.org/customertable.xsd)
  3. Import(http://www.w3.org/2007/rif-import-location#consumer-side-data http://example.org/customertable.xsd)
  4. Import(http://www.w3.org/2007/rif-import-location#consumer-side-data http://www.w3.org/2007/rif-import-profile#xml-data)

The element information itemfirst directive says that represents the Customer element with Name "John", inthe imported XML document. This holdsrules in the schema-less case as well.  ☐ Example 4.7. Consider the following elementimporting RIF document are to be combined with a mixed-content: <letterBody> Thank you for orderingthe <item>widget</item>. It should arrivedata in the XML document identified by <arrivalDate>09-09-09</arrivalDate> </letterBody> Assume thatthe element is contained in a data sourceIRI: http://example.org/customertable.xml and that there is no data model associated with the imported data in a RIF document, and assumethe form of an XML schema.

The second directive says that the RIF variable ?v , occurringrules in thatthe importing RIF document, is bounddocument are to an element information item that describes, inbe combined with the data model instance, the parent element of the above letterBody element.in the value ofXML document identified by the frame ?x["letterBody"->?y] will be true isIRI: http://example.org/customertable.xml and only if ?ythat there is bound toa string constant that contains the following text: "Thank you for orderingdata model associated with the Widget. It should arrive by 09-09-09" ; that is,imported data, in the string valueform of the information itemXML schema that describesis identified by the letterBody element. Indeed, if an element has a complex typeIRI: http://example.org/customertable.xsd.

The third directive says the data that is combined with mixed content (including xs:anyType ), its typed valuethe rules is its string value.   ☐ 4.6 Atoms: rif:Atomexpected to be an atom, P(a 1 ... n ) , n 0 , where P stands for a RIF constant whose DM-Name is defined, is true if there is, at least, one element information item, e , in the P -set constructed from the unioninstance of the importeddata model instances, suchthat the [typed value] property of e points to e itself; and nis imported as the number of items inXML schema identified by the [children] property of eIRI: http://example.org/customertable.xsd; andbut the a i match, respectively,directive does not say what data is to be combined with the [typed value] properties of each ofrules.

The element information items infourth directive violates the [children] property of efirst and second constraints: the dummy location consumer-side-data, in document order, afterthat indicates that the references have been resolved . Editor's Note:profile is that one useful? If we decideto keep it, it needs some more work. E.g., dealing with missing children elements (when minOccur = 0); dealingbe applied to consumer-side data, is incompatible with the fact that P can occur both inprofile xml-data. Therefore, the positiondirective is out of a class identifier in a membership or subclass relationship formula, or asthe namescope of a relation in an atom; etc. A atom with named arguments, P((name 1 a 1 ) ... (name n n )) , n 0 , where P standsthis specification.

3.2 Interpretation of Imports

For the purpose of interpreting the combination of a RIF constant whose DM-Name is defineddocument, R, and eachXML data, let dataLocation(R) denote the set of the name i are RIF names whose DM-Name is defined, is true if there is, at least, one element information item, e ,URIs in the P -set , such that the [typed value] propertylocation sub-elements of e points to e itself;the import directives, in R and each a i matchesin the sequence ofRIF documents that are imported, directly or indirectly, in R, whose profile is either rif:xml-data or identifies an XML schema; and let dataDocuments(R) denote the typed values of eachset of the information itemsdocument [nodes]XDM in the e/ name i -sequence , in document order. Noteinstances of the data model that encapsulate the orderinformation in which the (name i a i ) pairs occur does not affect the truth value ofall the atom. NoteXML documents that atoms with named arumentsare defined only in RIF-BLD , not in RIF-Core noridentified by an URI in RIF-PRDdataLocation(R). Editor's Note:If that is deemed useful, it needs some more work, e.g. extendingdataLocation(R) contains the definition of DM-Name to RIF names, dealing with P occurring both indummy URI http://www.w3.org/2007/rif-import-location#consumer-side-data, dataDocuments(R) includes, also, the position of a class identifierdocument [node]XDM in a membership or subclass relationship formula, andan instance of the data model that encapsulates the consumer-side data. In the absence of consumer-side data, the document node bears no information.

If an Import directive identifies an XML schema as its profile, the namecorresponding instance of a relationthe data model includes the information from the PSVI that results from validating the XML data referenced in the location against that schema. Otherwise, the instance of the data model is built from the infoset.

If an atom; etc. Example 4.8. TBC 5 Conformance Editor's Note: This section will be completed inImport directive has the value: http://www.w3.org/2007/rif-import-location#consumer-side-data as a future draft. 6locator, the special caseinstance of RDF and OWLthe data sources Editor's Note: RDF an dOWLmodel that encapsulates the consumer-side data, if any, includes the information from the PSVI that results from validating the data sources can be imported in RIF documentsagainst the XML schema identified in twothe profile of that directive.

As a consequence, if different ways: accordingImport directives associate different XML schemas to the RIF-RDF-OWL specification, that specifiesconsumer-side data, the combinationinstance of RIF documents with RDF and OWL graphs, directly; or asthe data model that encapsulates the consumer-side data, if any, includes the information from the PSVI that results from validating the data against the XML document. This section examines how this two ways ofschema that results from importing RDF and OWL documents relate.or including, into an otherwise empty schema, all the section will be completedXML schemas identified in the profile sub-elements of Import directives with the value: http://www.w3.org/2007/rif-import-location#consumer-side-data as a future draft. 7 References [Infoset] XML Informationlocator.

Given a RIF document, R, the set (Second Edition)of data model nodes, E, John Cowan and Richard Tobin, Editors. World Wide Web Consortium, 04 Feb 2004. This version is http://www.w3.org/TR/2004/REC-xml-infoset-20040204 .in the latest versionRIF+XML data combination <R, E, S> is the set of all the document nodes in dataDocuments(R), and of all the data model nodes that can be reached from those document nodes.

In the same way, S, the schema definitions component in the RIF+XML data combination <R, E, S>, includes all the top level schema definitions found in the XML schemas that are imported as the profile of an import directive in R or in a RIF document that is imported, directly or indirectly, in R.

For the purpose of evaluating XPath 2.0 expressions, when interpreting a RIF+XML data combination <R, E, S>, the [in-scope schema definitions]XP include all the schema definitions in S, all the schema type, schema element and schema attribute definitions that are components of the top level definitions in S, and all the schema types defined in [XSD 1.1 Part2].

Example 3.2. Continuing example 3.1, above, notice that none of the three valid directives is incompatible with the other two, but that combining the first two is confusing and error-prone, since directive #2 supersedes directive #1. Including effectively useless directives should be avoided.

Combining directive #2 and #3 says that the rules in the importing document are meant to be applied only to data that validates against the XML schema in example 2.1, where the data is imported or from the consumer-side.

4 Conformance

Editor's Note: This section will be completed in a future draft.

5 References

[Infoset]
XML Information Set (Second Edition), John Cowan and Richard Tobin, Editors. World Wide Web Consortium, 04 Feb 2004. This version is http://www.w3.org/TR/2004/REC-xml-infoset-20040204/. The latest version is available at http://www.w3.org/TR/xml-infosethttp://www.w3.org/TR/xml-infoset/.

[RFC 3986]
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, T. Berners-Lee, R. Fielding, and L. Masinter. January 2005. Available at: http://www.ietf.org/rfc/rfc3986.txt

[RFC 3987]
RFC 3987: Internationalized Resource Identifiers (IRIs), M. Duerst and M. Suignard. January 2005. Available at: http://www.ietf.org/rfc/rfc3987.txt

[RIF-Core]
RIF Core Dialect Harold Boley, Gary Hallmark, Michael Kifer, Adrian Paschke, Axel Polleres, Dave Reynolds, eds. W3C Editor's Draft, 11 May22 June 2010, http://www.w3.org/2005/rules/wg/draft/ED-rif-core-20100511/http://www.w3.org/2005/rules/wg/draft/ED-rif-core-20100622/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-core/.

[RIF-BLD]
RIF Basic Logic Dialect Harold Boley, Michael Kifer, eds. W3C Editor's Draft, 11 May22 June 2010, http://www.w3.org/2005/rules/wg/draft/ED-rif-bld-20100511/http://www.w3.org/2005/rules/wg/draft/ED-rif-bld-20100622/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-bld/.

[RIF-DTB]
RIF Datatypes and Built-Ins 1.0 Axel Polleres, Harold Boley, Michael Kifer, eds. W3C Editor's Draft, 22 June 2010, http://www.w3.org/2005/rules/wg/draft/ED-rif-dtb-20100622/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-dtb/.

[RIF-PRD]
RIF Production Rule Dialect Christian de Sainte Marie, Gary Hallmark, Adrian Paschke, eds. W3C Editor's Draft, 11 May22 June 2010, http://www.w3.org/2005/rules/wg/draft/ED-rif-prd-20100511/http://www.w3.org/2005/rules/wg/draft/ED-rif-prd-20100622/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-prd/.

[RIF-RDF-OWL]
RIF RDF and OWL Compatibility Jos de Bruijn, editor. W3C Editor's Draft, 11 May22 June 2010, http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20100511/http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20100622/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-rdf-owl/.

[XDM]
XQuery 1.0 and XPath 2.0 Data Model (XDM), M. Fernández, A. Malhotra, J. Marsh, M. Nagy, N. Walsh, Editors. W3C Recommendation 23 January 2007. This version is http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/. The latest version is available at http://www.w3.org/TR/xpath-datamodel/.

[XML] Extensible Markup Language (XML)[XFO]
XQuery 1.0 and XPath 2.0 Functions and Operators, Ashok Malhotra, Jim Melton, and Norman Walsh, Editors. World Wide Web Consortium, 23 Jan 2007. This version is http://www.w3.org/TR/2007/REC-xpath-functions-20070123/. The latest version is available at http://www.w3.org/TR/xpath-functions/.

[XML]
Extensible Markup Language (XML) 1.0 (Fifth Edition), T. Bray, J. Paoli, C. M. Sperberg-McQueen, E. Maler, F. Yergeau, Editor. W3C Recommendation 26 November 2008. This version is http://www.w3.org/TR/2005/REC-xml-id-20050909/http://www.w3.org/TR/2005/REC-xml-id-20050909/. The latest version is available at http://www.w3.org/TR/REC-xml/.

[xml:id]
xml:id Version 1.0, J. Marsh, D. Veillard, N. Walsh, Editors. W3C Recommendation 9 September 2005. This version is http://www.w3.org/TR/2008/REC-xml-20081126/. The latest version is available at http://www.w3.org/TR/xml-id/.

[XPath 2.0]
XML Path Language (XPath) 2.0, D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This version is http://www.w3.org/TR/2007/REC-xpath20-20070123/. The latest version is available at http://www.w3.org/TR/xpath20/.

[XQuery 1.0]
XQuery 1.0: An XML Query Language, D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This version is http://www.w3.org/TR/2007/REC-xquery-20070123/. The latest version is available at http://www.w3.org/TR/xquery/.

[XSD 1.1 Part 1]
W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures, S. Gao, C. M. Sperberg-McQueen, H. S. Thompson, Editors. W3C Working Draft, 3 December 2009. This version is http://www.w3.org/TR/2009/WD-xmlschema11-1-20091203/. The latest version is available at http://www.w3.org/TR/xmlschema11-1/.

[XSD 1.1 Part 2]
W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes, D. Peterson, S. Gao, A. Malhotra, C. M. Sperberg-McQueen, H. S. Thompson, Editors. W3C Candidate Recommendation 30 April 2009. This version is http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/. The latest version is available at http://www.w3.org/TR/xmlschema11-2/.

[XSD-CD]
W3C XML Schema Definition Language (XSD): Component Designators, , Editors. W3C Candidate Recommandation 19 January 2010. W3C Recommendation 23 Jan 2007. This version is http://www.w3.org/TR/2010/CR-xmlschema-ref-20100119/. The latest version is available at http://www.w3.org/TR/xmlschema-ref/.

6 Appendix A: Glossary (non-normative)

Editor's Note: This section will be completed in a future draft.


component-kind() (from [XSD-CD], section 4.5.1)
The component-kind accessor returns an expanded name identifying the kind of the schema component.

component-name() (from [XSD-CD], section 4.5.2)
The component-name accessor returns zero or one xs:QName values giving the name of the component.

Context node (from [XPath 2.0], section 2.1.1)
The context item is the item currently being processed. An item is either an atomic value or a node. When the context item is a node, it can also be referred to as the context node.

Declared type (from [XDM], section 3.3.1.1)
The precise definition of the schema type of an element or attribute information item depends on the properties of the PSVI. In the PSVI, Schema Part 1 defines a [type definition] property as well as the [type definition namespace], [type definition name] and [type definition anonymous] properties, which are effectively short-cut terms for properties of the type definition. Further, the [element declaration] and [attribute declaration] properties are defined for elements and attributes, respectively. These declarations in turn will identify the [type definition] declared for the element or attribute. To distinguish the [type definition] given in the PSVI for the element or attribute instance from the [type definition] associated with the declaration, the former is referred to below as the actual type and the latter as the declared type of the element or attribute instance in question.

derived-from (from [XPath 2.0], section 2.5.4)
[The] pseudo-function named derives-from(AT, ET) [...] takes an actual simple or complex schema type AT and an expected simple or complex schema type ET, and either returns a boolean value or raises [an error].

Document order (derived from [XDM], section 2.4)
A document order is defined among all the element information items that describe a given XML document. Document order is a total ordering. Informally, document order is the order in which nodes appear in the XML serialization of a document.

fn:data (from [XFO], section 2.4)
fn:data takes a sequence of items and returns a sequence of atomic values.
The result of fn:data is the sequence of atomic values produced by applying the following rules to each argument:

fn:string (from [XFO], section 2.3)
fn:string returns the latest version is available at http://www.w3.org/TR/REC-xmlvalue of its arguments represented as a xs:string. [xml:id] xml:id Version 1.0 , J. Marsh, D. Veillard, N. Walsh, Editors. W3C Recommendation 9 September 2005. This versionIf no argument is http://www.w3.org/TR/2008/REC-xml-20081126/ .supplied, the latest version[context item]XP is available at http://www.w3.org/TR/xml-id . [XPath 2.0] XML Path Language (XPath) 2.0 , D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This versionused as the default argument. The behavior of the function if the argument is http://www.w3.org/TR/2007/REC-xpath20-20070123/ .omitted is exactly the latest versionsame as if the [context item]XP had been passed as the argument.
If the [context item]XP is available at http://www.w3.org/TR/xpath20/ . [XQuery 1.0] XQuery 1.0:undefined, an XML Query Language , D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This versionerror is http://www.w3.org/TR/2007/REC-xquery-20070123/ .raised.
If the latest versionlist of arguments is available at http://www.w3.org/TR/xquery/ . [XSD 1.1 Part 2] W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes , D. Peterson, S. Gao, A. Malhotra, C. M. Sperberg-McQueen, H. S. Thompson, Editors. W3C Candidate Recommendation 30 April 2009. This versionthe empty sequence, the zero-length string is http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/ .returned.
If the latest versionargument is available at http://www.w3.org/TR/xmlschema11-2/ . 8 Appendix A: Glossary (non-normative) Editor's Note: This section will be completed ina future draft. 9 Appendix B: Extract fromnode, the XQuery 1.0 and XPath 2.0 Data Model (non-normative) 9.1 Element and attribute node type names (from [function returns the [string-value]XDM ]) Editor's Note: This section reproducesof the textnode.
If the argument is an atomic value, then the function returns the value of Section 3.3.1.1. Element and Attribute Nodethe argument cast as a xs:string.

Governing type Names indefinition (from [ XDMXSD 1.1 Part 1], section 3.2.4.2 for the reader's convenience. Notice that,an attribute, section 3.3.4.6 for an element)
The purpose of this specification, thegoverning type name is considered unknown, and the [type name] propertydefinition of an attribute, in a given schema-validity ·assessment· episode, is left empty, whenthe [validaty] property does not exist or is "unknown" and{type definition} of the [validation attempted] property does not exist or is "none".·governing attribute declaration·, unless the preciseprocessor has stipulated another type definition at the start of ·assessment· (see Assessing Schema-Validity (§5.2)), in which case it is the schemastipulated type definition.
The governing type definition of an element or attributeinformation item depends on the properties of the PSVI.E, in the PSVI, [Schema Part 1] definesa [type definition] property as well asgiven schema-validity ·assessment· episode, is the [type definition namespace], [type definition name] and [type definition anonymous] properties, which are effectively short-cut terms for propertiesfirst of the following which applies:
  1. An ·instance-specified type definition. Further, the [element declaration] and [attribute declaration] properties are defined for elements and attributes, respectively. These declarations in turn will identify the [type definition] declared for the element or attribute. To distinguish the [type definition] given indefinition· which ·overrides· a type definition stipulated by the PSVI forprocessor (see Assessing Schema-Validity (§5.2)).
  2. A type definition stipulated by the element or attribute instance fromprocessor (see Assessing Schema-Validity (§5.2)).
  3. An ·instance-specified type definition· which ·overrides· the [type definition] associated with·selected type definition· of E.
  4. The declaration,·selected type definition· of E.
  5. The formervalue ·absent· if E is referred to below as the actual·skipped·.
  6. An ·instance-specified type anddefinition· which ·overrides· the latter as·locally declared type·.
  7. The ·locally declared type·.
  8. An ·instance-specified type definition·.
If none of these apply, there is no ·governing type definition· (or, in equivalent words, it is ·absent·).


In-scope schema definitions (from [XPath 2.0], section 2.1.1)
This is a generic term for all the element ordeclarations, attribute instance in question. Thedeclarations, and schema type depends ondefinitions that are in scope during processing of an expression.] It includes [the In-scope schema types, the declared type,In-scope element declarations, the actual type,substitution groups and the [validity] and [validation attempted] propertiesIn-scope attribute declarations].


Node (from [XDM], section 2.1)
(from [XDM], section 2.1) There are seven kinds of Nodes in the PSVI. If: The [validity]data model: document, element, attribute, text, namespace, processing instruction, and [validation attempted] properties existcomment.
(from [XPath 2.0], section 2) Each node has a unique node identity, a typed value, and a string value. In addition, some nodes have a name. The values "valid" and "full", respectively,typed value of a node is a sequence of zero or more atomic values. The schemastring value of a node is a value of type xs:string. The name of a node is a value of type xs:QName.

Normalized value (from [XSD 1.1 Part 1], section 3.1.4)
The normalized value of an element or attribute information item is represented byan expanded-QName whose namespace and local name correspondinitial value which has been normalized according to the first applicable items in the following list: Ifvalue of the declared type exists and is a unionwhiteSpace facet, and the actual type is (not the same asvalues of any other pre-lexical facets, associated with the declared type, and not asimple type derived from the declared type, but) one ofdefinition used in its validation.
The member typesinitial value of an attribute information item is the union, or derived from one of its member types: Ifnormalized attribute value, as specified in [XML], section 3.3.3 (Attribute-value normalization). Similarly, the {name} propertyinitial value of the declared typean element information item is present:the {target namespace} and {name} propertiesstring composed of, in document order, the character code of each character information item in the declared type.[children]info of that element information item.

Schema normalized value (from [XSD 1.1 Part 1], section 3.2.5.4 for attributes, section 3.3.5.4 for elements)
If an attribute's normalized value is valid with respect to the {name} property of the declaredgoverning type is absent:definition, then the namespace and local nameschema normalized value of the anonymous type name supplied forattribute is the declared type.normalized value as validated, otherwise it is absent.
If therean element information item is no declared type,not nilled and either the actualgoverning type definition is a union, then: Ifsimple type definition or its {content type} has {variety} simple, then the {name} propertyschema normalized value of the actual typeelement is present:the {target namespace} and {name} propertieslexical form of the actual type.its value constraint if applicable; else, if the {name} property ofelement's initial value is valid with respect to the actualsimple type definition as defined by String Valid ([XSD 1.1 Part 1], section 3.16.4), then the schema normalized value is absent:the namespace and local namenormalized value of the anonymous type name supplied for the actual type. Otherwise: If [type definition anonymous]item as validated; otherwise it is absent.

Statically-known namespaces (from [XPath 2.0], section 2.1.1)
This is false:a set of (prefix, URI) pairs that define all the {target namespace} and {name} propertiesnamespaces that are known during static processing of a given expression.

String value
The actual type. If [type definition anonymous]string value of a node is true:a string and can be extracted by applying the namespacefn:string function to the node.
(from [XDM], section 3.3.1.3) Element and local name ofattribute nodes have both typed-value and string-value properties. However, implementations are allowed some flexibility in how these properties are stored. An implementation may choose to store the anonymous type name supplied forstring-value only and derive the actual type.typed-value from it, or to store the [validity] property existstyped-value only and is "invalid",derive the string-value from it, or to store both the [validation attempted] property existsstring-value and is "partial",the schema typetyped-value.
In order to permit these various implementation strategies, some variations in the string value of an element is xs:anyType anda node are defined as insignificant. Implementations that store only the typetyped value of an attributea node are permitted to return a string value that is xs:anySimpleType.different from the [validity] property exists and is "notKnown", andoriginal lexical form of the [validation attempted] property exists and is "none",node content.

type-axis() (from [XSD-CD], section 4.4.5)
The schematype of an element is xs:untypedaxis contains simple type definition and thecomplex type of an attribute is xs:untypedAtomic.definition components linked to the [validity]current component through {type definition}, {type definitions}, {content type}, or [validation attempted] properties do not exist, the schema{simple type of an element is xs:untyped anddefinition} arcs

Typed value
The typetyped value of an attributea node is xs:untypedAtomic.a sequence of atomic values and can be extracted by applying the prefix associated withfn:data function to the type names is implementation-dependent. 9.2 Typed value determinationnode.
(from [XDM ])], section 3.3.1.2) This section describes how the typed value of an Element or Attribute Node is computed from an element or attribute PSVI information item, where the information item has either a simple type or a complex type with simple content. [...]
The typed value of Attribute Nodes and some Element Nodes is a sequence of atomic values. The types of the items in the typed value of a node may differ from the type of the node itself. This section describes how the typed value of a node is derived from the properties of an information item in a PSVI.[...]
The types of the items in the typed value of a node are determined as follows. The process begins with T, the schema type of the node itself, as represented in the PSVI. For each primitive or ordinary simple type T, the W3C XML Schema specification defines a function M mapping the lexical representation of a value onto the value itself.
Note. For atomic and list types, the mapping is the “lexical mapping” defined for T in [Schema Part 2]; for union types, the mapping is the lexical mapping defined in [Schema Part 2] modified as appropriate by any applicable rules in [Schema Part 1]. The mapping, so modified, is a function (in the mathematical sense) which maps to a single value even in cases where the lexical mapping proper maps to multiple values.The typed value is determined as follows:
The typed value determination process is guaranteed to result in a sequence of atomic values, each having a well-defined atomic type.

This sequence of atomic values, in turn, determines the typed-value property of the node in the data model. 107 Appendix C:B: Embedding imported data sources as RIF facts (non-normative)

Editor's Note: This section will be completed in a future draft.

118 Appendix C: Examples using the normative RIF/XML syntax

Editor's Note: This section will be completed in a future draft

9 Appendix D: Change Log (non-normative)

Since the WD published 22 June 2010: