W3C

RIF Combination with XML data

W3C Working Draft 22 June 2010Group Note 28 October 2012

This version:
http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/http://www.w3.org/2005/rules/wg/draft/ED-rif-xml-data-20121028/
Latest version: http://www.w3.org/TR/rif-xml-data/editor's draft:
http://www.w3.org/2005/rules/wg/draft/rif-xml-data/
Previous version:
http://www.w3.org/TR/2010/WD-rif-xml-data-20100511/ ( color-coded diff )http://www.w3.org/2005/rules/wg/draft/WD-rif-xml-data-20100622/
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.

Status of this Document

May Be Superseded

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is being published as one of a set of 1112 documents:

  1. RIF Overview
  2. RIF Core Dialect
  3. RIF Basic Logic Dialect
  4. RIF Production Rule Dialect
  5. RIF Framework for Logic Dialects
  6. RIF Datatypes and Built-Ins 1.0
  7. RIF RDF and OWL Compatibility
  8. OWL 2 RL in RIF
  9. RIF Combination with XML data (this document)
  10. RIF In RDF
  11. RIF Test Cases
  12. XML Schema Datatypes DependencyRIF is defined to use datatypes defined in the XML Schema Definition Language (XSD) . AsPrimer

Summary of this writing, the latest W3C Recommendation for XSD is version 1.0, with version 1.1 progressing toward Recommendation. RIF hasChanges

There have been designed to take advantage ofno substantive changes since the new datatypes and clearer explanations available in XSD 1.1, butprevious version. For now those advantages are being partially putdetails on hold. Specifically, until XSD 1.1 becomes a W3C Recommendation,the elements of RIF which are based on it should be considered optional , as detailed in Datatypes and Builtins, section 2.3 . Uponminor changes see 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 developerschange log and users follow the XSD 1.1 Last Call Working Draftcolor-coded diff.

Based on discussions between the Schema, RIF and OWL Working Groups, we do not expectPlease Send Comments

Please send any implementation changes will be necessary as XSD 1.1 advancescomments to Recommendation. Summary of Changes The semantics were completely reworked. Please Commentpublic-rif-comments@w3.org (public archive). Although work on this document by 20 July 2010the Rule Interchange Format (RIF) Working Group seeks public feedback on this Working Draft. Please send youris complete, comments to public-rif-comments@w3.orgmay be addressed in the errata or in future revisions. Open discussion among developers is welcome at public-rif-dev@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 Working DraftGroup Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Patents

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


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 combinations of RIF documents and XML data, possibly associated with XML schemas, are interpreted.

Extensible Markup Language (XML) is a simple, flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere. The XML Schema Definition Language offers facilities for describing the structure and constraining the contents of XML documents. The schema language, which is itself represented in an XML vocabulary, provides a way to describe and to share the data model that is associated with the data in an XML document.

This document specifies a standard semantics for combinations of RIF documents and XML data. It uses a data model fordata, with or without an associated XML documents, that is a simplified version ofschema. The specification relies on the abstract XQuery 1.0 and XPath 2.0 Data Model [XDM ]. The XQuery 1.0 and XPath 2.0 Data Model (XDM) specifies] to specify what information is accessible in a collectionthe data, and on XPath 2.0 expressions [XPath 2.0] to select pieces of XML documents, butthat information. It does not specify the language usedrelies on XML Schema Component Designators [XSD-CD] expressions to represent or accessprovide unambiguous designators for XML schema types and schema elements in combinations where the data: this document specifiesXML data is associated with an implementation, using the RIF condition language, ofXML schema.

XPath 2.0 is a simplified version of the XDM. This makes the RIF conditionnon-XML expression language comparable to other implementationsthat allows the processing of values conforming to the XDM, such as [ XPath 2.0 ] anddata model defined in [ XQuery 1.0XDM]. LikeThe XQuery 1.0 andresult of an XPath 2.0expression may be a selection of nodes from the input data Model ,model, or an atomic value, or more generally, any sequence allowed by the simplified version used in this document supportsdata model. The following classesname of XML documents: Well-formed documents conforming to [Namespaces in XML] or [Namespaces in XML 1.1]. DTD-valid documents conforming to [Namespaces in XML] or [Namespaces in XML 1.1], and W3C XML Schema-validated documents. Accordingly, this document specifies howthe language derives from its most distinctive feature, the path expression, which provides a RIF document is combined with well-formed, and, wheremeans of hierarchic addressing of the nodes in an XML tree.

XML Schema Component Designators (XSD-CD) is specified, schema-valida non-XML expression language that provides reliable and unambiguous designators for XML documents.schema components. The semantics is independent onspecification divides the provenanceproblem of the XML data inconstructing schema component designators into two parts: defining a combination: it can be imported explicitly indesignator for an assembled schema, and defining a RIF document, or combined on the consumer-side,designator for a particular schema component or schema components, understood relative to a combination of both. However,designated schema. This specification uses only XML schemas thata limited subset of the schema component path expression language, from the second part.

According to this specification, XPath and component designator expressions are explicitly importedrepresented as string constants in RIF formulas. Although the semantics of RIF documentand XML data combinations is specified with respect to any valid XPath 2.0 expression, conforming implementations are taken into account for the interpretationrequired to support only a limited subset. Future versions of the combination.this provides a way to communicatespecification may extend that subset.

The XQuery 1.0 and XPath 2.0 Data Model that(XDM) is intended, in a RIF document, forbased on the infoset [Infoset], possibly augmented with information resulting from the validation of the XML data source, without specifying an actual data source. Section 2 specifies how the rif:Import directive is used to importagainst an XML document and anschema, or post-schema validation infoset (PSVI), according to the specification W3C XML Schema are import in a RIF document.Definition Language (XSD) 1.1 Part 1: Structures [XSD 1.1 Part 1]. An instance of the RIFdata model for XML documents is describedcan also be constructed directly through application APIs, or from non-XML sources such as relational tables in section 3. Section 4 specifiesa standarddatabase. The semantics for RIF combinations with XML data: first, a model-theoretics semantics is given to RIF BLD combination with XML data, with and without associated XML schema (section 4.1);the operational semanticscombination of RIF PRD combinationsdocuments with XML data is, then, defined, based onapplies, therefore, to the definitioncombination of aRIF BLD+XMLdocuments with non-XML data combined interpretation (section 4.2); finally,as well, where the semantics of RIF Core combinations withXML binding of the data is defined with respectonly used to refer to it in the model-theoretic semanticsinterchanged rules. This is likely to be of particular interest when an XML schema is interchanged along with the combination ofRIF BLDdocument.

Like the XQuery 1.0 and XMLXPath 2.0 Data andModel, the operationalsemantics of the combinationcombinations of RIF PRDdocuments and XML data (section 4.3). Editor's Note: This section will be completedthat is specified in a future draft. 2 Importingthis document supports the following classes of XML data:

Accordingly, this document to be combined with thespecifies how a RIF document that contains the directiveis combined with well-formed -- and, optionally, a profile that governswhere an XML schema is specified, schema-valid -- XML documents. The combination. In [ RIF-Core ], [ RIF-PRD ] and [ RIF-BLD ],semantics is independent on the useprovenance of the Import directive is limited to identifying anXML data in a combination: it can be imported explicitly in a RIF document, or an RDF graph or an OWL ontology to becombined with a RIF document. An optional profile that governson the consumer-side, or a combination of a RIF document with an RDF graph or an OWL ontology can also be provided, as specified in [ RIF-RDF-OWL ]. This specification extends the Import directiveboth. However, only XML schemas that are explicitly imported in four ways:the IRI of any XMLRIF document is allowed as a value ofare taken into account for the location sub-element, that containsinterpretation of the IRI that identifiescombination. This provides a way to communicate the importeddata document; The new value: http://www.w3.org/2007/rif-import-profile#xml-data ,model that is definedintended, in a RIF document, for the profile of an import, indicating that the imported document isdata source, without specifying an XML documentactual data source.

Section 2 specifies a normative standard semantics for RIF combinations with no associatedXML schema; In addition, any IRI that identifiesdata: first, an XML schema documentXPath 2.0 and XSD-CD based syntax is allowed as a profile, identifying the XML schemaspecified, that is associated with the importedused to relate RIF formulas to XML data; Finally,data items in a new value: http://www.w3.org/2007/rif-import-location#no-data ,combinations (section 2.1). Then, a model-theoretics semantics is allowed forgiven to RIF BLD combination with XML data, with and without associated XML schema (section 2.2); the locationoperational semantics of an import, indicating that the directive does not requireRIF PRD combinations with XML data is, then, defined, based on the importdefinition of a RIF BLD+XML data document Editor's Note:combined interpretation (section 2.3); finally, the extended syntaxsemantics of RIF Core combinations with XML data is still under discussion. Other approaches include: (i)defined with respect to makethe location sub-element optional as well; (ii) to reserve new keywords inmodel-theoretic semantics of the http://www.w3.org/2007/rif-import-profile namespace, such as: xml-schema , xml-schema-valid-data , etc,combination of RIF BLD and XML data and to add a specific construct forthe schema locator.operational semantics of the following constraints must be satisfied: If an Importcombination of RIF PRD and XML data (section 2.4).

Section 3 specifies how the rif:Import directive does not requireis extended to support the import of XML data and XML schemas in a RIF document.


Combination with XML data document, the profile must be specified;and/or schema constrains the twointerpretation of RIF formulas and give them special values http://www.w3.org/2007/rif-import-location#no-data , forsemantics. As a result, the location,semantics of RIF when XML data and http://www.w3.org/2007/rif-import-profile#xml-data , for the profile, areschema is imported is not allowed inthe same Import directive; Ifas the profilesemantics of an Import directive identifies anRIF alone, even if the imported XML data and schema are empty.

Section 4 specifies the conformance criteria for this specification.

Implementation of this specification requires a good understanding of XPath 2.0 and ifthe XQuery 1.0 and XPath 2.0 Data Model. However, this document providescan be read and understood without a schema-location ,deep knowledge of these two specifications. For the profile must identifyconvenience of the same XML schema asreader, the schema-location IRI; Ifdefinition of terms from the profile is rif:xml-dataXPath 2.0, XSD-CD and the location must identify an XML document. This specification does not prescribe the behaviour of a conformant implementation when oneXDM specifications, that are of particular importance for this document, are repeated in the above constraints is not satisfied. This specification does not prescribeAppendix A: Glossary. However, the behaviour of a conformant implementation when an Import directive contains a profile that is neither rif:xml-data nor an IRI that identifies an XML schema. Example 2.1.definition in the first three import directives, below,glossary are valid;non-normative: the fourth is not: Import(http://example.org/customertable.xml http://www.w3.org/2007/rif-import-profile#xml-data) Import(http://example.org/customertable.xml http://example.org/customertable.xsd) Import(http://www.w3.org/2007/rif-import-location#no-data http://example.org/customertable.xsd) Import(http://www.w3.org/2007/rif-import-location#no-data http://www.w3.org/2007/rif-import-profile#xml-data)only normative definitions are as specified in the first directive says that[XPath 2.0] and the rules[XDM] recommendations, and in the importing RIF documentXSD-CD specification. Such terms are to be combinedshown in square bracket, with a superscript indicating XP if the dataterm is defined in XPath 2.0: [thus]XP; or with a superscript indicating XDM if the XMLterm is defined in XDM: [thus]XDM; or with a superscript indicating CD if the term is defined in XSD-CD: [thus]CD.

This document identified byfollows the IRI: http://example.org/customertable.xmlconvention used in other RIF specifications, to start definition with: Definition and that there is no data model associatedend them with the imported datasymbol ☐. In the form of an XML schema.same way, examples start with: Example and end with ☐. The second directive says thatend symbol may be omitted if the rules indefinition or example ends with the importing RIFsection.

Several prefixes are used throughout this document for notational convenience. The following bindings are assumed.

  1. rif bound to be combinedhttp://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 the data in theXML document identified by the IRI: http://example.org/customertable.xml and that there is adata

model associated withThis section specifies the imported data, innormative semantics of the formcombination of RIF formulas and XML data, for RIF Core, RIF PRD and RIF BLD, where the XML schema that is identified by the IRI: http://example.org/customertable.xsd . The third directive says thedata that is combined with the rules is expected tomay be associated with an instance of the data model that is imported as theXML schema identified by the IRI: http://example.org/customertable.xsd ; but the directive does not say whatschema.

Definition (RIF+XML data combination). A RIF+XML data combination is to be combined with the rules. The fourth directive violates one of the constraint: therefore, ita triple <R, E, S>, where R is out of the scope of this specification. Notice that none of the three valid directivesa RIF formula (document or non-document), E is incompatible with the other two, buta, possibly empty, set of data model [nodes]XDM that combiningcontains the first two is confusing and error-prone, and should be avoided; andinformation that the third oneis redundant withrepresented in the second,XML data, and that combining the twoS is useless and confusing, and that it should be avoided. 3 A simple data model fora, possibly empty, set of XML documents This section defines the RIF data modelschema definitions.  ☐

For XML documents (henceforth "the data model").the data model serves two purposes: it specifiespurpose of evaluating the informationXPath 2.0 expressions that is accessible to a RIF consumer in an XML document, possiblyare used, in combination with an XML schema; and it is usedR, to specify the interpretation ofaccess the combination of RIF withXML data. Thedata modelthat is a simplified version ofrepresented in E, the XQuery 1.0[in-scope schema definitions]XP are the schema definitions in S and XPath 2.0all their components.

This specification does not describe or prescribe how the set of data model [[nodes]XDM ]. As, in a consequence, the RIF condition language canRIF+XML data combination, is obtained: it may result from parsing one or more XML documents and/or validating them against one or more XML schemas, or it may be consideredcreated by methods other than parsing and/or schema-validating XML documents.

However, in a partial implementation of the XQuery 1.0 and XPath 2.0RIF+XML data Model, and the interpretationcombination <R, E, S>, any information item in E that represents an instance of the RIF condition languagea schema definition that is an element of S or a component in an element of S, must be valid with respect to XML documents can be specified in termsthat schema definition.

This specification does not prescribe the behaviour of a conformant implementation when the XQuery 1.0 and XPath 2.0set of data model [nodes]XDM in a RIF+XML data combination does not satisfy the above validity constraint, or its implementations, such as XPath 2.0 [ XPath 2.0 ]. This document will reuse definitionsany relevant constraint from the XQuery 1.0 andXPath 2.02.0, XDM or XSD-CD specifications.

2.1 Syntax

This section addresses how a RIF formula interacts with the XML data, in a RIF+XML data Model andcombination; that is, this section specifies how the XPath 2.0 specifications, as appropriate, and otherwise provide pointersaccess to XML data, and examples where relevant. 3.1 Definitionsto XML schema information, if available, is represented in RIF formulas, for the data model specifiespurpose of combining them.

The information items frombasic idea is that the XML infoset [ Infoset ]object-attribute-value semantics of RIF frame formulas is used, in the combination of RIF formulas and fromXML data, to exploit the post-schema validation infoset (PSVI), or derived fromintended semantics of the infosetrelation between a [context node]XP, an XPath 2.0 expression and the PSVI,sequence that are required to interpret some RIF constructs with respect to an XML document. Definition (Information item). (from [ Infoset ]) An information item is an abstract descriptionthe expression matches in the context of some partthe node: in the context of an XML document: each information item hasa setRIF+XML data combination <R, E, S>, frame formulas of associated named properties.  ☐ In this document, an information item is said to be constructed from an infosetthe form object["some XPath expression"->val], ifwhere the data item that it describes is contained in a data source thatobject term is not associated withinterpreted as an XML schema when it is imported in RIF. If thedata source is associated with an XML schema, all the information items used to describe the content ofmodel [node]XDM in E, mean that data source are said toval can be constructed fromderived, in a PSVI . If an information item is constructed from an infoset, all general and external parsed entities mustway to be fully expanded before the data model is constructed.specified in this specification, the property names are shown in square brackets, [thus] .document, from the data model relies on three typessequence of information items: Element informationitems ,that describethe elementsXPath expression matches in an XML document. The properties associated with 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 describethe attributescontext of elements. The properties associated withthe 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 describenode denoted by object.

This document specifies the semantics of RIF+XML data characters that appearcombinations, in general terms, for any valid XPath 2.0 expression. But some of the XML document. The character information item has two properties: [character code] and [element content whitespace]. Givendetails are specified normatively for a data source, the relevant setlimited subset of information items may be createdXPath 2.0 expressions only. Namely, conforming implementations must support the XPath 2.0 expressions specified by methods other than parsing and/or schema-validating an XML document. This specification does not describe or prescribe any method for retrievingthe required information from a data source, possibly combined with an XML schema.following EBNF 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 this specification distinguishes between the data model as a general concept and specific items (information items or atomic values)may extend that subset.

XPath expressions are concrete examples of the data model. For the purpose of this specification, the term instance of the data model willrepresented in RIF as xs:string constants.

Editor's Note: Alternatively, an additional symbol space, rif:xpath, could be used exclusivelyadded to denote such concrete examples of theRIF built-in data modeltypes: in that are sequences of element information itemscase, XPath expressions would be represented as rif:xpath constants.

XPath 2.0 unabbreviated syntax must be used in document order. Definition (Instance ofthe data model). An instance ofnormative RIF/XML syntax, except when the data modelexpression is a sequence of element information items,simple StepExpr and the test is a NameTest: in document order.that case, the abbreviated syntax must be used in particular, given an XML document D ,the instance ofnormative RIF/XML syntax.

Both syntaxes, abbreviated and unabbreviated, are allowed in the data model that describes Dnon-normative RIF presentation syntax.

When a string constant is evaluated as an XPath expression, the sequence of all[statically known namespaces]XP are the in-scope namespaces for the containing element information items that describe an element contained in D ,in document order.  ☐ When therethe RIF formula.

Likewise, the object-class and subclass-superclass semantics of RIF member and subclass formulas is no ambiguity with respectused to D ,exploit the instanceintended semantics of the data model that describes D will be called, simply: the instancerelation between an XML element and its XML schema type, and of the data model . Definition (Atomic value).relation between two XML schema types, when information on classes and types definitions is available from imported XML schemas. RIF member formulas of the form: object #  "an atomic valueXSD-CD component path expression", where the object term is interpreted as a valueelement [node]XDM e E, mean that the XML fragment represented by e satisfies the XML schema definition designated by the XSD-CD component path expression.

In the value spacesame way, subclass expressions of an atomic type and is labeled withthe name ofform: "sub" ## "SUP" where, both, "sub" and "SUP" are XSD-CD schema component path expressions, mean that atomic type.  ☐ Definition (Atomic type). An atomic type is one ofthe 20 primitive simpleschema 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 defined as in XPath 2.0, section 3.3 Primitive Datatypes of [ XSD 1.1 Part 2 ] or a type derived by restriction from another atomic type.  ☐ Types derived by list or union are not atomic. Definition (Sequence). A sequence is an ordered collection of zero or more information items.  ☐ A2.5.4 - Sequence cannot be a member of a sequence. An important characteristic oftype matching.

This specification specifies the semantics of RIF+XML data model iscombinations that there is no distinction between an item (a information itemcontains such member or an atomic value ) andsubclass formulas for a singleton sequence containinglimited subset of XSD-CD expressions, only. Namely, conforming implementations must support absolute XSD-CD expressions that item.designate schema types, as specified by the following 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 item is equivalentadditional symbol space, rif:xsd-cd, could be added to a singleton sequence containingRIF built-in data types: in that itemcase, XSD-CD expressions would be represented as rif:xsd-cd constants.

XSD-CD abbreviated syntax must be used in the normative RIF/XML syntax. Both abbreviated and vice versa. Except when specified otherwise, sequencesunabbreviated syntaxes are ordered according toallowed in the document order . Definition (Document order). A document order isnon-normative RIF presentation syntax.


For the purpose of expanding QNames in NameTests, the in-scope namespace bindings are defined amongas all the element information itemsnamespace declaration in the scope of which the string is.


Example 2.1. Consider, for instance, the following rule, that describe a given XML document. Document ordersays that an EarlyCustomer is a total ordering. Informally, document orderCustomer whose Account number is lower than 1000 (using the order in which nodes appear in the XML serialization of a document.  ☐ Within a tree, document order satisfiesRIF 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 following constraints: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 root node ispair (ex, <http://example.org/customertable>) belongs to the first node. Every node occurs before all of its children and descendants.statically known namespaces when the relative order of siblings isXPath expressions are evaluated, the order in which they occur incombination, under the [children] propertysemantics described below, of their parent node. Childrenthe above rule and descendants occur before following siblings.XML element, attribute and type names are usually represented asdata, with no associated XML qualified names, or QNames. However, xs:QNameschema, will entail two new facts, namely:

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

This rule shows how an XPath expression is not a RIF-Core built-in datatype.used, in the data model, all qualified names, including atomic values, are representedrule, as expanded QNames . Definition (Expanded QName).an expanded QName is a set of three values consistingxs:string constant, e.g.: "ex:Name" or "ex:Account", to access the children of a possibly empty prefix, a possibly empty namespace IRI and a local name.  ☐an element [node]XDM as frame slots.

Notice that the prefix is never usedthat, in this document,the absence of classes and expanded QNames willtypes definitions as would be dealt with, inprovided by an associated XML schema, NameTest are enough to exploit all but definition, as consisting of a possibly empty namespace IRI and a local name 3.2 Elementthe information items Therethat is an elementavalable in the XML data, in the combination. Notice further that, with no typing information itemavailable, atomic values retrieved from the XML data can only be interpreted as strings. A consequence is that such values have to be cast into the required types when used as arguments to RIF buit-in functions and predicates.

Notice, also, that, for each element appearingthe same reason, member (or subclass) formulas cannot be used in combination with the XML document. One ofdata: the only way (based only on the elementinformation items corresponds tothat is available in the root ofexample) to ensure that only the element tree,ex:Name and all other element information itemsex:Account sub-elements of ex:Customer elements are accessible by recursively following its [children] property.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 item has the following properties: [ namespace name ]that 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 namespace name, if any,absence of an XML schema against which the element. Ifdata must be valid, the elementfact ?x["self::ex:Customer"->?x] does not belongentail anything with respect to a namespace, this property has no value; [ local name ] The local partother properties of ?x.

Now, assume that the element name. This does not include any namespace prefix orfollowing colon; [ children ] An ordered list of child information items, in document order. This list contains only element information items and character information items , one for each element and data character appearing immediately within the current element. It does not contain other kinds of information items, such as attribute information items , even if theXML element described by the information item has attributes. If the elementschema is empty, this list has no members; [ root ] The element information item that describes the root element inassociated with the above XML document.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 [root] property of allXML schema is associated with the element information items that describe elements containeddata, in the same XML document pointRIF+XML data combination, typing information can be taken into account, both, to focus on the same root element information item, includingdata that root elementrepresent customer information item itself. If the [root] property of an element(that is, information item pointsrepresented in ex:Customer elements), and to ensure that element information item itself,arguments to built-in functions and predicates are properly typed. The [root] propertiesexample rule could, then, be written as follows (notice that this version of the rule uses unabbreviated XPath syntax):

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 assertion of the class membership: ?x # "/ex:Customer", entails that ?x has all the element information itemsproperties that are accessible by following its [children] property, recursively, must pointrequired to that same root element information item; [ attributes ] An unordered set of attribute information items, one for each ofvalidate against the attributes of this element. This includes allschema definition of the "special" attributes ( xml:lang , xml:space , xsi:type , etc.) but does not include namespace declarations (because they are not attributes). Default and fixed attributes, e.g. provided by XML Schema processing, are added to the [attributes]. If theelement has no attributes, this set has no members; [ type name ] The [type name] propertyex:Customer.

Another rule example, below, shows how another kind of XPath expression, used as an element information item is empty if, and only if, the element information item is constructed from an infoset. If the element information itemxs:string constant: "@xml:lang", is constructed fromused, in a PSVI, the type name is represented byRIF+XML data combination, to access an expanded QName. It is determined as described in Section 3.3.1.1. Element andattribute Node Type Names from [[node]XDM ] (reproducedas a frame slot:

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

Assuming that the pair (xml, <http://www.w3.org/XML/1998/namespace>) is also in appendix 9.1, Element and attribute node type names, forthe reader's convenience); [ string value ]statically known namespaces, that rule, combined with the normalised representation ofexample XML data and XML schema, entails a single new fact:

_SpeaksEnglish("John")

Notice that all the contentrules, above, are well-formed RIF formulas, that can be validly consumed without being combined with any XML data and/or XML schemas. In that case, of course, this specification adds nothing to the element as a string.specification of the string value is calculatedRIF Core Dialect, as follows: If the element is empty or if it does not have any character information item children nor descendants, its string value isregards the zero length string; Else, ifsemantics of the [type name] propertyrules.

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

The element information item is empty, or ifspecification of the element hasmodel-theoretic semantics of a complex type with element-only content, orRIF BLD+XML data combination -- a complex type with mixed content, its string valueRIF+XML data combination, <R, E, S> where R is a RIF-BLD (document or non-document) formula -- follows closely the string comprised of characters that correspond to the [character code] properties of eachspecification of the character information item childrensemantics of a RIF BLD formula, except that the element and all its descendants, in document order. If the resulting string consists entirelynotion of whitespace andsemantic structures is replaced by the [element content whitespace] propertynotion of the character information items used to construct itRIF BLD+XML data combined interpretations: informally, RIF BLD+XML data combined interpretations are true, the string value is the zero-length string; Else, if the element has a simple type or a complex typeRIF BLD semantic structures, extended with simple content: its string value is the schema normalized value of the element; Note that, if the element has a typed value, any valid lexical representation of the typed value can be used to determine the [string value] property; [ typed value ] The typed-value is calculated as follows: If the element is empty or if it has element-only children, its typed value is the element itself; more precisely, ifan element information item has no character information items in its [children] property, the value of its [typed value] property is the element information item itself. This is a deviation from the XQuery 1.0 and XPath 2.0additional mapping, IDM, that interprets data model : the latter document specifies[nodes]XDM, and constrained with additional conditions, derived from the [typed value] as being undefined, in that case, which is of no use in this specification; whereas this specification requires a handle to an elementinformation item, to access its [children]in E and [attributes] properties from its [typed value] (seeS.

2.2.1 Semantic structures

Definition (Semantic structure). For the definitionspurpose of combined interpretations in Section 4,defining the model-theoretic semantics of a RIF BLD+XML data combination with XML data ); Else, if the [type name] property of the element information item is empty, or if the element has<R, E, S>, a complex type with mixed content (including xs:anyType), its typed valuesemantic structure is the sameas its string value; Otherwise, the element must have a simple type ora complex type with simple content. Its typed value is computedtuple 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 Itruth are defined as describedin RIF-BLD ([RIF-BLD], section 3.3.1.2 Typed Value Determination , in [ XDM ] (reproduced in appendix 9.2, Typed value determination, for the reader's convenience). The result3.2, Semantic structures), and where

2.2.2 Combined interpretation of zero or more atomic values. The relationship betweenRIF BLD non-document formulas and XML data

Let Classifiers(S) denote the valuesset of all the [type name], [typed value], and [string value] propertieswell-formed RIFSchemaComponentPath expressions, expr, such that one of an element information itemthe following holds, where c is consistent with XML Schema validation. Note thatthe component selected by expr in the casecontext of xs:QNameS and xs:NOTATION s,:

Let, further, Classes(S) Classifiers(S) denote the [is-idrefs] property is false. Else, if anysubset of classifier XSD-CD expressions that select the atomic values in the typed-valuedeclarations of the elementnamed complex types.

Definition (RIF BLD+XML data combined interpretation). A RIF BLD+XML data combined interpretation is of type xs:IDREF or xs:IDREFSa triple (E, orI, S), where E is a type derived from oneset of those types, the [is-idrefs] propertydata model [nodes]XDM, possibly empty; S is true; otherwise ita set of XML schema definitions, possibly empty; and I is false. Editor's Note: Although minor, the deviations froma semantic structure, such that all the XQuery 1.0 and XPath 2.0 Data Model (XDM) may preclude using code developedfollowing holds:

  1. For XDM. They are still under discussion. The working group is seeking feedback onall the issue[nodes]XDM e E, Itruth( ISSUE-103 ). 3.3 Attribute information items There is an attribute information itemIframe(IDM(e))(IC("expr"^^xs:string), RIFValue(e, expr))) = t (true) for any well-formed XPath expression, expr, for each attribute (specified or defaulted) of each element in the document, excluding thosewhich are namespace declarations (because they are not attributes). Attributes declared in the DTD with no default valueRIFValue(e, expr) is defined; and
  2. 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, of the attribute. Otherwise, this property has no value; [ local name ] The local part of the attribute name. This does not include any namespace prefix or following colon; [ attribute type ] An indication of the type declaredFor this attribute in the DTD.all the only valuesindividuals o DInd, there is an element [node]XDM with a complex type, e E, such that are relevant to this specification are IDIDM(e) = o, IDREFif and IDREFS .only if there is no declaration for the attribute, or if no declaration has been read, this property has no value.an XSD-CD component path expression, expr Classifiers(S), such that Itruth(Iisa(o, IC("expr"^^xs:string))) = t (true) and
  3. DTS is extended to include all the named atomic types defined in its [attributes] property; [ type name ] Empty ifthe attribute information item[in-scope schema definitions]XP;
  4. Itruth(Isub(IC("T1"^^xs:string), IC("T2"^^xs:string)) = t (true) for all the pairs of XSD-CD component expressions, (T1, T2) Classes(S) × Classes(S), that select two complex types, t1 and t2, such that [derives-from]XP(t1, t2) is constructed from an infoset.true;

Notice that clause 2, in the above definition, implies that, if the attribute information item is constructed fromclass membership of an object that interprets the [context node]XP e, in a PSVI,classifier amongst the type nameschema definitions in the combined interpretation is represented as an expanded QName,asserted, then the object must have all the properties that are mandated by the classifier, and itno property that the definition of the classifier does not allow. This is determined as described in Section 3.3.1.1.a consequence of the constraint that all the schema element and Attribute Node Type Names from [[node]XDM ] (reproduced, in Appendix B for the reader's convenience); [ string value ] TheE, must be schema normalized value PSVI property if that exists; otherwise,valid.

Editor's Note: Another possibility, to resolve the normalized attribute value accordingissue of incomplete instances, would be to Section 3.3.3 Attribute-Value Normalizationintroduce one or more null values in [ XML ]). Note that, ifthe attribute hasRIF vocabulary, e.g. rif:null.

RIFValue is a typed value, any valid lexical representationtotal mapping from E × EXPR to Dind, where EXPR is the set of all the typedwell-formed XPath expressions. RIFValue(e, expr) associates a value can be usedin Dind to determinethe string value; [ typed value ]sequence of data model [nodes]XDM, in E, that are matched by the typed-valueXPath expression expr when the [context node]XP is calculated as follows: Ife and S contains the [type name] property of an attribute information item is empty, its typed value[in-scope schema definitions]XP.

RIFValue is the samedefined as its string value; Otherwise, afollows.

Let seq = (i1,...,in) be the sequence of zero or more atomic values as described in Section 3.3.1.2 Typed Value Determination , in [ XDM ] (reproduceditems matched by expr EXPR in Appendix B for the reader's convenience).the relationship betweencontext of e E, where n 0 is the valuesnumber of items in seq:


Val interprets items as follows:

In the [is-id] property of R is trueabove, fn:string and its [typed value] property matches id ; or the [is-id] property of one offn:data are the attribute information itemsaccessors defined in R' s [attributes] property is true,the Xpath 2.0 and XQuery 1.0 Functions and Operators recommendation [XFO], sections 2.3 and 2.4 (for the [typed value] property of that attribute information item matches id .  ☐ Note that the reference information item is always an element . Where this specification states, with respect to a set of information items, thatreader's convenience, the referencesdefinitions are resolved , the following processing is applied to every information itemcopied, non-normatively, in 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 value of type xs:IDREF or xs:IDREFS or a type derived from one of those types, E itself is replaced with its reference information item ; or, if its typed value isGlossary.)

A sequence that contains more than one atomicRIF BLD+XML data combined interpretation (E, I, S) determines the truth value, each atomic value that isTVal(E,I,S)(φ), of type xs:IDREF or xs:IDREFS ora type derived from one of those types is replacedRIF-BLD non-document formula φ combined with the typed value of its reference information itemXML data in E and XML schema definitions in S, like a RIF BLD semantic structure, IBLD, afterdetermines the references in that typedtruth value have been resolved, if the [id-refs] propertyTValIBLD(φ), of a RIF-BLD non-document formula φ. The reference information itemmapping TVal(E,I,S) is true; otherwise,defined from the information item must be an attribute information item, Aset of all non-document formulas to TV, and every atomic value inthe typed valueset of A is replaced with its reference information item . No property value is changedtruth values in any information item: the references are resolved only on a "need-to-resolve" basis, where the specificationI, as follows.

Definition (Truth valuation of RIF as an implementationBLD non-document formulas combined with XML data). Truth valuation of RIF BLD non-document formulas combined with XML data is determined using the function TVal(E,I,S), such that for all RIF BLD+XMl data model requires them to be resolved. This specification does not prescribecombination, <φ, E, S>, where φ is a behavior if an errornon-document RIF BLD formula, TVal(E,I,S)(φ) = TValI(φ), where TValI is encountered during reference resolution processing (suchas IDREF s without corresponding ID s, invalid or duplicate ID s, etc). 3.6 Exampledefined in [RIF-BLD], section 3.4 - Interpretation of a data model instance Considernon-document formulas, with I being the following XML document, 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> Consider, further,semantic structure in the following XML schema: <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>RIF BLD+XML data combined interpretation (E, I, S).  ☐

Example 2.2. Assuming that E contains all the instance ofdata model [nodes]XDM in the data model instance that describes the XML document associated with the schema is a sequencesample fragment in example 2.1; that containsetable denotes the following eightelement information items,node, in E, that represents the same order asinformation that is serialized in the numbered list below. When relevant to examples furtherCustomerTable element, in this document,the values for some ofexample XML fragment; and that eJohn denotes the properties are given for both cases whereelement node, in E, that represents the instance ofinformation that is serialized in the data model had been constructed fromfirst Customer sub-element (the one whose Name sub-element contains John), the infoset, marked as: (no schema) , andfollowing ground frames must be true in all the RIF BLD+XML data combined interpretations, (E, I, ), that is, where it has been beenE is constructed from the PSVI, marked as: (schema) : an element information item representing the CustomerTable element, with the following values for its properties [namespace name]: http://example.org/customertable [local name]: CustomersTable [children]: a sequence of two element information items, which areinfoset 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 two Customer element information itemstop-level schema definitions in the data model instance,sample schema in the same order; that is, items 2example 2.1, ground frames #1 and 5#3 above must be false in all the RIF BLD+XML data model instance, in that order [root]: the element information item itself [attributes]: empty [type name]: (no schema) empty (schema) http://example.org/customertable "some locally unique identifier for the anonymous type of the CustomerTable element" [string value]: "Johncombined 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 Jane 222 222" [typed value]: the element information item itself [is-id]: false [is-idrefs]: false an element information item that describes]

The first Customer elementclass membership formula #1, below, may be true in the document, with the following values for its properties [namespace name]: http://example.org/customertable [local name]: Customer [children]:a sequence of two element information items, which are items 3 and 4 in theRIF BLD+XML data model instance, describing the Name and Account sub-elements, respectively,combined interpretation, (E, I, ), but, in that same order [root]: same value asthe [root] propertyabsence of an associated schema definition, the previous element information item [attributes]: a attribute information item representing the xml:lang attribute.string /ex:Customer does not represent a component designator, and the attribute information itemclass membership formula has no meaning specific to the following values for its attributes: [namespace name]: http://www.w3.org/XML/1998/namespace [local name]: lang [Attribute type]: empty [owner element]: the previous element information item [type name]: (no schema) empty (schema) http://www.w3.org/2001/XMLSchema language [string value]: "en" [typed value]: en [is-id]: false [is-idrefs]: false [type name]: (no schema) empty (schema) http://example.org/customertable "some locally unique identifier for the anonymous type Customer " [string value]: "John 111" [typed value]: the element information item itself [is-id]: false [is-idrefs]: false an element information item representing the Name sub-element of the first Customer elementRIF BLD+XML data combined interpretation. However, 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 document, withother hand, the following values for its properties [namespace name]: http://example.org/customertable [local name]: Name [children]:class membership formula: _PIN_Jane # "/ex:PIN" must never be true as a sequenceconsequence of four character information items, spelling j o h n , in that order [root]: same valuebeing interpreted under a RIF BLD+XML data combined interpretations, (E, I, S). Indeed, ex:PIN is defined as a simple type: as such it is not in Classes(S) (nor in Classifiers(S)); but it is, instead, added to DTS.

Example 2.3. Consider the [root] property of the previous element information item [attributes]: empty [type name]: (no schema) empty (schema) http://www.w3.org/2001/XMLSchema string [string value]: "John" [typed value]: "John" [is-id]: false [is-idrefs]: false an element information item representing the Account sub-element of the first Customerfollowing element inwith mixed-content, where the document,prefix ex is associated with the following values for its properties [namespace name]: http://example.org/customertable [local name]: Account [children]: a sequence of three character information items, spelling 1 1 1IRI http://example.org/, inand assume that order [root]: same value as the [root] property of the previous element information item [attributes]: empty [type name]: (no schema) empty (schema) http://www.w3.org/2001/XMLSchema integer [string value]: "111" [typed value]: 111 [is-id]: false [is-idrefs]: falsean element information item[node]XDM, e, that describes the second Customer elementrepresents it is included in E.

<ex:letterBody>
  Thank you for ordering the  document; an element information item representing the Name sub-element of<ex:item>widget</ex:item>.
  It should arrive by <ex:arrivalDate>09-09-09</ex:arrivalDate>
</ex:letterBody>

The second Customer elementfollowing fact must be true in any RIF BLD+XML data combined interpretation, (E, I, S), such that IC(_myLetter) = IDM(e):

Indeed, the second Customerelement in the document;has a mixed content: per [XDM] (section 6.2), its [typed value]XDM is, therefore, its string value as an element information item representing the PIN sub-element of the second Customer element in the document, withxs;untypedAtomic, which is represented, per the following values for its properties [namespace name]: http://example.org/customertable [local name]: PIN [children]: a sequencedefinition of three character information items, spelling 2 2 2RIFValue, inabove, by that order [root]:same value[string value]XDM as the [root] propertyan xs:string.

2.2.3 Combined interpretation of the previous element information item [attributes]: empty [type name]: (no schema) empty (schema) http://example.org/customertable PIN [string value]: "222" [typed value]: 222 [is-id]: false [is-idrefs]: false 4RIF combination withBLD documents and XML data

This section specifiesFor the semanticspurpose of the combinationinterpretation of imported documents, RIF documents and XML data, for RIF Core, RIF PRD and RIF BLD, whereBLD defines the XML data may be associated with an XML schema. Definition (RIF+XML data combination).notion 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+XMLRIF-BLD+XML data combination <R, E, S>, is interpreted using a tuple < R , D 1RIF BLD+XML data combined multi-interpretation (E, ..., D n >, n 1Î, S), where RÎ is a RIF document and Dnonempty set, {J,I; Ii1, ..., D n are XML documents.   ☐ One use case for the combinationIi2, ...}, of RIF and XML data is whensemantic structures that determine a non-empty set, {(E, J, S), (E, I, S); (E, Ii1, S), (E, Ii2, S), ...} of RIF document imports explicitly theBLD+XML data to whichcombined interpretations that differ only in the rules areinterpretation of local constants.

To be applied:keep this isdocument simple, and in the case whensame way the definition of truth valuation of RIF document contains one or more Import directives where the location identifies explicitly an XML document to beBLD formulas combined with XML data, above, refers to the importing RIF document.definition of truth valuation in that case,the combination is imposed byRIF-BLD recommendation, the producerdefinition of thea RIF document, as well as theBLD+XML data to becombined with the rules that the RIF document contains. We call that case: producer-side combination , andmulti-interpretation refers to the XMLdefinition of a semantic multi-structure in [RIF-BLD].

Definition (RIF BLD+XML data to becombined with themulti-interpretation). A RIF document: imported XMLBLD+XML data . However,combined multi-interpretation is a significant use case for RIFtriple, (E, Î, S), where Î is rules being published or shareda semantic multi-structures as defined in [RIF-BLD] (section 3.5 - Interpretation of documents), with the additional condition that for each semantic suctrure, i Î, (E, i, S) is a RIF document for consumers to apply themBLD+XML data combined interpretation.  ☐

Similarly, the truth valuation of a RIF+XML data combination <R, E, S>, is specified with reference to their own data. In that case,the consumertruth valuation of a RIF BLD document decides independently of the producer to combine the rules contained informulas, using the RIF document with the data of his choice. We refer to that case as: consumer-side combination , and to theBLD+XML data that iscombined with a RIF document as: consumer-side data . This section specifies a normative semantics for the combinationmulti-interpretation (E, Î, S) in place of a RIF-BLD semantic multi-structure.

Definition (Truth valuation of RIF BLD document formulas combined with XML data, without distinguishing between the two cases; that is, independentlydata). Truth valuation of whether the XML data to beRIF BLD document formulas combined with XML data is determined using the function TVal(E,Î,S), such that for all RIF document is imported XMLBLD+XML data or consumer-side XML data, or acombination of both. However, it provides<Ρ, E, S>, where Ρ is a means to require that consumer-side XML data be valid with respect to an XML schema thatdocument RIF BLD formula, TVal(E,Î,S)(Ρ) = TValÎ(Ρ), where TValÎ is imposed by the produceras defined in [RIF-BLD], section 3.5 - Interpretation of the RIF document. Editor's Note: ...and thus to interchange, alongdocuments, with Î being the rules,semantic multi-structure in the RIF BLD+XML data combined multi-interpretation (E, Î, S).  ☐

The notions of model with respect to which they have been designed.and thus, to combineof logical entailment can be defined for a RIF with anyBLD+XML data combination, based on the definitions of model that can be represented in an XML Schema (including object models). Explanation, use caseand example will be added in a future draft. Definition (Associated XML schema). An XML document, D i ,of logical entailment for RIF BLD (document and non-document) formulas: (E, Î, S) is associated with an XML schema , XSD , in the contexta model of a RIF+XML data combination,RIF BLD+XML data combination < R , D 1 , ..., D i , ..., D nR, E, S>, n 1 ,if and only if one of the followingÎ is true: The RIF document, R , contains an Import directive, where the location identifies the imported XML document D i and the profile identifies XSD ; The RIF document,a model of R, contains an Import directive, where the location is missing,in the profile identifies XSD ,sense defined in [RIF-BLD] (section 3.6 - Logical entailment), and D i(E, Î, S) is a consumer-side XML document that validates against XSD . 4.1 Model-theoretic semantics ofRIF BLD+Xml data combinations The model-theoretic semanticscombined multi-interpretation.

Definition (Model of RIF BLD definesa semantic structure asRIF BLD+XML data combination). A tuple I = < TV , DTS , D , D ind , D func , I C , I V , I F , I NF , I list , I tail , I frame , I sub , I isa , I =RIF BLD+XML data combined multi-interpretation (E, I externalÎ, I truth >. The specification of the model-theoretic semanticsS) is a model of a RIF BLD+XML data combination follows closely the specification of the semantics of<R, E, S>, where R is a RIF BLD document, except that the notion of semantic structures is replaced by the notiondocument or non-document formula, if and only if TVal(E,Î,S)(R) = t (true).  ☐

Definition (Logical entailment of a RIF BLD+XML data combined interpretations : informally,combination). Let φ and ψ be (document or non-document) formulas. We say that a RIF BLD+XML data combined interpretations are RIF BLD semantic structures, with additional conditions on some of the elements of I .combination <φ, E, S> entails the basic idea is that pieces of importedRIF BLD+XML data are represented, for the purpose ofcombination with RIF, by information items in instances<ψ, E, S>, denoted <φ, E, S> |= <ψ, E, S>, if and only if every model of the RIF BLD+XML data model. Assertions about the namescombination <φ, E, S> is also a model of XML elementsthe RIF BLD+XML data combination <ψ, E, S>.  ☐

Notice that, in the imported data, and,case where defined, their types, are represented using class membershipE and subclass formulas, in the importing RIF documents. This document specifiesS are empty, that is, if a subsetRIF-BLD formula is combined with an empty XML data set and an empty set of XML schema definitions, the lexical spacesinterpretation of the symbol spaces rif:iri and xs:NCName and requiresthat constants whose literals areRIF BLD formula under a RIF BLD+XML data combined multi-interpretation (, Î, ) is still different from its interpretation under the standard RIF BLD semantics as defined in that subset[RIF BLD].

Example 2.4. Let expr be interpreted as classes of element information items, associated to XML element namesa well-formed XPath 2.0 expression, and types. Inlet

Notice that <φ, ∅, ∅> |= <ψ, ∅, ∅>, provided that the same way, assertions aboutpair (fn, http://www.w3.org/2005/xpath-functions) belongs to the values of attributes and sub-elements of XML elements, instatically known namespaces when the imported data,XPath expressions are represented using frame formulas, in the importing RIF documents.evaluated; but φ |≠ ψ. This document specifies a subset of the lexical spaces ofis because the symbol spaces rif:iri and xs:NCName and requires thatxs:string constants whose literals"expr", "fn:data(expr)" and "fn:data(.)" are in that subset beinterpreted as [attribute] and [children] properties of element information items. Example 4.1. In asimple string constants under the standard RIF document that importsBLD semantics, whereas they are interpreted according to the sample XML document from Section 3.6. ExampleXPath 2.0 semantics under the semantics of RIF+XML data combination.

Editor's Note: An alternative, less conservative definition for logical entailment in a RIF BLD+XML data model instance , associated with the corresponding XML schema, the first rule, below, sayscombination would be: Let φ and ψ be (document or non-document) formulas. We say that an EarlyCustomer isφ entails ψ in a Customer whose Account number is lower than 1000: Forall ?x (_EarlyCustomer(?x) :- And( ?x # <http://example.org/customertable#Customer> Exists ?y (And ?x[<http://example.org/customertable#Account -> ?y] External(pred:numeric-less-or-equal(?y 1000))))) Notice that,RIF BLD+XML data combination if and only if every model (E, Î, S) of any RIF BLD+XML data combination <φ, E, S> is also a model of the XML document were imported withoutRIF BLD+XML data combination <ψ, E, S>. The XML schema,use cases for the broader definition remain to be examined.


2.3 Operational semantics of RIF consumer processingPRD+XML data combinations

The combination would only have access toeffect on the string valueoperational semantics of a RIF PRD formula of the Account sub-element,combination with XML data, with or without an indication of its type. Inassociated XML schema, is that case,all the ground facts that must be true under a RIF BLD+XML data combined interpretation, must be added to guaranteethe set of ground facts that represents the rule behave as expected,state of the producerfact base.

Notice that, whereas the other clauses affect only the initial state of the fact base, clause 2 in the definition of a RIF document would have to addBLD+XML data combined interpretation modifies the information thatsemantics of the valueAssert action, when the action asserts the membership of ?y must be cast into an integer before being compared as a number. Another example, below, showsa rule that involvesnew object in a combination with dataclass that is representedinterpreted as an attributea schema classifier. Indeed, clause 2, in the XML document.: Forall ?x (_EnglishRec(?x) :-  ?x[<http://www.w3.org/XML/1998/namespace#attribute(lang)> -> "en"^^xs:language])definition, implies that rule could be intended to mean that, if an item is represented, inthe imported XML data, by an elementobject in a membership relationship with an attribute named lang in theXML namespace, and the valueschema classifier (element or type) must interpret an instance of the class: that attribute isis, the xs:language constant en , thennew member object must validate against the information regarding that item is recorded in english. schema definition associated to the class. As a consequence, in the specificationcontext of a RIF BLD, Const denotes the set ofPRD+XML data combination, <R, E, S>,

Assert( object # ClassExpr )

where ClassExpr Classifiers(S), requires, as a prerequisite, that, for all constant symbols and Var denotesthe set of all variable symbols. 4.1.1 Combined interpretationXPath 2.0 expressions, expr, that select a mandatory sub-element or attribute of RIF BLD non-document formulas and schemaless XML datathe simplest case is whenclass, the following fact be true:

object [ "expr" -> value ]

where value has a RIF BLD documentvalue that is combinedvalid with XML data, without an associated XML schema: in that case,respect to the instanceschema definition of the data modelselected sub-element or attribute.

Formally, that means that describesthe XML datadefinition of the RIF-PRD transition relation, defined in [RIF-PRD] (section 3.2, Operational semantics of atomic actions), is built frommodified as follows.

Let W denote the infoset, and it does not assign a type toset of all the elementsstates of the fact base, and attributes contained inL denote the XML document. To makeset of all the definition simpler, we will write that:ground atomic actions in the RIF-PRD action language, as defined in [RIF-PRD].

Let, further, expr-valid<R,E,S>, denote a property of a RIFconstant, c , string-matches the [string value], so Const, with respect to a state of an information item, ithe fact base, w W, in an instance ofthe context of a RIF PRD+XML data model, if and only if c is a constant with type xs:string or a type derived from xs:string and c = s , after white space normalization; a RIF list, l , string-matches the [string value],combination <R, E, S , of an information item, i ,>. We say that o is expr-valid<R,E,S> in an instance of the data model,w if and only if s = L , after white space normalization,expr Classifiers(S) and all the following are true, where LΦ is the order-preserving concatenation of the elementsa set of l , after flattening lground atomic formulas that represents w:

Definition (RIF-PRD transition relation in a ,RIF-PRD+XML data combination). In a RIF-PRD+XML data combination <R, E, S>, the [attributes] propertysemantics of eRIF-PRD atomic actions is specified by the transition relation <R,E,S> W × L × W. A triple (w, α, w') <R,E,S> if and v string-matches the [string value] ofonly if w W, w' W, α is a ; or I ( slot ) = I ( " NAMESPACE # NAME "^^rif:iri ), or I ( slot ) = I ( " NAME "^^xs:NCName )ground atomic action, and

The [children] propertyoperational semantics of e , and v isa RIF List, and v has the same lengthPRD+XML data combination is, then, exactly as specified in [RIF-PRD], except that <R,E,S> replaces RIF-PRD in the sub-list, c ,definition of the [children] of etransition relation, PRS, that contains onlyis one of the element information items whose [namespace name] and [local name] property match, respectively, NAMESPACE and NAME , in document order, and for each paircomponents of elementsa 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 same rank, v iobject in v and c isuch an assertion cannot have some or all the required properties already. As a consequence, all the mandatory properties must be asserted in c , eitherthe [typed value] of c isame action block where the class membership is c i itself and I( v i ) = c i ; orasserted.

Formally, the [typed value] of c iconsequence is not c i , and v i string-matchesthat the [string value] of c i ; For all class membership formulas o # C , where I( o ) = e {I DM }, I truth ( o # C ) = t (true)combination with schema-valid XML data puts 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 I ( C ) = I ( " NAMESPACE # NAME "^^rif:iri ), or I ( C ) = I ( " NAME "^^xs:NCName )and NAMESPACEonly if it is empty, where NAMESPACEa well-formed RIF-PRD action block, according to the definition in [RIF-PRD] (section 3.1.3 - Well-formed action blocks) and NAME are, respectively,it satisfies the values offollowing additional constraint:

Editor's Note: The definition will be further commented and explainedStrictly speaking, since actions are ordered in a future draft.RIF-PRD action blocks, and since the truth valuationoperational semantics of a well-formed RIF BLD formula, φ , under a RIF BLD+schemaless XML data combined interpretation ( {I DM } , I )atomic actions is determined by I truth exactly as specified for the interpretation of RIF BLD non-document formulas (butdefined with respect to a production rule system state, independently from the definition of I truth as modified bysystem state being a system cycle state or a system transitional state, the combination with XML data). Example 4.3. With respectground frame formulas that are required to a RIF BLD+XML data combination, <D, I DMmake o expr-valid<R,E,S> , wherein a RIF BLD document, D , imports the sample XML document from Section 3.6. Examplestate of a data model instance , above, without associating it with any XML schema, and under the semantics for RIF BLD+schemaless XML data combinations as specified above, the followingfacts mustshould be true in all the interpretations whereasserted before the specified conditions hold:membership formula is. However, it is conjectured that is, for each fact, f , I truth ( f ) = t in all interpretations, I , wherethe specified conditions hold.atomic actions in an action block that satisfies the facts mayweaker constraint can, always, be true in other interpretations as well, but notre-orderd to satisfy the stronger constraint, without otherwise affecting the semantics of the action block as a consequence ofwhole; whence the combination (NB:absence of the examples use RIF non-normative presentation syntax, and,ordering constraint in particular,the shortcut presentation syntax for RIF constants,above definition.

See also the (non-normative) appendix on embedding XML data as described inRIF Data Types and Builtins, Section 2.2.2. Shortcutsfacts for constants in RIF's presentation syntax ; see Appendix D: Examples usingan exhaustive description of the RIF/XML normative syntax ): _Customer_John [<http://www.w3.org/XML/1998/namespace#attribute(lang)> -> "en"^^xs:language] mustfacts to be true in all interpretations, I , where I C maps _Customer_John onadded to the second element in I DM (representinginitial state of the first element Customer infact base that is to be combined with the sampleXML data); _Customer_John [<http://www.w3.org/XML/1998/namespace#attribute(lang)> -> "en"] ) must also be truedata.

Example 2.5. In a RIF-PRD+XML data combination <R, E, S>, where S contains all these interpretations, sincethe [string value] oftop-level definitions in the xml:lang attribute matchesXML schema in example 2.1 (all the literal ofexamples assume that the xs:string constant "en" ; _Customer_John [ <http://example.org/customertable#Name> -> "John" ] is requiredpair (ex, <http://example.org/customertable>) belongs to be true in all interpretations where I C maps _Customer_John onthe second element in I DM ; _Customer_John [<http://example.org/customertable#Account> -> 111 ] is not required to be true, even in interpretations where I C maps _Customer_John on[statically known namespaces]small>XP</small> when the second element in I DM : indeed,XPath 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 the xs:integer 111 , and onlyan xs:string constant can string-matchatomic type defined in S. As a string value; _CustomerTable [<http://example.org/customertable#list(Customer)> -> List(_Customer_John, _Customer_Jane) ]consequence, it is included, per clause 3 in all interpretations where I C maps _CustomerTable onthe root elementdefinition of I DM , _Customer_John on the second element, and _Customer_Jane on the fifth element (representing the second element Customera RIF BLD+XML data combined interpretation, in the sample XML data, whose Name sub-element contains the sequenceset of characters: Jane ); _Customer_Johndata types that are taken into account to interpret RIF formulas.)

Do ((?newPin New())
    Assert(?newPIN #  <http://example.org/customertable#Customer> , in all the interpretations where I C maps _Customer_John on"/ex:PIN") )

(Since ex:PIN is a simple type, the second or fifth element in I DM ; _Name_John # <http://example.org/customertable#Name> ,XSD-CD expression /ex:PIN is not in all the interpretations where I C maps _Name_John onClassifiers(S). As a consequence, the third or sixth elementclass membership assertion, in I DM ; "John" # <http://example.org/customertable#Name>the example above, adds no well-formedness constraint that is not requiredspecific to be true in any interpretation, because, perthe RIF PRD+XML data combination: its semantics ofare 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]) )

= I C ( <myNamespace#ID0001>(-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]) )

= e I DM (e.g. the second element, representing the Customer with Name : "John"). Notice that, if our example XML data was not in(The schema definition requires a namespace, thesingle ex:Name value for each ex:Customer information item).

2.4 Semantics of RIF+XMLRIF Core+XML data combinations

would require that the following facts be true, all other required conditions being satisfied: _Customer_John [ "Name" -> "John" ] _CustomerTable [ list("Customer") -> List(_Customer_John, _Customer_Jane) ] _Customer_John # "Customer" _Name_John # "Name" Example 4.4. Consider the following element with mixed-content, and assume that the element is contained in a data source thatRIF Core is imported ina syntactic subset of RIF document, without a namespace nor an associated XML schema: <letterBody> Thank you for ordering the <item>widget</item>. It should arrive by <arrivalDate>09-09-09</arrivalDate> </letterBody> I truth must, underBLD, and the semantics specified above, map the fact: _myLetter["letterBody" -> "Thank you for ordering the Widget. It should arrive by 09-09-09"] , to true in any interpretationof the RIF+XML data combination that maps theRIF local constant _myLetter to an element information item that describes, in theCore+XML data model instance,combinations is identical to the parent elementsemantics of the above letterBody element. 4.1.2 Combined interpretationRIF BLD+XML data combinations for that subset.

RIF Core is also a syntactic subset of RIF BLD non-document formulasPRD, and schema valid XML data Inthe case where asemantics of RIF BLD document is combined with XMLCore+XML data thatcombinations is associated with an XML schema,also identical to the instancesemantics of theRIF PRD+XML data modelcombinations for that describes the importedsubset.

3 Importing XML data is built from the PSVI,and it does ascribe a type to the elements and attributes contained in theXML document. The semantics of these combinations are, essentally, the same asschemas in RIF

In RIF, the schemaless case, except that values are compared using their typed values instead of their string values, and additional conditions are imposed on I truth to take into account information thatImport directive is specific to the PSVI. Accordingly, andused to make the definition simpler, we will write that: a RIF constant, c , type-matchescommunicate the [typed value]location of an information item, i , in an instance of the data model, if and only ifexternal document to be combined with the type of c , T c , andRIF document that contains the typedirective and, optionally, a profile that is identified bygoverns the expanded QNamecombination.

In the [type name] property of i , T i , have a non-empty intersection, and c[RIF-Core], [RIF-PRD] and [RIF-BLD], the [typed value]use of i arethe same value inImport directive is limited to identifying an imported RIF document. [RIF-RDF-OWL] extends it to permit the intersectionidentification of T c and T i ;an RDF graph or an OWL ontology to be combined with a RIF list, l , type-matchesdocument. An optional profile that governs the [typed value]combination of a RIF document with an information item, i , inRDF graph or an instance ofOWL ontology can also be provided, as specified in [RIF-RDF-OWL].

This specification extends the data model, if and only ifImport directive further to permit the typeidentification of i isXML data and/or XML schemas to be combined with a list type andRIF document.

One use case for the elementscombination of l type-match, one-to-oneRIF and in document order, the atomic values in the [typed value] of i , after flattening l . In addition we will write, in the following definition, that two strings, a namespace and an NCName, match, possibly moduloXML data is when a substitution, the values of, respectively,RIF document imports explicitly the [namespace name] and [local name] of an element information item, e , if eitherdata with which the namespace and NCNamerules are the values of, respectively, the [namespace name] and [local name] of e , or e describes an instance E of an XML element that belongsto a substitution group, occursbe combined: in a position wherethat case, the schema requirescombination is imposed by the head element, andproducer of the namespace and NCName areRIF document, as well as the values of, respectively,data to be combined with the [namespace name] and [local name] ofrules that the head element. This specification does not prescribe any semantics for a RIF+XML data combination, whenRIF document contains. We call that case: producer-side combination, and the XML data is associated with an XML schema with respectto which it is not valid. Definition (RIF BLD+schema valid XML databe combined interpretation). Awith the RIF BLD+schema validdocument: imported XML data combined interpretation is.

However, a pair ( {I DM } , I ), where {I DM }significant use case for RIF is a set of element information items constructed from one or more PSVIs, using onerules being published or more XML schemas, XSD i , and where the references have been resolved , and I is a semantic structure,shared as defineda RIF document for consumers to combine them with their own data: in that case, the semanticsconsumer of a RIF BLD, that satisfiesdocument decides independently of the following additional conditions: {I DM } D Ind ; For all frame formulas o [ slot -> v ] , where I( o ) = e {I DM } , I truth ( o [ slot -> v ] ) = t (true) if one of the following is true: I ( slot ) = I ( " NAMESPACE #attribute( NAME )"^^rif:iri ), or I ( slot ) = I ( "attribute( NAME )"^^xs:NCName ) and NAMESPACE is empty, where NAMESPACE and NAME are, respectively, the values ofproducer to combine the [namespace name] and [local name] properties of an attribute information item, a ,rules contained in the [attributes] propertyRIF document with the data of ehis choice. We refer to that case as: consumer-side combination, and v type-matchesto the [typed value] of a ; or I ( slot ) = I ( " NAMESPACE # NAME "^^rif:iri ), or I ( slot ) = I ( " NAME "^^xs:NCName ) and NAMESPACEdata that is empty, where NAMESPACE and NAME match, possibly modulocombined with a substitution,RIF document as: consumer-side data.

3.1 The values of, respectively,extended Import directive

Specifically, the [namespace name] and [local name] properties of an element information item, c , inImport directive is extended as follows:

The [typed value]following constraints must be satisfied:

This specification does not prescribe the behaviour of e ; or I ( C ) = I ( " NAMESPACE #type( NAME )"^^rif:iri ), or I ( C ) = I ( "type( NAME )"^^xs:NCName ) and NAMESPACEa conformant implementation when one of the above constraints is empty, where NAMESPACE and NAME are, respectively,not satisfied.

This specification does not prescribe the namespacebehaviour of 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 prescribe the local name in e 's [type name] property; DTSbehaviour of a conformant implementation when an Import directive contains a profile that is extended to include all the simple types, whether built-inneither http://www.w3.org/2007/rif-import-profile#xml-data nor an IRI that identifies an XML schema or defined in one ofschema.

Example 3.1. The XSD i , thatfirst three import directives, below, are mentionedvalid; the fourth is not:

  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 first directive says that the rules in the [type name] property of any ofimporting RIF document are to be combined with the information itemsdata in the XML document identified by the IRI: http://example.org/customertable.xml and that there is no data model instance. For all subclass formulas sub ## SUP , where sub and SUP are distinct constants of type rif:iri or xs:string , or a type derived from rif:iri or xs:string , I truth ( sub ## SUP ) = t (true) if one of the following is true: I ( sub ) = I ( " NAMESPACE sub #type( NAME sub )"^^rif:iri ), or I ( C ) = I ( "type( NAME sub )"^^xs:NCName ) and NAMESPACE sub is empty, where NAMESPACE sub and NAME sub are, respectively,associated with the values ofimported data in the target namespace and nameform of an element, e sub defined in XSD , one ofXML schema.

The XSD i and either I ( SUP ) = I ( " NAMESPACE SUP # NAME SUP "^^rif:iri ), or I ( C ) = I ( " NAME SUP "^^xs:NCName ) and NAMESPACE SUP is empty, where NAMESPACE SUP and NAME SUP are, respectively,second directive says that the values ofrules in the target namespace and name of an element, e SUP definedimporting RIF document are to be combined with the data in XSD ,the XML document identified by the IRI: http://example.org/customertable.xml and e subthat there is defined ina substitution group wheredata model associated with the head element is e SUP ; or I ( SUP ) = I ( " NAMESPACE SUP #type( NAME SUP )"^^rif:iri ), or I ( C ) = I ( "type( NAME SUP )"^^xs:NCName ) and NAMESPACE SUP is empty, where NAMESPACE SUP and NAME SUP are, respectively,imported data, in the valuesform of the target namespace and name of an XML schema type, T SUP , defined in XSD (not including built-inXML schema data types), and T SUPthat is identified by the type declared inIRI: http://example.org/customertable.xsd.

The definition of e sub , in XSD ; or I ( sub ) = I ( " NAMESPACE sub #type( NAME sub )"^^rif:iri ), or I ( C ) = I ( "type( NAME sub )"^^xs:NCName ) and NAMESPACE sub is empty, and I ( SUP ) = I ( " NAMESPACE SUP #type( NAME SUP )"^^rif:iri ), or I ( C ) = I ( "type( NAME SUP )"^^xs:NCName ) and NAMESPACE SUPthird directive says the data that is empty, where NAMESPACE sub and NAME sub are, respectively,combined with the valuesrules is expected to be an instance of the target namespace and name of and XML schema type, T sub , defined in XSD (not including built-in XML schemadata types), and NAMESPACE SUP and NAME SUP are, respectively, the values ofmodel that is imported as the target namespace and name of an XML schema type, T SUP , defined in XSD (not including built-inXML schema identified by the IRI: http://example.org/customertable.xsd; but the directive does not say what data types), and T subis derived by restriction or by extension from T SUP .   ☐ Editor's Note:to be combined with the case defined byrules.

The fourth directive violates the first bullet under 2.band 2.c couldsecond constraints: the dummy location consumer-side-data, that indicates that the profile is to be further refined,applied to differentiate betweenconsumer-side data, is incompatible with the case of an empty element andprofile xml-data. Therefore, the casedirective is out of the null value: inscope of this specification.

3.2 Interpretation of Imports

For the latter case,purpose of interpreting the schema must definecombination of a nillable content for the element. Shall we leaveRIF document, R, and XML data, let dataLocation(R) denote the interpretation toset of the implementations or shall we include itURIs in that spec? If the latter, we must include a rif:NULL constant in every symbol space... Editor's Note: Condition 4 will be further refined in a future draft, to account for the problem posed bythe inclusionlocation sub-elements of some data types in a RIF interpretation, e.g. xs:duration. Editor's Note:the definition will be further refinedimport directives, in a future draft to account for cases such as xs:anyType typed elements. Editor's Note: The definition will be further commentedR and explainedin a future draft.the truth valuation of a well-formed RIF BLD formula, φ , under aRIF BLD+schema valid XML data combined interpretation ( {I DM }documents that are imported, directly or indirectly, in R, I )whose profile is determined by I truth exactly as specified foreither rif:xml-data or identifies an XML schema; and let dataDocuments(R) denote the interpretationset of RIF BLD non-document formulas (but withthe definitiondocument [nodes]XDM in the instances of I truth as modified bythe combination with XML data). Example 4.5. Following up on Example 4.3 , above, but assumingdata model that encapsulate the RIF BLD document is combined withinformation in all the sampleXML data, associated withdocuments that are identified by an URI in dataLocation(R). If dataLocation(R) contains the XML schema, asdummy URI http://www.w3.org/2007/rif-import-location#consumer-side-data, dataDocuments(R) includes, also, the document [node]XDM in Section 3.6. Examplean instance of athe data model instance ,that encapsulates the following hold with respect toconsumer-side data. In the interpretationabsence of sample facts, underconsumer-side data, the semanticsdocument node bears no information.

If an Import directive identifies an XML schema as its profile, the corresponding instance of the RIF BLD+schema valid XMLdata combination: _Customer_John [<http://www.w3.org/XML/1998/namespace#attribute(lang)> -> "en"^^xs:language] must be true in all interpretations, I , where I C maps _Customer_John onmodel includes the second elementinformation from the PSVI that results from validating the XML data referenced in I DM (representingthe first element Customer inlocation against that schema. Otherwise, the sample XML data); but _Customer_John [<http://www.w3.org/XML/1998/namespace#attribute(lang)> -> "en"] ) must not, sinceinstance of the xs:string constant "en" does not type-matchdata model is built from the xs:language [typed value]: en ; _Customer_John [<http://example.org/customertable#Account> -> 111 ] must be true in all interpretations where I C maps _Customer_John oninfoset.

If an Import directive has the second element in I DM (but, e.g. _Customer_John [<http://example.org/customertable#Account> -> "111" ] must not); _PIN_Jane # <http://example.org/customertable#type(PIN)> must be true in all interpretations where I C maps _PIN_Jane onvalue: http://www.w3.org/2007/rif-import-location#consumer-side-data as a locator, the eighth (and last) element in I DM Notice that _PIN_Jane # <http://www.w3.org/2001/XMLSchema#type(integer)> is never required to be true in any interpretationinstance of the example RIF BLD+schema valid XMLdata combination, even in interpretations where I C maps _PIN_Jane onmodel that encapsulates the last element in I DM , althoughconsumer-side data, if any, includes the XML schema type http://example.org/customertable#PIN is derived by restrictioninformation from xs:integer . That is because xs:insteger is not defined inthe associated XML schema ( "the namespace of C and NAME [must] match, respectively,PSVI that results from validating the target namespace anddata against the name of an XML schema type defined in XSD (not including built-inXML schema data types)" , condition 4.bidentified in the definition of RIF BLD+schema valid XML data combined interpretations ). 4.1.3 Combined interpretationprofile of RIF BLD documents andthat directive.

As a consequence, if different Import directives associate different XML data Editor's Note:schemas to the definition ofconsumer-side data, the combined interpretationinstance of non-document RIF BLD formulas and XMLthe data model that encapsulates the consumer-side data, where some ofif any, includes the information from the PSVI that results from validating the XMLdata is associated with anagainst the XML schema and some is not, follows directlythat results from importing or including, into an otherwise empty schema, all the definitions of the schemaless and schema valid cases. It will be developed explicitlyXML 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.locator.

Given a RIF+XML data combination < R , D 1 , ..., D n >, n 0 , where R is anRIF BLDdocument, and the D i , 1 i n , are all the XML documents that are, either, imported, directly or indirectly, byR, or that contain consumer-side XML data, is interpreted using a RIF BLD+XMLthe set of data combined interpretation ( {I DM } , Î ), where: {I DM } = 1...n {I DM i }model nodes, E, in the unionRIF+XML data combination <R, E, S> is the set of all the sets, {I DM i } , 1 i ndocument nodes in dataDocuments(R), and of all the element information itemsdata model nodes that can be reached from those document nodes.

In the instances ofsame way, S, the schema definitions component in the RIF+XML data model that represent, each, one ofcombination <R, E, S>, includes all the XML documentstop level schema definitions found in ( D 1 , ..., D n ); Î is a semantic multi-structurethe XML schemas that is defined exactlyare imported as specified forthe interpretationprofile of an import directive in R or in a RIF BLDdocument formulas, exceptthat the I truth component in each semantic structure, I , contained in Î ,is subject to the additional conditions requiredimported, directly or indirectly, in R.

For the combined interpretation ( {I DM } , I ). The truth valuationpurpose of evaluating XPath 2.0 expressions, when interpreting a RIF+XML data combination < R , D 1 , ..., D nR, E, S>, n 0 , is determined exactly as specified forthe truth valuation of a RIF BLD document formulas, using[in-scope schema definitions]XP include all the RIF BLD+XML data combined interpretation ( {I DM } , Î ) in place of a semantic multi-structure.schema definitions in S, all the same way, the notions of modelschema type, schema element and of logical entailmentschema attribute definitions that are defined for a RIF BLD+XML data combined interpretation, using exactly the same definition as specified for RIF BOLD (document and non-document) formulas, where the semantic multi-structure, Î , is replaced bycomponents of the RIF BLD+XML data combined interpretation ( {I DM } , Î ). Notice that,top level definitions in the case where no XML data is imported, that is, if n = 0S, {I DM } is empty,and all the interpretation of a RIF BLD document under a RIF BLD+XML data combined interpretation ( , Î ) is strictly equivalent to its interpretation under the standard RIF BLD semantics. 4.2 Operational semantics of RIF PRD+XML data combinations The effectschema types defined in [XSD 1.1 Part2].

Example 3.2. Continuing example 3.1, above, notice that none of the combination with XML data,three valid directives is incompatible with or without an associated XML schema, onthe operational semantics of a RIF PRD document, isother two, but that a ground fact, f , must be added tocombining the set of ground facts thatfirst two is associated withconfusing and error-prone, since directive #2 supersedes directive #1. Including effectively useless directives should be avoided.

Combining directive #2 and #3 says that the state ofrules in the fact base that isimporting document are meant to be combined withapplied only to data that validates against the XML data, if itschema in example 2.1, where the data is true under a RIF BLD+XML data combined interpretation, as defined in the previous section (schemaless or schema valid case, depending on whether the XML data is associated with an associated schemaimported or not). See also the (non-normative) appendix on embedding XML data as RIF facts for an exhaustive description of the facts to be added to the initial state of the fact base that is to be combined with the XML data. Editor's Note:from the definition will be further commented and explained in a future draft. Example.consumer-side.

4 Conformance

Editor's Note: ExamplesThis section will be addedcompleted in a future draft.

4.3 Semantics of RIF Core+XML data combinations RIF Core is a syntactic subset of RIF BLD,5 References

[Infoset]
XML Information Set (Second Edition), John Cowan and the semantics of RIF Core+XML data combinationsRichard Tobin, Editors. World Wide Web Consortium, 04 Feb 2004. This version is identical tohttp://www.w3.org/TR/2004/REC-xml-infoset-20040204/. The semantics of RIF BLD+XML data combinations for that subset. RIF Corelatest version is also a syntactic subset of RIF PRD,available at http://www.w3.org/TR/xml-infoset/.

[RFC 3986]
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, T. Berners-Lee, R. Fielding, and the semantics ofL. 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+XML data combinations is also identical to the semantics ofCore Dialect Harold Boley, Gary Hallmark, Michael Kifer, Adrian Paschke, Axel Polleres, Dave Reynolds, eds. W3C Editor's Draft, 28 October 2012, http://www.w3.org/2005/rules/wg/draft/ED-rif-core-20121028/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-core/.

[RIF-BLD]
RIF PRD+XML data combinations for that subset. Notice, in particular, that the condition on the interpretation of subclass formulas, condition 5 in the definition of a RIF BLD+schema valid XML data combined interpretation, permits the simplification of the condition on the interpretation of membership formulas (condition 3). Since subclass formulas are not defined in RIF Core, the condition on the interpretation of membership formulas (condition 3), in the definition of a RIF Core+schema valid XML data combined interpretation, must be extended to account explicitly for all the membership formulas whose interpretation follows, in the RIF BLD+schema valid XML data case, from the axioms on the truth valuation of subclass and membership formulas . 5 ConformanceBasic Logic Dialect Harold Boley, Michael Kifer, eds. W3C Editor's Note: This section will be completed in a future draft. 6 The special case of RDFDraft, 28 October 2012, http://www.w3.org/2005/rules/wg/draft/ED-rif-bld-20121028/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-bld/.

[RIF-DTB]
RIF Datatypes and OWL data sourcesBuilt-Ins 1.0 Axel Polleres, Harold Boley, Michael Kifer, eds. W3C Editor's Note: RDF and OWL data sources can be imported inDraft, 28 October 2012, http://www.w3.org/2005/rules/wg/draft/ED-rif-dtb-20121028/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-dtb/.

[RIF-PRD]
RIF documents in two different ways: according to the RIF-RDF-OWL specification, that specifies the combination ofProduction Rule Dialect Christian de Sainte Marie, Gary Hallmark, Adrian Paschke, eds. W3C Editor's Draft, 28 October 2012, http://www.w3.org/2005/rules/wg/draft/ED-rif-prd-20121028/. Latest version available at http://www.w3.org/2005/rules/wg/draft/rif-prd/.

[RIF-RDF-OWL]
RIF documents with RDF and OWL graphs, directly or as an XML document. This section examines how these two ways of importingRDF and OWL documents relate. The section will be completed in a future draft. 7 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-20040204Compatibility Jos de Bruijn, Chris Welty, eds. W3C Editor's Draft, 28 October 2012, http://www.w3.org/2005/rules/wg/draft/ED-rif-rdf-owl-20121028/. TheLatest version isavailable at http://www.w3.org/TR/xml-infosethttp://www.w3.org/2005/rules/wg/draft/rif-rdf-owl/.

[ RFC 3986 ] RFC 3986: Uniform Resource Identifier (URI): Generic Syntax , T. Berners-Lee, R. Fielding,[XDM]
XQuery 1.0 and L. Masinter. January 2005. Available at: http://www.ietf.org/rfc/rfc3986.txt [ RFC 3987 ] RFC 3987: Internationalized Resource Identifiers (IRIs)XPath 2.0 Data Model (XDM), M. Duerst andFernández, A. Malhotra, J. Marsh, 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.Nagy, N. Walsh, Editors. W3C Recommendation, 22 June 2010, http://www.w3.org/TR/2010/REC-rif-core-20100622/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/rif-core/http://www.w3.org/TR/xpath-datamodel/.

[RIF-BLD] RIF Basic Logic Dialect Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, http://www.w3.org/TR/2010/REC-rif-bld-20100622/[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/rif-bld/http://www.w3.org/TR/xpath-functions/.

[RIF-PRD] RIF Production Rule Dialect Christian de Sainte Marie, Gary Hallmark, Adrian Paschke, eds.[XML]
Extensible Markup Language (XML) 1.0 (Fifth Edition), T. Bray, J. Paoli, C. M. Sperberg-McQueen, E. Maler, F. Yergeau, Editor. W3C Recommendation, 22 June 2010, http://www.w3.org/TR/2010/REC-rif-prd-20100622/Recommendation 26 November 2008. This version is http://www.w3.org/TR/2005/REC-xml-id-20050909/. The latest version is available at http://www.w3.org/TR/rif-prd/http://www.w3.org/TR/REC-xml/.

[RIF-RDF-OWL] RIF RDF and OWL Compatibility Jos de Bruijn, editor.[xml:id]
xml:id Version 1.0, J. Marsh, D. Veillard, N. Walsh, Editors. W3C Recommendation, 22 June 2010, http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/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/rif-rdf-owl/http://www.w3.org/TR/xml-id/.

[XDM] XQuery 1.0 and XPath[XPath 2.0]
XML Path Language (XPath) 2.0 Data Model (XDM), M. Fernández,D. Chamberlin , A. Malhotra, J. Marsh, M. Nagy, N. Walsh,Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 JanuaryJan 2007. This version is http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/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 latest versionelement information items that describe a given XML document. Document order is available at http://www.w3.org/TR/xml-id . [XPath 2.0]a total ordering. Informally, document order is the order in which nodes appear in the XML Path Language (XPath) 2.0 , D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This versionserialization 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 http://www.w3.org/TR/2007/REC-xpath20-20070123/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 value of its arguments represented as a xs:string. If no argument is supplied, the [context item]XP is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the [context item]XP had been passed as the latest versionargument.
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/a node, the function returns the [string-value]XDM of the node.
If the argument is an atomic value, then the function returns the value of the argument cast as a xs:string.

8 Appendix A: Glossary (non-normative) Editor's Note: ThisGoverning type definition (from [XSD 1.1 Part 1], section will be completed3.2.4.2 for an attribute, section 3.3.4.6 for an element)
The governing type definition of an attribute, in a future draft. Expanded QName An expanded QNamegiven schema-validity ·assessment· episode, is a setthe {type definition} of three values consistingthe ·governing attribute declaration·, unless the processor has stipulated another type definition at the start of ·assessment· (see Assessing Schema-Validity (§5.2)), in which case it is the stipulated type definition.
The governing type definition of an element information item E, in a possibly empty prefix, a possibly empty namespace URI, andgiven schema-validity ·assessment· episode, is the first of the following which applies:
  1. An ·instance-specified type definition· which ·overrides· a local name. ( http://www.w3.org/TR/xpath-datamodel/#dt-expanded-qname ) QNametype definition stipulated by the processor (see Assessing Schema-Validity (§5.2)).
  2. A qualified nametype definition stipulated by the processor (see Assessing Schema-Validity (§5.2)).
  3. An ·instance-specified type definition· which ·overrides· the ·selected type definition· of E.
  4. The ·selected type definition· of E.
  5. The value ·absent· if E is ·skipped·.
  6. An ·instance-specified type definition· which ·overrides· the ·locally declared type·.
  7. The ·locally declared type·.
  8. An ·instance-specified type definition·.
If none of these apply, there is a name subject to namespace interpretation.no ·governing type definition· (or, in documents conforming toequivalent words, it is ·absent·).


In-scope schema definitions (from [XPath 2.0], section 2.1.1)
This specification,is a generic term for all the element anddeclarations, attribute names appear as qualified names. Syntactically, they are either prefixed names or unprefixed names. An attribute-based declaration syntax is provided to bind prefixes to namespace namesdeclarations, and to bind a default namespaceschema type definitions that applies to unprefixed element names; these declarationsare scoped by the elements on which they appear so that different bindings may applyin different partsscope during processing of a document. ( http://www.w3.org/TR/REC-xml-names/#dt-qualname ) 9 Appendix B: Extract froman expression.] It includes [the In-scope schema types, the XQuery 1.0 and XPath 2.0 Data Model (non-normative) 9.1In-scope element declarations, the substitution groups and the In-scope attribute declarations].


Node type names(from [XDM ]) Editor's Note: This section reproduces the text of], section 3.3.1.1. Element and Attribute Node Type Names in2.1)
(from [XDM], for the reader's convenience. Notice that, for the purposesection 2.1) There are seven kinds of this specification,Nodes in the type name is considered unknown,data model: document, element, attribute, text, namespace, processing instruction, and comment.
(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 [type name] propertytyped value of a node is left empty, when the [validity] property does not exista sequence of zero or is "unknown" andmore atomic values. The [validation attempted] property does not exist orstring value of a node is "none". Notation: Some aspectsa value of type assignment rely onxs:string. The ability to access propertiesname of the schema components. Such properties are indicated by the style {component property}. Note that this does not meana lightweight schema processor cannot be used, it only means that the application must have some mechanism to access the necessary properties. The precise definitionnode is a value of the schematype xs:QName.

Normalized value (from [XSD 1.1 Part 1], section 3.1.4)
The normalized value of an element or attribute information item depends onis an initial value which has been normalized according to the propertiesvalue of the PSVI. In the PSVI, [Schema Part 1] defines a [type definition] property as well as the [type definition namespace], [type definition name]whiteSpace facet, and [type definition anonymous] properties, which are effectively short-cut terms for propertiesthe values of any other pre-lexical facets, associated with the simple 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] givendefinition used in its validation.
The PSVI for the element orinitial value of an attribute instance from the [type definition] associated with the declaration, the formerinformation item is referred to below as the actual type andthe latternormalized attribute value, as specified in [XML], section 3.3.3 (Attribute-value normalization). Similarly, the declared typeinitial value of thean element or attribute instance in question. The type depends on the declared type, the actual type, andinformation item is the [validity] and [validation attempted] propertiesstring composed of, in document order, the PSVI. If: The [validity] and [validation attempted] properties exist and have the values "valid" and "full", respectively,character code of each character information item in the schema type[children]info of anthat element or attributeinformation item is represented byitem.

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 expanded-QName whose namespace and local name correspondattribute's normalized value is valid with respect to the first applicable items ingoverning type definition, then the schema normalized value of the attribute is the following list:normalized value as validated, otherwise it is absent.
If the declared type exists andan element information item is a unionnot nilled and either the actualgoverning type definition is (not the same as the declared type, and nota simple type derived from the declared type, but) one of the member types of the union,definition or derived from one ofits member types: If{content type} has {variety} simple, then the {name} propertyschema normalized value of the declared typeelement is present:the {target namespace} and {name} propertieslexical form of the declared type.its value constraint if applicable; else, if the {name} property ofelement's initial value is valid with respect to the declaredsimple 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 declared type. If thereitem as validated; otherwise it is no declared type, and the actual typeabsent.

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

String value
The actual type. If the {name} propertystring value of the actual typea node is absent: the namespacea string and local name of the anonymous type name supplied forcan be extracted by applying the actual type. Otherwise: If [type definition anonymous] is false:fn:string function to the {target namespace}node.
(from [XDM], section 3.3.1.3) Element and attribute nodes have both typed-value and {name}string-value properties. However, implementations are allowed some flexibility in how these properties of the actual type. If [type definition anonymous] is true:are stored. An implementation may choose to store the namespacestring-value only and local name of the anonymous type name supplied forderive 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 properly 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 D:C: Examples using the normative RIF/XML syntax

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

129 Appendix E:D: Change Log (non-normative)

Since the WD published 22 June 2010: