index.html 114 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846
<!DOCTYPE html  PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>RIF Combination with XML data</title>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  <style type="text/css">
   .editsection { display: none; }
</style>
<link href="tr.css" rel="stylesheet" type="text/css" />
<link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css" />

  
</head>
<body>

<div class="head">
<a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72" /></a><h1 id="title" style="clear:both"><span id="short-title">RIF Combination with XML data</span></h1>

<h2 id="W3C-doctype">W3C Working Draft 22 June 2010</h2>

<!-- no inplace warning -->
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/" id="this-version-url">http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/</a></dd>

<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/rif-xml-data/">http://www.w3.org/TR/rif-xml-data/</a></dd>

<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2010/WD-rif-xml-data-20100511/">http://www.w3.org/TR/2010/WD-rif-xml-data-20100511/</a> (<a href="http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/diff-from-20100511">color-coded diff</a>)</dd>
</dl>

<dl><dt>Editors:</dt><dd>Christian de Sainte Marie, IBM</dd>
</dl>



<p>This document is also available in these non-normative formats: <a href="http://www.w3.org/2010/pdf/WD-rif-xml-data-20100622.pdf">PDF version</a>.</p>



<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2010 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>

</div>
<hr />
<h2><a id="abstract" name="abstract">Abstract</a></h2>

<div>
<div><p></p> <p></p> <p></p> <p>This document, developed by the <a class="external text" href="http://www.w3.org/2005/rules" title="http://www.w3.org/2005/rules">Rule Interchange Format (RIF) Working Group</a>, specifies how a RIF document can be combined with XML data. </p> <p></p></div>
</div>

<h2 class="no-toc no-num">
<a id="w3c_status" name="w3c_status">Status of this Document</a>
</h2>
    
<h4 class="no-toc no-num" id="may-be">May Be Superseded</h4>
    
<p><em>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 <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>


<h4 class="no-toc no-num" id="related">Set of Documents</h4>

<p>This document is being published as one of a set of 11 documents: </p>
<ol>
<li><a href="http://www.w3.org/TR/2010/NOTE-rif-overview-20100622/">RIF Overview</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">RIF Core Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/">RIF Basic Logic Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/">RIF Production Rule Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/">RIF Framework for Logic Dialects</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/">RIF Datatypes and Built-Ins 1.0</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/">RIF RDF and OWL Compatibility</a></li>
<li><a href="http://www.w3.org/TR/2010/NOTE-rif-owl-rl-20100622/">OWL 2 RL in RIF</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/">RIF Combination with XML data</a>  (this document)</li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-in-rdf-20100622/">RIF In RDF</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-test-20100622/">RIF Test Cases</a></li>
</ol>

    

<!-- no eventStatusExtra -->

<!-- no statusExtra -->

<div>
<h4 class="no-toc no-num" id="sotd-xml-dep">XML Schema Datatypes Dependency</h4>

<p>RIF is defined to use datatypes defined in the <a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Definition Language (XSD)</a>.  As of this writing, the latest W3C Recommendation for XSD is version 1.0, with <a href="http://www.w3.org/TR/xmlschema11-1/">version 1.1</a> progressing toward Recommendation.  RIF has been designed to take advantage of the new datatypes and clearer explanations available in XSD 1.1, but for now those advantages are being partially put on hold.  Specifically, until XSD 1.1 becomes a W3C Recommendation, the elements of RIF which are based on it should be considered <em>optional</em>, as detailed in <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#XML_Schema_Datatypes">Datatypes and Builtins, section 2.3</a>.  Upon the publication of XSD 1.1 as a W3C Recommendation, those elements will cease to be optional and are to be considered required as otherwise specified.</p>

<p>We suggest that for now developers and users follow the <a href="http://www.w3.org/TR/2009/WD-xmlschema11-1-20091203/">XSD 1.1 Last Call Working Draft</a>.  Based on discussions between the Schema, RIF and OWL Working Groups, we do not expect any implementation changes will be necessary as XSD 1.1 advances to Recommendation.</p>
</div>



           <h4 class="no-toc no-num" id="status-changes">Summary of Changes</h4>

            <div>
 
 <p>The semantics were completely reworked.</p> 
</div>



<h4 class="no-toc no-num" id="please">Please Comment By 20 July 2010</h4><p>The <a href="http://www.w3.org/2005/rules/wg.html">Rule Interchange Format (RIF) Working Group</a> seeks
    public feedback on this Working Draft.  Please send your
    comments to <a class="mailto" href="mailto:public-rif-comments@w3.org" shape="rect">public-rif-comments@w3.org</a> (<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-comments/" shape="rect">public archive</a>).  If possible, please offer
    specific changes to the text that would address your
    concern.  You may also wish to check the <a href="http://www.w3.org/2005/rules/wiki/XML-Data">Wiki
    Version</a> of this document and see if the relevant text has already 
    been updated.</p>
    
<h4 class="no-toc no-num" id="no-endorsement">No Endorsement</h4>
    
<p><em>Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.</em></p>


<h4 class="no-toc no-num" id="patents">Patents</h4>
    
<p><em>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/38457/status" rel="disclosure">public list of any patent disclosures</a> 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 <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure"> section 6 of the W3C Patent Policy</a>.</em></p>

<hr title="Separator After Status Section" />


<p><span class="anchor" id="sec-overview"></span> 
</p>
<table class="toc" id="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a></li>
<li class="toclevel-1"><a href="#Importing_XML_documents_and_schemas_in_RIF"><span class="tocnumber">2</span> <span class="toctext">Importing XML documents and schemas in RIF</span></a></li>
<li class="toclevel-1"><a href="#A_simple_data_model_for_XML_documents"><span class="tocnumber">3</span> <span class="toctext">A simple data model for XML documents</span></a>
<ul>
<li class="toclevel-2"><a href="#Definitions"><span class="tocnumber">3.1</span> <span class="toctext">Definitions</span></a></li>
<li class="toclevel-2"><a href="#Element_information_items"><span class="tocnumber">3.2</span> <span class="toctext">Element information items</span></a></li>
<li class="toclevel-2"><a href="#Attribute_information_items"><span class="tocnumber">3.3</span> <span class="toctext">Attribute information items</span></a></li>
<li class="toclevel-2"><a href="#Character_information_items"><span class="tocnumber">3.4</span> <span class="toctext">Character information items</span></a></li>
<li class="toclevel-2"><a href="#Resolution_of_references"><span class="tocnumber">3.5</span> <span class="toctext">Resolution of references</span></a></li>
<li class="toclevel-2"><a href="#Example_of_a_data_model_instance"><span class="tocnumber">3.6</span> <span class="toctext">Example of a data model instance</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#RIF_combination_with_XML_data"><span class="tocnumber">4</span> <span class="toctext">RIF combination with XML data</span></a>
<ul>
<li class="toclevel-2"><a href="#Model-theoretic_semantics_of_RIF_BLD.2BXML_data_combinations"><span class="tocnumber">4.1</span> <span class="toctext">Model-theoretic semantics of RIF BLD+XML data combinations</span></a>
<ul>
<li class="toclevel-3"><a href="#Combined_interpretation_of_RIF_BLD_non-document_formulas_and_schemaless_XML_data"><span class="tocnumber">4.1.1</span> <span class="toctext">Combined interpretation of RIF BLD non-document formulas and schemaless XML data</span></a></li>
<li class="toclevel-3"><a href="#Combined_interpretation_of_RIF_BLD_non-document_formulas_and_schema_valid_XML_data"><span class="tocnumber">4.1.2</span> <span class="toctext">Combined interpretation of RIF BLD non-document formulas and schema valid XML data</span></a></li>
<li class="toclevel-3"><a href="#Combined_interpretation_of_RIF_BLD_documents_and_XML_data"><span class="tocnumber">4.1.3</span> <span class="toctext">Combined interpretation of RIF BLD documents and XML data</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Operational_semantics_of_RIF_PRD.2BXML_data_combinations"><span class="tocnumber">4.2</span> <span class="toctext">Operational semantics of RIF PRD+XML data combinations</span></a></li>
<li class="toclevel-2"><a href="#Semantics_of_RIF_Core.2BXML_data_combinations"><span class="tocnumber">4.3</span> <span class="toctext">Semantics of RIF Core+XML data combinations</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Conformance"><span class="tocnumber">5</span> <span class="toctext">Conformance</span></a></li>
<li class="toclevel-1"><a href="#The_special_case_of_RDF_and_OWL_data_sources"><span class="tocnumber">6</span> <span class="toctext">The special case of RDF and OWL data sources</span></a></li>
<li class="toclevel-1"><a href="#References"><span class="tocnumber">7</span> <span class="toctext">References</span></a></li>
<li class="toclevel-1"><a href="#Appendix_A:_Glossary_.28non-normative.29"><span class="tocnumber">8</span> <span class="toctext">Appendix A: Glossary (non-normative)</span></a></li>
<li class="toclevel-1"><a href="#Appendix_B:_Extract_from_the_XQuery_1.0_and_XPath_2.0_Data_Model_.28non-normative.29"><span class="tocnumber">9</span> <span class="toctext">Appendix B: Extract from the XQuery 1.0 and XPath 2.0 Data Model (non-normative)</span></a>
<ul>
<li class="toclevel-2"><a href="#Element_and_attribute_node_type_names_.28from_.5BXDM.5D.29"><span class="tocnumber">9.1</span> <span class="toctext">Element and attribute node type names (from [XDM])</span></a></li>
<li class="toclevel-2"><a href="#Typed_value_determination_.28from_.5BXDM.5D.29"><span class="tocnumber">9.2</span> <span class="toctext">Typed value determination (from [XDM])</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Appendix_C:_Embedding_imported_data_sources_as_RIF_facts_.28non-normative.29"><span class="tocnumber">10</span> <span class="toctext">Appendix C: Embedding imported data sources as RIF facts (non-normative)</span></a></li>
<li class="toclevel-1"><a href="#Appendix_D:_Examples_using_the_normative_RIF.2FXML_syntax"><span class="tocnumber">11</span> <span class="toctext">Appendix D: Examples using the normative RIF/XML syntax</span></a></li>
<li class="toclevel-1"><a href="#Appendix_E:_Change_Log_.28non-normative.29"><span class="tocnumber">12</span> <span class="toctext">Appendix E: Change Log (non-normative)</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a id="Overview" name="Overview"></a><h2> <span class="mw-headline">1  Overview </span></h2>
<p>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.
</p><p>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.
</p><p>This document specifies a standard semantics for combinations of RIF documents and XML data. It uses a data model for XML documents, that is a simplified version of the XQuery 1.0 and XPath 2.0 Data Model [<a href="#ref-xdm" title="">XDM</a>].
</p><p>The <a href="#ref-xdm" title="">XQuery 1.0 and XPath 2.0 Data Model</a> (XDM) specifies what information is accessible in a collection of XML documents, but it does not specify the language used to represent or access the data: this document specifies an implementation, using the RIF condition language, of a simplified version of the XDM. This makes the RIF condition language comparable to other implementations of the XDM, such as [<a href="#ref-xpath-20" title="">XPath 2.0</a>] and [<a href="#ref-xquery" title="">XQuery 1.0</a>].
</p><p>Like the <a href="#ref-xdm" title="">XQuery 1.0 and XPath 2.0 Data Model</a>, the simplified version used in this document supports the following classes of XML documents:
</p>
<ul><li> Well-formed documents conforming to [Namespaces in XML] or [Namespaces in XML 1.1].
</li><li> DTD-valid documents conforming to [Namespaces in XML] or [Namespaces in XML 1.1], and
</li><li> W3C XML Schema-validated documents.
</li></ul>
<p>Accordingly, this document specifies how a RIF document is combined with well-formed, and, where an XML schema is specified, schema-valid  XML documents. The semantics is independent on the provenance of the XML data in a combination: it can be imported explicitly in a RIF document, or combined on the consumer-side, or a combination of both. However, only XML schemas that are explicitly imported in the RIF document are taken into account for the interpretation of the combination. This provides a way to communicate the data model that is intended, in a RIF document, for the data source, without specifying an actual data source.
</p><p>Section 2 specifies how the <tt>rif:Import</tt> directive is used to import an XML document and an XML schema are import in a RIF document.
</p><p>The RIF data model for XML documents is described in section 3.
</p><p>Section 4 specifies a standard 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 semantics of RIF PRD combinations with XML data is, then, defined, based on the definition of a RIF BLD+XML data combined interpretation (section 4.2); finally, the semantics of RIF Core combinations with XML data is defined with respect to the model-theoretic semantics of the combination of RIF BLD and XML data and the operational semantics of the combination of RIF PRD and XML data (section 4.3).
</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> This section will be completed in a future draft.</p>
<p><br />
</p>
<a id="Importing_XML_documents_and_schemas_in_RIF" name="Importing_XML_documents_and_schemas_in_RIF"></a><h2> <span class="mw-headline">2  Importing XML documents and schemas in RIF </span></h2>
<p>In RIF, the <tt>Import</tt> directive is used to communicate the location of an external document to be combined with the RIF document that contains the directive and, optionally, a profile that governs the combination.
</p><p>In [<a href="#ref-core" title="">RIF-Core</a>], [<a href="#ref-prd" title="">RIF-PRD</a>] and [<a href="#ref-bld" title="">RIF-BLD</a>], the use of the <tt>Import</tt> directive is limited to identifying an imported RIF document, or an RDF graph or an OWL ontology to be combined with a RIF document. An optional profile that governs the combination of a RIF document with an RDF graph or an OWL ontology can also be provided, as specified in [<a href="#ref-swc" title="">RIF-RDF-OWL</a>]. 
</p><p>This specification extends the <tt>Import</tt> directive in four ways:
</p>
<ol><li> The IRI of any XML document is allowed as a value of the <tt>location</tt> sub-element, that contains the IRI that identifies the imported data document;
</li><li> The new value: <tt>http://www.w3.org/2007/rif-import-profile#xml-data</tt>, is defined for the profile of an import, indicating that the imported document is an XML document with no associated XML schema;
</li><li> In addition, any IRI that identifies an XML schema document is allowed as a profile, identifying the XML schema that is associated with the imported XML data;
</li><li> Finally, a new value: <tt>http://www.w3.org/2007/rif-import-location#no-data</tt>, is allowed for the location of an import, indicating that the directive does not require the import of a data document
</li></ol>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The extended syntax is still under discussion. Other approaches include:
(i) to make the location sub-element optional as well;
(ii) to reserve new keywords in the <tt>http://www.w3.org/2007/rif-import-profile</tt> namespace, such as: <tt>xml-schema</tt>, <tt>xml-schema-valid-data</tt>, etc, and to add a specific construct for the schema locator.</p>
<p>The following constraints must be satisfied:
</p>
<ul><li> If an <tt>Import</tt> directive does not require the import of a data document, the <tt>profile</tt> must be specified;
</li><li> The two special values <tt>http://www.w3.org/2007/rif-import-location#no-data</tt>, for the location, and <tt>http://www.w3.org/2007/rif-import-profile#xml-data</tt>, for the profile, are not allowed in the same <tt>Import</tt> directive;
</li><li> If the <tt>profile</tt> of an <tt>Import</tt> directive identifies an XML Schema and if the data document provides a <tt>schema-location</tt>, the <tt>profile</tt> must identify the same XML schema as the <tt>schema-location</tt> IRI;
</li><li> If the profile is <tt>rif:xml-data</tt>, the <tt>location</tt> must identify an XML document.
</li></ul>
<p>This specification does not prescribe the behaviour of a conformant implementation when one of the above constraints is not satisfied.
</p><p>This specification does not prescribe the behaviour of a conformant implementation when an <tt>Import</tt> directive contains a <tt>profile</tt> that is neither <tt>rif:xml-data</tt> nor an IRI that identifies an XML schema.
</p><p><b>Example 2.1.</b> The first three import directives, below, are valid; the fourth is not:
</p>
<ol><li> <tt>Import(http://example.org/customertable.xml http://www.w3.org/2007/rif-import-profile#xml-data)</tt>
</li><li> <tt>Import(http://example.org/customertable.xml http://example.org/customertable.xsd)</tt>
</li><li> <tt>Import(http://www.w3.org/2007/rif-import-location#no-data http://example.org/customertable.xsd)</tt>
</li><li> <tt>Import(http://www.w3.org/2007/rif-import-location#no-data http://www.w3.org/2007/rif-import-profile#xml-data)</tt>
</li></ol>
<p>The first directive says that the rules in the importing RIF document are to be combined with the data in the XML document identified by the IRI: <tt>http://example.org/customertable.xml</tt> and that there is no data model associated with the imported data in the form of an XML schema.
</p><p>The second directive says that the rules in the importing RIF document are to be combined with the data in the XML document identified by the IRI: <tt>http://example.org/customertable.xml</tt> and that there is a data model associated with the imported data, in the form of the XML schema that is identified by the IRI: <tt>http://example.org/customertable.xsd</tt>.
</p><p>The third directive says the data that is combined with the rules is expected to be an instance of the data model that is imported as the XML schema identified by the IRI: <tt>http://example.org/customertable.xsd</tt>; but the directive does not say what data is to be combined with the rules.
</p><p>The fourth directive violates one of the constraint: therefore, it is out of the scope of this specification.
</p><p>Notice that none of the three valid directives is incompatible with the other two, but that combining the first two is confusing and error-prone, and should be avoided; and that the third one is redundant with the second, and that combining the two is useless and confusing, and that it should be avoided.
</p><p><span class="anchor" id="sec-data-model"></span>
</p>
<a id="A_simple_data_model_for_XML_documents" name="A_simple_data_model_for_XML_documents"></a><h2> <span class="mw-headline">3  A simple data model for XML documents </span></h2>
<p>This section defines the RIF data model for XML documents (henceforth "the data model"). The data model serves two purposes: it specifies the information that is accessible to a RIF consumer in an XML document, possibly in combination with an XML schema; and it is used to specify the interpretation of the combination of RIF with XML data.
</p><p>The data model is a simplified version of the XQuery 1.0 and XPath 2.0 Data Model [<a href="#ref-xdm" title="">XDM</a>]. As a consequence, the RIF condition language can be considered a partial implementation of the XQuery 1.0 and XPath 2.0 Data Model, and the interpretation of the RIF condition language with respect to XML documents can be specified in terms of the XQuery 1.0 and XPath 2.0 Data Model or its implementations, such as XPath 2.0 [<a href="#ref-xpath-20" title="">XPath 2.0</a>]. This document will reuse definitions from the <a href="#ref-xdm" title="">XQuery 1.0 and XPath 2.0 Data Model</a> and the <a href="#ref-xpath-20" title="">XPath 2.0</a> specifications, as appropriate, and otherwise provide pointers and examples where relevant.
</p>
<a id="Definitions" name="Definitions"></a><h3> <span class="mw-headline">3.1  Definitions </span></h3>
<p>The data model specifies the <i>information items</i> from the XML infoset [<a href="#ref-infoset" title="">Infoset</a>] and from the post-schema validation infoset (PSVI), or derived from the infoset and the PSVI, that are required to interpret some RIF constructs with respect to an XML document.
</p><p><b>Definition (Information item).</b> <i>(from [<a href="#ref-infoset" title="">Infoset</a>])</i> An <i><b>information item</b></i> is an abstract description of some part of an XML document: each information item has a set of associated named properties.&nbsp;&nbsp;
</p><p>In this document, an information item is said to be <i>constructed from an infoset</i>, if the data item that it describes is contained in a data source that is not associated with an XML schema when it is imported in RIF. If the data source is associated with an XML schema, all the information items used to describe the content of that data source are said to be <i>constructed from a PSVI</i>.
</p><p>If an information item is constructed from an infoset, all general and external parsed entities must be fully expanded before the data model is constructed.
</p><p>In this specification, the property names are shown in square brackets, <b>[thus]</b>.
</p><p>The data model relies on three types of information items:
</p>
<ul><li> <i><a href="#sec-element-ii" title="">Element information items</a></i>, that describe the elements 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];
</li><li> <i><a href="#sec-attribute-ii" title="">Attribute information items</a></i>, that describe the attributes of elements. The properties associated with the attribute information item are: [namespace name], [local name], [attribute type], [owner element], [type name], [string value], [typed value], [is-id], [is-idrefs];
</li><li> <i><a href="#sec-char-ii" title="">Character information items</a></i>, that describe the data characters that appear in the XML document. The character information item has two properties: [character code] and [element content whitespace].
</li></ul>
<p>Given a data source, the relevant set of information items may be created by methods other than parsing and/or schema-validating an XML document. This specification does not describe or prescribe any method for retrieving the required information from a data source, possibly combined with an XML schema.
</p><p>This specification distinguishes between the data model as a general concept and specific items (information items or atomic values) that are concrete examples of the data model. For the purpose of this specification, the term <i>instance of the data model</i> will be used exclusively to denote such concrete examples of the data model that are sequences of element information items in document order.
<span class="anchor" id="def-data-model-instance"></span>
<b>Definition (Instance of the data model).</b> An <i><b>instance of the data model</b></i> is a sequence of element information items, in document order. In particular, given an XML document <i>D</i>, the <i>instance of the data model that describes D</i> is the sequence of all the element information items that describe an element contained in <i>D</i>, in document order.&nbsp;&nbsp;
</p><p>When there is no ambiguity with respect to <i>D</i>, the instance of the data model that describes <i>D</i> will be called, simply: <i>the instance of the data model</i>. 
</p><p><b>Definition (Atomic value).</b> An <i><b>atomic value</b></i> is a value in the value space of an atomic type and is labeled with the name of that atomic type.&nbsp;&nbsp;
</p><p><b>Definition (Atomic type).</b> An <i><b>atomic type</b></i> is one of the 20 primitive simple types defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#built-in-primitive-datatypes" title="http://www.w3.org/TR/xmlschema11-2/#built-in-primitive-datatypes">Section 3.3 Primitive Datatypes</a> of [<a href="#ref-xsd11-2" title="">XSD 1.1 Part 2</a>] or a type derived by restriction from another atomic type.&nbsp;&nbsp;
</p><p>Types derived by list or union are not atomic.
</p><p><b>Definition (Sequence).</b> A <i><b>sequence</b></i> is an ordered collection of zero or more information items.&nbsp;&nbsp;
</p><p>A sequence cannot be a member of a sequence. An important characteristic of the data model is that there is no distinction between an item (a information item or an <i>atomic value</i>) and a singleton sequence containing that item. An item is equivalent to a singleton sequence containing that item and vice versa.
</p><p>Except when specified otherwise, sequences are ordered according to the <i>document order</i>.
</p><p><b>Definition (Document order).</b> A <i><b>document order</b></i> is defined among all the element information items that describe a given XML document. Document order is a total ordering. Informally, document order is the order in which nodes appear in the XML serialization of a document.&nbsp;&nbsp;
</p><p>Within a tree, <i>document order</i> satisfies the following constraints:
</p>
<ol><li> The root node is the first node.
</li><li> Every node occurs before all of its children and descendants.
</li><li> The relative order of siblings is the order in which they occur in the [children] property of their parent node.
</li><li> Children and descendants occur before following siblings.
</li></ol>
<p>XML element, attribute and type names are usually represented as XML qualified names, or QNames. However, <tt>xs:QName</tt> is not a RIF-Core built-in datatype. In the data model, all qualified names, including atomic values, are represented as <i>expanded QNames</i>.
</p><p><span class="anchor" id="def-expanded-qname"></span>
<b>Definition (Expanded QName).</b> An <i><b>expanded QName</b></i> is a set of three values consisting of a possibly empty prefix, a possibly empty namespace IRI and a local name.&nbsp;&nbsp;
</p><p>Notice that the prefix is never used in this document, and expanded QNames will be dealt with, in all but definition, as consisting of a possibly empty namespace IRI and a local name
</p><p><span class="anchor" id="sec-element-ii"></span>
</p>
<a id="Element_information_items" name="Element_information_items"></a><h3> <span class="mw-headline">3.2  Element information items </span></h3>
<p>There is an <i>element information item</i> for each element appearing in the XML document. One of the element information items corresponds to the root of the element tree, and all other element information items are accessible by recursively following its [children] property.
</p><p>An element information item has the following properties:
</p>
<ol><li> [<b>namespace name</b>] The namespace name, if any, of the element. If the element does not belong to a namespace, this property has no value;
</li><li> [<b>local name</b>] The local part of the element name. This does not include any namespace prefix or following colon;
</li><li> [<b>children</b>] An ordered list of child information items, in document order. This list contains only <i>element information items</i> and <i>character information items</i>, one for each element and data character appearing immediately within the current element. It does not contain other kinds of information items, such as <i>attribute information items</i>, even if the XML element described by the information item has attributes. If the element is empty, this list has no members;
</li><li> [<b>root</b>] The element information item that describes the root element in the XML document. The [root] property of all the element information items that describe elements contained in the same XML document point to the same root element information item, including that root element information item itself. If the [root] property of an element information item points to that element information item itself, the [root] properties of all the element information items that are accessible by following its [children] property, recursively, must point to that same root element information item;
</li><li> [<b>attributes</b>] An unordered set of attribute information items, one for each of the attributes of this element. This includes all of the "special" attributes (<tt>xml:lang</tt>, <tt>xml:space</tt>, <tt>xsi:type</tt>, 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 the element has no attributes, this set has no members;
</li><li> [<b>type name</b>] The [type name] property of an element information item is empty if,  and only if, the element information item is constructed from an infoset. If the element information item is constructed from a PSVI, the type name is represented by an expanded QName. It is determined as described in <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#PSVI2NodeTypes" title="http://www.w3.org/TR/xpath-datamodel/#PSVI2NodeTypes">Section 3.3.1.1. Element and Attribute Node Type Names</a> from [<a href="#ref-xdm" title="">XDM</a>] (reproduced in <a href="#ref-appendix-type-name" title="">appendix 9.1, Element and attribute node type names,</a> for the reader's convenience);
</li><li> [<b>string value</b>] The normalised representation of the content of the element as a string. The string value is calculated as follows:
<ul><li> If the element is empty or if it does not have any character information item children nor descendants, its string value is the zero length string;
</li><li> Else, if the [type name] property of the element information item is empty, or  if the element has a complex type with element-only content, or a complex type with mixed content, its string value is the string comprised of characters that correspond to the [character code] properties of each of the character information item children of the element and all its descendants, in document order. If the resulting string consists entirely of whitespace and the [element content whitespace] property of the character information items used to construct it are true, the string value is the zero-length string;
</li><li> Else, if the element has a simple type or a complex type with simple content: its string value is the <a class="external text" href="http://www.w3.org/TR/xmlschema11-1/#a-schema_normalized_value" title="http://www.w3.org/TR/xmlschema11-1/#a-schema_normalized_value">schema normalized value</a> of the element;
</li><li> 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;
</li></ul>
</li><li> [<b>typed value</b>] The typed-value is calculated as follows:
<ul><li> If the element is empty or if it has element-only children, its typed value is the element itself; more precisely, if an 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 <a href="#ref-xdm" title="">XQuery 1.0 and XPath 2.0 Data Model</a>: the latter document specifies 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 element information item, to access its [children] and [attributes] properties from its [typed value] (see the definitions of combined interpretations in <a href="#sec-implementation" title="">Section 4, RIF combination with XML data</a>);
</li><li> Else, if the [type name] property of the element information item is empty, or if the element has a complex type with mixed content (including xs:anyType), its typed value is the same as its string value;
</li><li> Otherwise, the element must have a simple type or a complex type with simple content. Its typed value is computed as described in <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#TypedValueDetermination" title="http://www.w3.org/TR/xpath-datamodel/#TypedValueDetermination">Section 3.3.1.2 Typed Value Determination</a>, in [<a href="#ref-xdm" title="">XDM</a>] (reproduced in <a href="#ref-appendix-typed-value" title="">appendix 9.2, Typed value determination,</a> for the reader's convenience). The result is a sequence of zero or more atomic values. The relationship between the values of the [type name], [typed value], and [string value] properties of an element information item is consistent with XML Schema validation. Note that in the case of <tt>xs:QName</tt>s and <tt>xs:NOTATION</tt>s, the prefix is not preserved, and the typed values are represented as expanded QNames. This is a minor deviation from the <a href="#ref-xdm" title="">XQuery 1.0 and XPath 2.0 Data Model</a>, but this specification does not use the prefix;
</li></ul>
</li><li> [is-id] If the [type name] property of an element information item is empty, or if the element has a complex type with element-only content, the [is-id] property is false. Else, if the typed value of the element consists of exactly one atomic value, that value is of type <tt>xs:ID</tt>, or a type derived from <tt>xs:ID</tt>, the [is-id] property is true; otherwise it is false;
</li><li> [is-idrefs] If the [type name] property of an element information item is empty, or if the element has a complex type with element-only content, the [is-idrefs] property is false. Else, if any of the atomic values in the typed-value of the element is of type <tt>xs:IDREF</tt> or <tt>xs:IDREFS</tt>, or a type derived from one of those types, the [is-idrefs] property is true; otherwise it is false.
</li></ol>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> Although minor, the deviations from the XQuery 1.0 and XPath 2.0 Data Model (XDM) may preclude using code developed for XDM. They are still under discussion. The working group is seeking feedback on the issue (<a class="external text" href="http://www.w3.org/2005/rules/wg/track/issues/103" title="http://www.w3.org/2005/rules/wg/track/issues/103">ISSUE-103</a>).</p>
<p><span class="anchor" id="sec-attribute-ii"></span>
</p>
<a id="Attribute_information_items" name="Attribute_information_items"></a><h3> <span class="mw-headline">3.3  Attribute information items </span></h3>
<p>There is an attribute information item for each attribute (specified or defaulted) of each element in the document, excluding those which are namespace declarations (because they are not attributes).
</p><p>Attributes declared in the DTD with no default value and not specified in the element's start tag are not represented by attribute information items.
</p><p>An attribute information item has the following properties:
</p>
<ol><li> [<b>namespace name</b>] The namespace name, if any, of the attribute. Otherwise, this property has no value;
</li><li> [<b>local name</b>] The local part of the attribute name. This does not include any namespace prefix or following colon;
</li><li> [<b>attribute type</b>] An indication of the type declared for this attribute in the DTD. The only values that are relevant to this specification are <tt>ID</tt>, <tt>IDREF</tt> and <tt>IDREFS</tt>. If there is no declaration for the attribute, or if no declaration has been read, this property has no value. The value of this property is not affected by the validity of the attribute value;
</li><li> [<b>owner element</b>] The element information item which contains this information item in its [attributes] property;
</li><li> [<b>type name</b>] Empty if the attribute information item is constructed from an infoset. If the attribute information item is constructed from a PSVI, the type name is represented as an expanded QName, and it is determined as described in <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#PSVI2NodeTypes" title="http://www.w3.org/TR/xpath-datamodel/#PSVI2NodeTypes">Section 3.3.1.1. Element and Attribute Node Type Names</a> from [<a href="#ref-xdm" title="">XDM</a>] (reproduced in <a href="#ref-appendix-type-name" title="">Appendix B</a> for the reader's convenience);
</li><li> [<b>string value</b>] The <a class="external text" href="http://www.w3.org/TR/xmlschema11-1/#a-schema_normalized_value" title="http://www.w3.org/TR/xmlschema11-1/#a-schema_normalized_value">schema normalized value</a> PSVI property if that exists; otherwise, the normalized attribute value according to <a class="external text" href="http://www.w3.org/TR/REC-xml/#AVNormalize" title="http://www.w3.org/TR/REC-xml/#AVNormalize">Section 3.3.3 Attribute-Value Normalization</a> in [<a href="#ref-xml" title="">XML</a>]). Note that, if the attribute has a typed value, any valid lexical representation of the typed value can be used to determine the string value;
</li><li> [<b>typed value</b>] The typed-value is calculated as follows:
<ul><li> If the [type name] property of an attribute information item is empty, its typed value is the same as its string value;
</li><li> Otherwise, a sequence of zero or more atomic values as described in <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#TypedValueDetermination" title="http://www.w3.org/TR/xpath-datamodel/#TypedValueDetermination">Section 3.3.1.2 Typed Value Determination</a>, in [<a href="#ref-xdm" title="">XDM</a>] (reproduced in <a href="#ref-appendix-typed-value" title="">Appendix B</a> for the reader's convenience). The relationship between the values of the [type name], [typed value], and [string value] properties of an attribute information item is consistent with XML Schema validation.
</li></ul>
</li><li> [<b>is-id</b>] If the attribute is named <tt>xml:id</tt> and its [attribute type] property does not have the value <tt>ID</tt> and its [type name] property does not have the value <tt>xs:ID</tt>, then [<a href="#ref-xml-id" title="">xml:id</a>] processing is performed. This will assure that the value does have the type <tt>ID</tt> or <tt>xs:ID</tt> (if the attribute information item is constructed from an infoset or from a PSVI, respectively) and that it is properly normalized. The [is-id] property is always true for attributes named <tt>xml:id</tt>. Else, if the [attribute type] property has the value <tt>ID</tt>, or if the type name is <tt>xs:ID</tt> or a type derived from <tt>xs:ID</tt>, the [is-id] property is true; otherwise, it is false. This specicification does not prescribe the behaviour of a RIF consumer application if an error is encountered during [<a href="#ref-xml-id" title="">xml:id</a>] processing.
</li><li> [<b>is-idrefs</b>] True if the value of the [attribute type] property is <tt>IDREF</tt> or <tt>IDREFS</tt>, or if any of the atomic values in the typed-value of the attribute is of type <tt>xs:IDREF</tt> or <tt>xs:IDREFS</tt>, or a type derived from one of those types. Otherwise, false.
</li></ol>
<p><span class="anchor" id="sec-char-ii"></span>
</p>
<a id="Character_information_items" name="Character_information_items"></a><h3> <span class="mw-headline">3.4  Character information items </span></h3>
<p>There is a character information item for each data character that appears in the document, whether literally, as a character reference, or within a CDATA section.
</p><p>Each character is a logically separate information item, but applications are free to chunk characters into larger groups as necessary or desirable.
</p><p>A character information item has the following properties:
</p>
<ol><li> [<b>character code</b>] The ISO 10646 character code (in the range 0 to #x10FFFF, though not every value in this range is a legal XML character code) of the character.
</li><li> [<b>element content whitespace</b>] A boolean indicating whether the character is white space appearing within element content (see [<a href="#ref-xml" title="">XML</a>], Section 2.10. White Space Handling). Note that validating XML processors are required to provide this information. If there is no declaration for the containing element, or if there are multiple declarations, or if no declaration has been read, this property has no value for white space characters. It is always false for characters that are not white space. 
</li></ol>
<p><span class="anchor" id="sec-resolution-of-references"></span>
</p>
<a id="Resolution_of_references" name="Resolution_of_references"></a><h3> <span class="mw-headline">3.5  Resolution of references </span></h3>
<p><span class="anchor" id="def-reference"></span>
<b>Definition (Reference information item).</b> Given an information item, <i>I</i>, whose [is-id] is true, and given an atomic value, <i>id</i>, of type <tt>ID</tt>, <tt>IDREF</tt>, <tt>xs:ID</tt>, or <tt>xs:IDREF</tt>, that matches one of the atomic values in <i>I' </i>s [typed value] property, the <i><b>reference information item</b></i> identified by <i>id</i> is the element information item, <i>R</i>, such that
</p>
<ul><li> its [root] property has the same value as the [root] property of <i>I</i>, if <i>I</i> is an element information item, or as the [root] property of the element information item pointed to by the [owner element] property of <i>I</i>, if <i>I</i> is an attribute information element;
</li><li> and
<ul><li> either the [is-id] property of <i>R</i> is true and its [typed value] property matches <i>id</i>;
</li><li> or the [is-id] property of one of the attribute information items in <i>R' </i>s [attributes] property is true, and the [typed value] property of that attribute information item matches <i>id</i>.&nbsp;&nbsp;
</li></ul>
</li></ul>
<p>Note that the reference information item is always an <i>element</i>.
</p><p>Where this specification states, with respect to a set of information items, that the <i>references are resolved</i>, the following processing is applied to every information item in the set whose [id-refs] property is true:
</p>
<ul><li> If the information item is an element information item, <i>E</i>, and
<ul><li> if its typed value is a single atomic value of type <tt>xs:IDREF</tt> or <tt>xs:IDREFS</tt> or a type derived from one of those types, <i>E</i> itself is replaced with its <a href="#def-reference" title="">reference information item</a>;
</li><li> or, if its typed value is a sequence that contains more than one atomic value, each atomic value that is of type <tt>xs:IDREF</tt> or <tt>xs:IDREFS</tt> or a type derived from one of those types is replaced with the typed value of its <a href="#def-reference" title="">reference information item</a>, after the references in that typed value have been resolved, if the [id-refs] property of the reference information item is true;
</li></ul>
</li><li> otherwise, the information item must be an attribute information item, <i>A</i>, and every atomic value in the typed value of <i>A</i> is replaced with its <a href="#def-reference" title="">reference information item</a>.
</li></ul>
<p>No property value is changed in any information item: the references are resolved only on a "need-to-resolve" basis, where the specification of <a href="#sec-implementation" title="">RIF as an implementation of the data model</a> requires them to be resolved.
</p><p>This specification does not prescribe a behavior if an error is encountered during reference resolution processing (such as <tt>IDREF</tt>s without corresponding <tt>ID</tt>s, invalid or duplicate <tt>ID</tt>s, etc).
</p><p><span class="anchor" id="ex32"></span>
</p>
<a id="Example_of_a_data_model_instance" name="Example_of_a_data_model_instance"></a><h3> <span class="mw-headline">3.6  Example of a data model instance </span></h3>
<p>Consider the following XML document, representing data about customers:
</p>
<pre>&lt;CustomerTable xmlns="http://example.org/customertable"
               xmlns:xml="http://www.w3.org/XML/1998/namespace"&gt;
  &lt;Customer xml:lang="en"&gt;
    &lt;Name&gt; John &lt;/Name&gt;
    &lt;Account&gt; 111 &lt;/Account&gt;
  &lt;/Customer&gt;
  &lt;Customer xml:lang="fr"&gt;
    &lt;Name&gt; Jane &lt;/Name&gt;
    &lt;Account&gt; 222 &lt;/Account&gt;
    &lt;PIN&gt; 222 &lt;/PIN&gt;
  &lt;/Customer&gt;
&lt;/CustomerTable&gt;
</pre>
<p>Consider, further, the following XML schema:
</p>
<pre>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xml="http://www.w3.org/XML/1998/namespace"
           targetNamespace="&lt;nowiki&gt;http://example.org/customertable&lt;/nowiki&gt;"
           xmlns="&lt;nowiki&gt;http://example.org/customertable&lt;/nowiki&gt;"&gt;  

  &lt;xs:simpleType name="PIN"&gt;
    &lt;xs:restriction base="xs:integer"&gt;
      &lt;xs:minInclusive value="100"/&gt;
      &lt;xs:maxExclusive value="1000"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;

  &lt;xs:element name="Name" type="xs:string"/&gt;
  &lt;xs:element name="Account" type="xs:integer"/&gt;
  &lt;xs:element name="PIN" type="PIN"/&gt;
  
  &lt;xs:element name="Customer"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref="Name"/&gt;
        &lt;xs:element ref="Account"/&gt;
        &lt;xs:element ref="PIN" minOccurs="0"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;xs:attribute ref="xml:lang"/&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name="CustomerTable"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:all&gt;
        &lt;xs:element ref="Customer" minOccurs="0"/&gt;
      &lt;/xs:all&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

&lt;/xs:schema&gt;
</pre>
<p>The instance of the data model that describes the XML document associated with the schema is a sequence that contains the following eight element information items, in the same order as the numbered list below. When relevant to examples further in this document, the values for some of the properties are given for both cases where the instance of the data model had been constructed from the infoset, marked as: <i>(no schema)</i>, and where it has been been constructed from the PSVI, marked as: <i>(schema)</i>:
</p>
<ol><li> an element information item representing the <tt>CustomerTable</tt> element, with the following values for its properties
<ul><li> [namespace name]: http://example.org/customertable
</li><li> [local name]: CustomersTable
</li><li> [children]: a sequence of two element information items, which are the two <tt>Customer</tt> element information items in the data model instance, in the same order; that is, items 2 and 5 in the data model instance, in that order
</li><li> [root]: the element information item itself
</li><li> [attributes]: empty
</li><li> [type name]: 
<dl><dd> <i>(no schema)</i> empty
</dd><dd> <i>(schema)</i> http://example.org/customertable <i>"some locally unique identifier for the anonymous type of the <tt>CustomerTable</tt> element"</i>
</dd></dl>
</li><li> [string value]: "John 111 Jane 222 222"
</li><li> [typed value]: the element information item itself
</li><li> [is-id]: false
</li><li> [is-idrefs]: false
</li></ul>
</li><li> an element information item that describes the first <tt>Customer</tt> element in the document, with the following values for its properties
<ul><li> [namespace name]: http://example.org/customertable
</li><li> [local name]: Customer
</li><li> [children]: a sequence of two element information items, which are items 3 and 4 in the data model instance, describing the <tt>Name</tt> and <tt>Account</tt> sub-elements, respectively, in that same order
</li><li> [root]: same value as the [root] property of the previous element information item
</li><li> [attributes]: a attribute information item representing the <tt>xml:lang</tt> attribute. The attribute information item has the following values for its attributes:
<ul><li> [namespace name]: http://www.w3.org/XML/1998/namespace
</li><li> [local name]: lang
</li><li> [Attribute type]: empty
</li><li> [owner element]: the previous element information item
</li><li> [type name]: 
<dl><dd> <i>(no schema)</i> empty
</dd><dd> <i>(schema)</i>  http://www.w3.org/2001/XMLSchema language
</dd></dl>
</li><li> [string value]: "en"
</li><li> [typed value]: en
</li><li> [is-id]: false
</li><li> [is-idrefs]: false
</li></ul>
</li><li> [type name]:  
<dl><dd> <i>(no schema)</i> empty
</dd><dd> <i>(schema)</i> http://example.org/customertable <i>"some locally unique identifier for the anonymous type <tt>Customer</tt>"</i>
</dd></dl>
</li><li> [string value]: "John 111"
</li><li> [typed value]: the element information item itself
</li><li> [is-id]: false
</li><li> [is-idrefs]: false
</li></ul>
</li><li> an element information item representing the <tt>Name</tt> sub-element of the first <tt>Customer</tt> element in the document, with the following values for its properties
<ul><li> [namespace name]: http://example.org/customertable
</li><li> [local name]: Name
</li><li> [children]: a sequence of four character information items, spelling <i>j&nbsp;o&nbsp;h&nbsp;n</i>, in that order
</li><li> [root]: same value as the [root] property of the previous element information item
</li><li> [attributes]: empty
</li><li> [type name]:  
<dl><dd> <i>(no schema)</i> empty
</dd><dd> <i>(schema)</i> http://www.w3.org/2001/XMLSchema string
</dd></dl>
</li><li> [string value]: "John"
</li><li> [typed value]: "John"
</li><li> [is-id]: false
</li><li> [is-idrefs]: false
</li></ul>
</li><li> an element information item representing the <tt>Account</tt> sub-element of the first <tt>Customer</tt> element in the document, with the following values for its properties
<ul><li> [namespace name]: http://example.org/customertable
</li><li> [local name]: Account
</li><li> [children]: a sequence of three character information items, spelling <i>1&nbsp;1&nbsp;1</i>, in that order
</li><li> [root]: same value as the [root] property of the previous element information item
</li><li> [attributes]: empty
</li><li> [type name]:  
<dl><dd> <i>(no schema)</i> empty
</dd><dd> <i>(schema)</i> http://www.w3.org/2001/XMLSchema integer
</dd></dl>
</li><li> [string value]: "111"
</li><li> [typed value]: 111
</li><li> [is-id]: false
</li><li> [is-idrefs]: false
</li></ul>
</li><li> an element information item that describes the second <tt>Customer</tt> element in the document;
</li><li> an element information item representing the <tt>Name</tt> sub-element of the second <tt>Customer</tt> element in the document;
</li><li> an element information item representing the <tt>Account</tt> sub-element of the second <tt>Customer</tt> element in the document;
</li><li> an element information item representing the <tt>PIN</tt> sub-element of the second <tt>Customer</tt> element in the document, with the following values for its properties
<ul><li> [namespace name]: http://example.org/customertable
</li><li> [local name]: PIN
</li><li> [children]: a sequence of three character information items, spelling <i>2&nbsp;2&nbsp;2</i>, in that order
</li><li> [root]: same value as the [root] property of the previous element information item
</li><li> [attributes]: empty
</li><li> [type name]:  
<dl><dd> <i>(no schema)</i> empty
</dd><dd> <i>(schema)</i> http://example.org/customertable PIN
</dd></dl>
</li><li> [string value]: "222"
</li><li> [typed value]: 222
</li><li> [is-id]: false
</li><li> [is-idrefs]: false
</li></ul>
</li></ol>
<p><br />
<span class="anchor" id="sec-implementation"></span>
</p>
<a id="RIF_combination_with_XML_data" name="RIF_combination_with_XML_data"></a><h2> <span class="mw-headline">4  RIF combination with XML data </span></h2>
<p>This section specifies the semantics of the combination of RIF documents and XML data, for RIF Core, RIF PRD and RIF BLD, where the XML data may be associated with an XML schema.
</p><p><span class="anchor" id="def-rif.2Bxml-data-combination"></span>
<b>Definition (RIF+XML data combination).</b> A <i><b>RIF+XML data combination</b></i> is a tuple &lt;<i>R</i>, <i>D<sub>1</sub></i>, ..., <i>D<sub>n</sub></i>&gt;, <i>n &ge; 1</i>, where <i>R</i> is a RIF document and <i>D<sub>1</sub></i>, ..., <i>D<sub>n</sub></i> are XML documents. &nbsp;&nbsp;
</p><p>One use case for the combination of RIF and XML data is when a RIF document imports explicitly the data to which the rules are to be applied: this is the case when the RIF document contains one or more <tt>Import</tt> directives where the <tt>location</tt> identifies explicitly an XML document to be combined with the importing RIF document. In that case, the combination is imposed by the producer of the RIF document, as well as the data to be combined with the rules that the RIF document contains. We call that case: <i>producer-side combination</i>, and the XML data to be combined with the RIF document: <i>imported XML data</i>.
</p><p>However, a significant use case for RIF is rules being published or shared as a RIF document for consumers to apply them to their own data. In that case, the consumer of a RIF document decides independently of the producer to combine the rules contained in the RIF document with the data of his choice. We refer to that case as: <i>consumer-side combination</i>, and to the data that is combined with a RIF document as: <i>consumer-side data</i>.
</p><p>This section specifies a normative semantics for the combination of a RIF document with XML data, without distinguishing between the two cases; that is, independently of whether the XML data to be combined with the RIF document is imported XML data or consumer-side XML data, or a combination of both. However, it provides a means to require that consumer-side XML data be valid with respect to an XML schema that is imposed by the producer of the RIF document.
</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> ...and thus to interchange, along with the rules, the data model with respect to which they have been designed. And thus, to combine RIF with any data model that can be represented in an XML Schema (including object models). Explanation, use case and example will be added in a future draft.</p>
<p><span class="anchor" id="def-associated-xml-schema"></span>
<b>Definition (Associated XML schema).</b> An XML document, <i>D<sub>i</sub></i>, is <i><b>associated with an XML schema</b></i>, <i>XSD</i>, in the context of a RIF+XML data combination, &lt;<i>R</i>, <i>D<sub>1</sub></i>, ..., <i>D<sub>i</sub></i>, ..., <i>D<sub>n</sub></i>&gt;, <i>n &ge; 1</i>, if and only if one of the following is true:
</p>
<ul><li> The RIF document, <i>R</i>, contains an <tt>Import</tt> directive, where the <tt>location</tt> identifies the imported XML document <i>D<sub>i</sub></i> and the <tt>profile</tt> identifies <i>XSD</i>;
</li><li> The RIF document, <i>R</i>, contains an <tt>Import</tt> directive, where the <tt>location</tt> is missing, the <tt>profile</tt> identifies <i>XSD</i>, and <i>D<sub>i</sub></i> is a consumer-side XML document that validates against <i>XSD</i>.
</li></ul>
<p>
</p><p><br />
</p><p><span class="anchor" id="sec-model-theoretic-semantics-of-rif-bld.2Bxml-data-combinations"></span>
</p>
<a id="Model-theoretic_semantics_of_RIF_BLD.2BXML_data_combinations" name="Model-theoretic_semantics_of_RIF_BLD.2BXML_data_combinations"></a><h3> <span class="mw-headline">4.1  Model-theoretic semantics of RIF BLD+XML data combinations </span></h3>
<p>The model-theoretic semantics of RIF BLD defines a <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#Semantic_Structures" title="BLD">semantic structure</a> as a tuple <i>I</i> =
&lt;<i><b>TV</b></i>, <i><b>DTS</b></i>, <i><b>D</b></i>, <i><b>D</b></i><sub>ind</sub>,
<i><b>D</b></i><sub>func</sub>, <i><b>I</b></i><sub>C</sub>, <i><b>I</b></i><sub>V</sub>,
<i><b>I</b></i><sub>F</sub>, <i><b>I</b></i><sub>NF</sub>, <i><b>I</b></i><sub>list</sub>, <i><b>I</b></i><sub>tail</sub>, <i><b>I</b></i><sub>frame</sub>,
<i><b>I</b></i><sub>sub</sub>, <i><b>I</b></i><sub>isa</sub>, <i><b>I</b></i><sub>=</sub>,
<i><b>I</b></i><sub>external</sub>, <i><b>I</b></i><sub>truth</sub>&gt;.
</p><p>The specification of the model-theoretic semantics of a RIF BLD+XML data combination follows closely the specification of the semantics of a RIF BLD document, except that the notion of semantic structures is replaced by the notion of <i>RIF BLD+XML data combined interpretations</i>: informally, RIF BLD+XML data combined interpretations are RIF BLD semantic structures, with additional conditions on some of the elements of <i><b>I</b></i>.
</p><p>The basic idea is that pieces of imported data are represented, for the purpose of combination with RIF, by information items in instances of the data model. Assertions about the names of XML elements in the imported data, and, where defined, their types, are represented using class membership and subclass formulas, in the importing RIF documents. This document specifies a subset of the lexical spaces of the symbol spaces <tt>rif:iri</tt> and <tt>xs:NCName</tt> and requires that constants whose literals are in that subset be interpreted as classes of element information items, associated to XML element names and types.
</p><p>In the same way, assertions about the values of attributes and sub-elements of XML elements, in the imported data, are represented using frame formulas, in the importing RIF documents. This document specifies a subset of the lexical spaces of the symbol spaces <tt>rif:iri</tt> and <tt>xs:NCName</tt> and requires that constants whose literals are in that subset be interpreted as [attribute] and [children] properties of element information items.
</p><p><span class="anchor" id="ex41"></span>
<b>Example 4.1.</b> In a RIF document that imports the sample XML document from <a href="#ex32" title="">Section 3.6. Example of a data model instance</a>, associated with the corresponding XML schema, the first rule, below, says that an <i>EarlyCustomer</i> is a <i>Customer</i> whose <i>Account</i> number is lower than 1000:
</p>
<pre>Forall&nbsp;?x (_EarlyCustomer(?x)&nbsp;:-
           And(&nbsp;?x # &lt;http://example.org/customertable#Customer&gt;
                Exists&nbsp;?y (And&nbsp;?x[&lt;http://example.org/customertable#Account -&gt;&nbsp;?y]
                               External(pred:numeric-less-or-equal(?y 1000)))))
</pre>
<p>Notice that, if the XML document were imported without the XML schema, the RIF consumer processing the combination would only have access to the string value of the <tt>Account</tt> sub-element, without an indication of its type. In that case, to guarantee that the rule behave as expected, the producer of the RIF document would have to add the information that the value of <tt>?y</tt> must be cast into an integer before being compared as a number.
</p><p>Another example, below, shows a rule that involves a combination with data that is represented as an attribute in the XML document.:
</p>
<pre>Forall&nbsp;?x (_EnglishRec(?x)&nbsp;:-
          &nbsp;?x[&lt;http://www.w3.org/XML/1998/namespace#attribute(lang)&gt; -&gt; "en"^^xs:language])
</pre>
<p>That rule could be intended to mean that, if an item is represented, in the imported XML data, by an element with an attribute named <tt>lang</tt> in the XML namespace, and the value of that attribute is the <tt>xs:language</tt> constant <tt>en</tt>, then the information regarding that item is recorded in english.
</p><p><br />

</p><p>As in the specification of RIF BLD, <tt>Const</tt> denotes the set of all constant symbols and <tt>Var</tt> denotes the set of all variable symbols.
</p><p><span class="anchor" id="sec-combined-interpretation-of-rif-bld.2Bschemaless-xml-data"></span>
</p>
<a id="Combined_interpretation_of_RIF_BLD_non-document_formulas_and_schemaless_XML_data" name="Combined_interpretation_of_RIF_BLD_non-document_formulas_and_schemaless_XML_data"></a><h4> <span class="mw-headline">4.1.1  Combined interpretation of RIF BLD non-document formulas and schemaless XML data </span></h4>
<p>The simplest case is when a RIF BLD document is combined with XML data, without an associated XML schema: in that case, the instance of the data model that describes the XML data is built from the infoset, and it does not assign a type to the elements and attributes contained in the XML document.
</p><p>To make the definition simpler, we will write that:
</p>
<ul><li> a RIF constant, <i>c</i>, <i>string-matches</i> the [string value], <i>s</i>, of an information item, <i>i</i>, in an instance of the data model, if and only if <tt>c</tt> is a constant with type <tt>xs:string</tt> or a type derived from <tt>xs:string</tt> and <i>c = s</i>, after white space normalization;
</li><li> a RIF list, <i>l</i>, <i>string-matches</i> the [string value], <i>s</i>, of an information item, <i>i</i>, in an instance of the data model, if and only if <i>s = L</i>, after white space normalization, where <i>L</i> is the order-preserving concatenation of the elements of <i>l</i>, after flattening <i>l</i>, and with a white space added between each element.
</li></ul>
<p><b>Example 4.2.</b>
</p>
<ul><li> The RIF constants <tt>"1"^^xs:string</tt> and <tt>" 1 "^^xs:string</tt> (notice the white spaces) string-match the string value: "1", but the constants <tt>"1"^^xs:integer</tt> and <tt>"1.0"^^xs:string</tt> do not;
</li><li> The RIF lists <tt>List("1"^^xs:string "little"^^xs:string "white"^^xs:string "dog"^^xs:string)</tt>, <tt>List("1 little"^^xs:string "white dog"^^xs:string)</tt>, <tt>List("1"^^xs:string List("little"^^xs:string "white"^^xs:string) "dog"^^xs:string)</tt>, all, string-match the string value: "1 little white dog"; but none string-matches any of the string values: "little white dog" or "1.0 little white dog".
</li></ul>
<p><span class="anchor" id="def-rif-bld.2Bxml-data-combined-interpretation"></span>
<b>Definition (RIF BLD+schemaless XML data combined interpretation).</b> A <i><b>RIF BLD+schemaless XML data combined interpretation</b></i> is a pair (<i>{I<sub>DM</sub>}</i>, <i>I</i>), where <i>{I<sub>DM</sub>}</i> is a set of element information items constructed from an infoset and where <a href="#sec-resolution-of-references" title="">the references have been resolved</a>, and <i>I</i> is a semantic structure, as defined in the semantics of RIF BLD, that satisfies the following additional conditions:
</p>
<ol>
<li> <i>{I<sub>DM</sub>}</i> &sube; <i>D<sub>Ind</sub></i>;</li>
<li> For all frame formulas <tt>o [ slot -&gt; v ]</tt>, where <i>I(<tt>o</tt>) = e &isin; {I<sub>DM</sub>}</i>, <i><b>I</b></i><sub>truth</sub>(<i>I</i>(&gt;<tt>o [ slot -&gt; v ]</tt>)) = <b>t</b> (true) if one of the following is true:
<ol type="a">
<li> <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#attribute(<i>NAME</i>)"^^rif:iri</tt>), or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"attribute(<i>NAME</i>)"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are, respectively, the values of the [namespace name] and [local name] properties of an attribute information item, <i>a</i>, in the [attributes] property of <i>e</i>, and <tt>v</tt> string-matches the [string value] of <i>a</i>;
</li>
<li> or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#<i>NAME</i>"^^rif:iri</tt>), or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAME</i>"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are, respectively, the values of the[namespace name] and [local name] properties of an element information item, <i>c</i>, in the [children] property of <i>e</i>, and either
<ul>
<li> the [typed value] of <i>c</i> is <i>c</i> itself and <i>I(<tt>v</tt>) = c</i>;</li>
<li> or the [typed value] of <i>c</i> is not <i>c</i>, and <tt>v</tt> string-matches the [string value] of <i>c</i>;</li>
</ul></li>
<li> or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#list(<i>NAME</i>)"^^rif:iri</tt>), or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"list(<i>NAME</i>)"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are, respectively, the [namespace name] and [local name] of at least one element information item in the [children] property of <i>e</i>, and <i>v</i> is a RIF List, and <i>v</i> has the same length as the sub-list, <i>c</i>, of the [children] of <i>e</i>, that contains only the element information items whose [namespace name] and [local name] property match, respectively, <i>NAMESPACE</i> and <i>NAME</i>, in document order, and for each pair of elements of the same rank, <i>v<sub>i</sub></i> in <i>v</i> and <i>c<sub>i</sub></i> in <i>c</i>,
<ul>
<li>either the [typed value] of <i>c<sub>i</sub></i> is <i>c<sub>i</sub></i> itself and <i>I(<tt>v<sub>i</sub></tt>) = c<sub>i</sub></i>;</li>
<li> or the [typed value] of <i>c<sub>i</sub></i> is not <i>c<sub>i</sub></i>, and <tt>v<sub>i</sub></tt> string-matches the [string value] of <i>c<sub>i</sub></i>;</li>
</ul></li>
</ol></li>
<li> For all class membership formulas <tt>o # C</tt>, where <i>I(<tt>o</tt>) = e &isin; {I<sub>DM</sub></i>}, <i><b>I</b></i><sub>truth</sub>(<tt>o # C</tt>) = <b>t</b> (true) if
<ol type="a">
<li> <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#<i>NAME</i>"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"<i>NAME</i>"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are, respectively, the values of the [namespace name] and [local name] properties of <i>e</i>.
</li>
</ol>
</li></ol>
<p>&nbsp;&nbsp;
</p><p>Notice that <tt>xs:NCName</tt> constants are included in the definition to allow the interpretation of RIF+XML data combinations where some or all elements or attributes in the XML data are not in a namespace. As defined in [RIF-DTB], the lexical space of <tt>rif:iri</tt> consists of all absolute IRIs as specified in [<a href="#ref-iri" title="">RFC-3987</a>]; as a consequence, it does not allow the representations of local names without namespaces.
</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The definition will be further commented and explained in a future draft.</p>
<p>The truth valuation of a well-formed RIF BLD formula, <i>&phi;</i>, under a RIF BLD+schemaless XML data combined interpretation (<i>{I<sub>DM</sub>}</i>, <i>I</i>) is determined by <i>I</i><sub>truth</sub> exactly as specified for the interpretation of RIF BLD non-document formulas (but with the definition of <i>I</i><sub>truth</sub> as modified by the combination with XML data).
</p><p><span class="anchor" id="ex43"></span>
<b>Example 4.3.</b> With respect to a RIF BLD+XML data combination, <i>&lt;D, I<sub>DM</sub>&gt;</i>, where a RIF BLD document, <i>D</i>, imports the sample XML document from <a href="#ex32" title="">Section 3.6. Example of a data model instance</a>, above, without associating it with any XML schema, and under the semantics for RIF BLD+schemaless XML data combinations as specified above, the following facts must be true in all the interpretations where the specified conditions hold: that is, for each fact, <i>f</i>, <i><b>I</b></i><sub>truth</sub>(<i>f</i>) = <b>t</b>  in all interpretations, <i><b>I</b></i>, where the specified conditions hold. The facts may be true in other interpretations as well, but not as a consequence of the combination (NB: the examples use RIF non-normative presentation syntax, and, in particular, the shortcut presentation syntax for RIF constants, as described in RIF Data Types and Builtins, <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax" title="DTB">Section 2.2.2. Shortcuts for constants in RIF's presentation syntax</a>; see <a href="#appendix-D" title="">Appendix D: Examples using the RIF/XML normative syntax</a>):
</p>
<ul><li> <tt>_Customer_John [&lt;http://www.w3.org/XML/1998/namespace#attribute(lang)&gt; -&gt; "en"^^xs:language]</tt> must be true in all interpretations, <i><b>I</b></i>, where <i><b>I</b></i><sub>C</sub> maps <tt>_Customer_John</tt> on the second element in <i>I<sub>DM</sub></i> (representing the first element <tt>Customer</tt> in the sample XML data);
</li><li> <tt>_Customer_John [&lt;http://www.w3.org/XML/1998/namespace#attribute(lang)&gt; -&gt; "en"]</tt>) must also be true in all these interpretations, since the [string value] of the <tt>xml:lang</tt> attribute matches the literal of the <tt>xs:string</tt> constant <tt>"en"</tt>;
</li><li> <tt>_Customer_John [ &lt;http://example.org/customertable#Name&gt; -&gt; "John" ]</tt> is required to be true in all interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_Customer_John</tt> on the second element in <i>I<sub>DM</sub></i>;
</li><li> <tt>_Customer_John [&lt;http://example.org/customertable#Account&gt; -&gt; 111 ]</tt> is not required to be true, even in interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_Customer_John</tt> on the second element in <i>I<sub>DM</sub></i>: indeed, the [string value] of the sub-element <tt>Account</tt> of that element is the string: <i>111</i>, whereas the slot value, in the example frame, is the <tt>xs:integer</tt> <i>111</i>, and only an <tt>xs:string</tt> constant can string-match a string value;
</li><li> <tt>_CustomerTable [&lt;http://example.org/customertable#list(Customer)&gt; -&gt; List(_Customer_John, _Customer_Jane) ]</tt> in all interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_CustomerTable</tt> on the root element of <i>I<sub>DM</sub></i>, <tt>_Customer_John</tt> on the second element, and <tt>_Customer_Jane</tt> on the fifth element (representing the second element <tt>Customer</tt> in the sample XML data, whose <tt>Name</tt> sub-element contains the sequence of characters: <i>Jane</i>);
</li><li> <tt>_Customer_John # &lt;http://example.org/customertable#Customer&gt;</tt>, in all the interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_Customer_John</tt> on the second or fifth element in <i>I<sub>DM</sub></i>;
</li><li> <tt>_Name_John # &lt;http://example.org/customertable#Name&gt;</tt>, in all the interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_Name_John</tt> on the third or sixth element in <i>I<sub>DM</sub></i>;
</li><li> <tt>"John" # &lt;http://example.org/customertable#Name&gt;</tt> is not required to be true in any interpretation, because, per the semantics of the <tt>xs:string</tt> data type in RIF, the <tt>xs:string</tt> constant <tt>"John"</tt> cannot be mapped on an element information item in <i>I<sub>DM</sub></i>;
</li><li> <tt>_Customer_John = &lt;myNamespace#ID0001&gt;</tt> in all the interpretations where <i><b>I</b></i><sub>C</sub>(<tt>_Customer_John</tt>) = <i><b>I</b></i><sub>C</sub>(<tt>&lt;myNamespace#ID0001&gt;</tt>) = <i>e &isin; I<sub>DM</sub></i> (e.g. the second element, representing the <tt>Customer</tt> with <tt>Name</tt>: "John").
</li></ul>
<p>Notice that, if our example XML data was not in a namespace, the semantics of RIF+XML data combinations would require that the following facts be true, all other required conditions being satisfied:
</p>
<ul><li> <tt>_Customer_John [ "Name" -&gt; "John" ]</tt>
</li><li> <tt>_CustomerTable [ list("Customer") -&gt; List(_Customer_John, _Customer_Jane) ]</tt>
</li><li> <tt>_Customer_John # "Customer"</tt>
</li><li> <tt>_Name_John # "Name"</tt>
</li></ul>
<p><b>Example 4.4.</b> Consider the following element with mixed-content, and assume that the element is contained in a data source that is imported in a RIF document, without a namespace nor an associated XML schema:
</p>
<pre>&lt;letterBody&gt;
  Thank you for ordering the &lt;item&gt;widget&lt;/item&gt;.
  It should arrive by &lt;arrivalDate&gt;09-09-09&lt;/arrivalDate&gt;
&lt;/letterBody&gt;
</pre>
<p><i><b>I</b></i><sub>truth</sub> must, under the semantics specified above, map the fact:<br /><tt>_myLetter["letterBody" -&gt; "Thank you for ordering the Widget. It should arrive by 09-09-09"]</tt>,<br />
to true in any interpretation of the RIF+XML data combination that maps the RIF local constant <tt>_myLetter</tt> to an element information item that describes, in the data model instance, the parent element of the above letterBody element.
</p><p><span class="anchor" id="sec-model-theoretic-semantics-of-rif-bld.2Bxml-data.2Bschema-combinations"></span>
</p>
<a id="Combined_interpretation_of_RIF_BLD_non-document_formulas_and_schema_valid_XML_data" name="Combined_interpretation_of_RIF_BLD_non-document_formulas_and_schema_valid_XML_data"></a><h4> <span class="mw-headline">4.1.2  Combined interpretation of RIF BLD non-document formulas and schema valid XML data </span></h4>
<p>In the case where a RIF BLD document is combined with XML data that is associated with an XML schema, the instance of the data model that describes the imported XML data is built from the PSVI, and it does ascribe a type to the elements and attributes contained in the XML document.
</p><p>The semantics of these combinations are, essentally, the same as in the schemaless case, except that values are compared using their typed values instead of their string values, and additional conditions are imposed on <i><b>I</b></i><sub>truth</sub> to take into account information that is specific to the PSVI.
</p><p>Accordingly, and to make the definition simpler, we will write that:
</p>
<ul><li> a RIF constant, <i>c</i>, <i>type-matches</i> the [typed value] of an information item, <i>i</i>, in an instance of the data model, if and only if the type of <i>c</i>, <i>T<sub>c</sub></i>, and the type that is identified by the expanded QName in the [type name] property of <i>i</i>, <i>T<sub>i</sub></i>, have a non-empty intersection, and <i>c</i> and the [typed value] of <i>i</i> are the same value in the intersection of <i>T<sub>c</sub></i> and <i>T<sub>i</sub></i>;
</li><li> a RIF list, <i>l</i>, <i>type-matches</i> the [typed value] of an information item, <i>i</i>, in an instance of the data model, if and only if the type of <i>i</i> is a list type and the elements of <i>l</i> type-match, one-to-one and in document order, the atomic values in the [typed value] of <i>i</i>, after flattening <i>l</i>.
</li></ul>
<p>In addition we will write, in the following definition, that two strings, a namespace and an NCName, <i>match, possibly modulo a substitution,</i> the values of, respectively, the [namespace name] and [local name] of an element information item, <i>e</i>, if
</p>
<ul><li> either the namespace and NCName are the values of, respectively, the [namespace name] and [local name] of <i>e</i>,
</li><li> or <i>e</i> describes an instance <i>E</i> of an XML element that belongs to a substitution group, occurs in a position where the schema requires the head element, and the namespace and NCName are the values of, respectively, the [namespace name] and [local name] of the head element.
</li></ul>
<p>This specification does not prescribe any semantics for a RIF+XML data combination, when the XML data is associated with an XML schema with respect to which it is not valid.
</p><p><span class="anchor" id="def-rif-bld.2Bxml-data.2Bschema-combined-interpretation"></span>
<b>Definition (RIF BLD+schema valid XML data combined interpretation).</b> A <i><b>RIF BLD+schema valid XML data combined interpretation</b></i> is a pair (<i>{I<sub>DM</sub>}</i>, <i>I</i>), where <i>{I<sub>DM</sub>}</i> is a set of element information items constructed from one or more PSVIs, using one or more XML schemas, <i>XSD<sub>i</sub></i>, and where <a href="#sec-resolution-of-references" title="">the references have been resolved</a>, and <i>I</i> is a semantic structure, as defined in the semantics of RIF BLD, that satisfies the following additional conditions:
</p>
<ol>
<li> <i>{I<sub>DM</sub>}</i> &sube; <i>D<sub>Ind</sub></i>;</li>
<li> For all frame formulas <tt>o [ slot -&gt; v ]</tt>, where <i>I(<tt>o</tt>) = e &isin; {I<sub>DM</sub>}</i>, <i><b>I</b></i><sub>truth</sub>(<tt>o [ slot -&gt; v ]</tt>) = <b>t</b> (true) if one of the following is true:
<ol type="a">
<li> <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#attribute(<i>NAME</i>)"^^rif:iri</tt>), or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"attribute(<i>NAME</i>)"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are, respectively, the values of the [namespace name] and [local name] properties of an attribute information item, <i>a</i>, in the [attributes] property of <i>e</i>, and <tt>v</tt> type-matches the [typed value] of <i>a</i>;
</li>
<li> or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#<i>NAME</i>"^^rif:iri</tt>), or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAME</i>"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> match, possibly modulo a substitution, the values of, respectively, the [namespace name] and [local name] properties of an element information item, <i>c</i>, in the [children] property of <i>e</i>, and either
<ul>
<li> the [typed value] of <i>c</i> is <i>c</i> itself and <i>I(<tt>v</tt>) = c</i>;</li>
<li> or the [typed value] of <i>c</i> is not <i>c</i>, and <tt>v</tt> type-matches the [typed value] of <i>c</i>;</li>
</ul></li>
<li> or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#list(<i>NAME</i>)"^^rif:iri</tt>), or <i>I</i>(<tt>slot</tt>) = <i>I</i>(<tt>"list(<i>NAME</i>)"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> match, possibly modulo a substitution, the values of, respectively, the [namespace name] and [local name] properties of at least one element information item in the [children] property of <i>e</i>, and <i>v</i> is a RIF List, and <i>v</i> has the same length as the sub-list, <i>c</i>, of the [children] of <i>e</i>, that contains only the element information items whose [namespace name] and [local name] properties are matched, possibly modulo a substitution, by, respectively, <i>NAMESPACE</i> and <i>NAME</i>, in document order, and for each pair of elements of the same rank, <i>v<sub>i</sub></i> in <i>v</i> and <i>c<sub>i</sub></i> in <i>c</i>,
<ul>
<li>either the [typed value] of <i>c<sub>i</sub></i> is <i>c<sub>i</sub></i> itself and <i>I(<tt>v<sub>i</sub></tt>) = c<sub>i</sub></i>;</li>
<li> or the [typed value] of <i>c<sub>i</sub></i> is not <i>c<sub>i</sub></i>, and <tt>v<sub>i</sub></tt> type-matches the [typed value] of <i>c<sub>i</sub></i>;</li>
</ul></li>
</ol></li>
<li> For all class membership formulas <tt>o # C</tt>, where <i>I(<tt>o</tt>) = e &isin; {I<sub>DM</sub></i>}, <i><b>I</b></i><sub>truth</sub>(<tt>o # C</tt>) = <b>t</b> (true) if one of the following is true
<ol type="a">
<li> <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#<i>NAME</i>"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"<i>NAME</i>"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are the values, respectively, of the [namespace name] and the [local name] properties of <i>e</i>;
</li>
<li> or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"<i>NAMESPACE</i>#type(<i>NAME</i>)"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"type(<i>NAME</i>)"^^xs:NCName</tt>) and <i>NAMESPACE</i> is empty, where <i>NAMESPACE</i> and <i>NAME</i> are, respectively, the namespace and the local name in <i>e</i> 's [type name] property;
</li>
</ol>
</li>
<li> <i><b>DTS</b></i> is extended to include all the simple types, whether built-in XML schema or defined in one of the <i>XSD<sub>i</sub></i>, that are mentioned in the [type name] property of any of the information items in the data model instance.</li>
<li>For all subclass formulas <tt>sub ## SUP</tt>, where <tt>sub</tt> and <tt>SUP</tt> are distinct constants of type <tt>rif:iri</tt> or <tt>xs:string</tt>, or a type derived from <tt>rif:iri</tt> or <tt>xs:string</tt>, <i><b>I</b></i><sub>truth</sub>(<tt>sub ## SUP</tt>) = <b>t</b> (true) if one of the following is true:
<ol type="a">
<li> <i>I</i>(<tt>sub</tt>) = <i>I</i>(<tt>"<i>NAMESPACE<sub>sub</sub></i>#type(<i>NAME<sub>sub</sub></i>)"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"type(<i>NAME<sub>sub</sub></i>)"^^xs:NCName</tt>) and <i>NAMESPACE<sub>sub</sub></i> is empty, where <i>NAMESPACE<sub>sub</sub></i> and <i>NAME<sub>sub</sub></i> are, respectively, the values of the target namespace and name of an element, <i>e</i><sub><tt>sub</tt></sub> defined in <i>XSD</i>, one of the <i>XSD<sub>i</sub> and</i>
<ul>
<li> either <i>I</i>(<tt>SUP</tt>) = <i>I</i>(<tt>"<i>NAMESPACE<sub>SUP</sub></i>#<i>NAME<sub>SUP</sub></i>"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"<i>NAME<sub>SUP</sub></i>"^^xs:NCName</tt>) and <i>NAMESPACE<sub>SUP</sub></i> is empty, where <i>NAMESPACE<sub>SUP</sub></i> and <i>NAME<sub>SUP</sub></i> are, respectively, the values of the target namespace and name of an element, <i>e</i><sub><tt>SUP</tt></sub> defined in <i>XSD</i>, and <i>e</i><sub><tt>sub</tt></sub> is defined in a substitution group where the head element is <i>e</i><sub><tt>SUP</tt></sub>;</li>
<li> or <i>I</i>(<tt>SUP</tt>) = <i>I</i>(<tt>"<i>NAMESPACE<sub>SUP</sub></i>#type(<i>NAME<sub>SUP</sub></i>)"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"type(<i>NAME<sub>SUP</sub></i>)"^^xs:NCName</tt>) and <i>NAMESPACE<sub>SUP</sub></i> is empty, where <i>NAMESPACE<sub>SUP</sub></i> and <i>NAME<sub>SUP</sub></i> are, respectively, the values of the target namespace and name of an XML schema type, <i>T</i><sub><tt>SUP</tt></sub>, defined in <i>XSD</i> (not including built-in XML schema data types), and <i>T</i><sub><tt>SUP</tt></sub> is the type declared in the definition of <i>e</i><sub><tt>sub</tt></sub>, in <i>XSD</i>;</li>
</ul>
</li>
<li> or <i>I</i>(<tt>sub</tt>) = <i>I</i>(<tt>"<i>NAMESPACE<sub>sub</sub></i>#type(<i>NAME<sub>sub</sub></i>)"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"type(<i>NAME<sub>sub</sub></i>)"^^xs:NCName</tt>) and <i>NAMESPACE<sub>sub</sub></i> is empty, and <i>I</i>(<tt>SUP</tt>) = <i>I</i>(<tt>"<i>NAMESPACE<sub>SUP</sub></i>#type(<i>NAME<sub>SUP</sub></i>)"^^rif:iri</tt>), or <i>I</i>(<tt>C</tt>) = <i>I</i>(<tt>"type(<i>NAME<sub>SUP</sub></i>)"^^xs:NCName</tt>) and <i>NAMESPACE<sub>SUP</sub></i> is empty, where <i>NAMESPACE<sub>sub</sub></i> and <i>NAME<sub>sub</sub></i> are, respectively, the values of the target namespace and name of and XML schema type, <i>T</i><sub><tt>sub</tt></sub>, defined in XSD (not including built-in XML schema data types), and <i>NAMESPACE<sub>SUP</sub></i> and <i>NAME<sub>SUP</sub></i> are, respectively, the values of the target namespace and name of an XML schema type, <i>T</i><sub><tt>SUP</tt></sub>, defined in <i>XSD</i> (not including built-in XML schema data types), and <i>T</i><sub><tt>sub</tt></sub> is derived by restriction or by extension from <i>T</i><sub><tt>SUP</tt></sub>.</li>
</ol>
</li>
</ol>
<p>&nbsp;&nbsp;
</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The case defined by the first bullet under 2.b and 2.c could be further refined, to differentiate between the case of an empty element and the case of the null value: in the latter case, the schema must define a nillable content for the element. Shall we leave the interpretation to the implementations or shall we include it in that spec? If the latter, we must include a <tt>rif:NULL</tt> constant in every symbol space...</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> Condition 4 will be further refined in a future draft, to account for the problem posed by the inclusion of some data types in a RIF interpretation, e.g. xs:duration.</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The definition will be further refined in a future draft to account for cases such as <tt>xs:anyType</tt> typed elements.</p> 
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The definition will be further commented and explained in a future draft.</p>
<p>The truth valuation of a well-formed RIF BLD formula, <i>&phi;</i>, under a RIF BLD+schema valid XML data combined interpretation (<i>{I<sub>DM</sub>}</i>, <i>I</i>) is determined by <i>I</i><sub>truth</sub> exactly as specified for the interpretation of RIF BLD non-document formulas (but with the definition of <i>I</i><sub>truth</sub> as modified by the combination with XML data).
</p><p><span class="anchor" id="ex45"></span>
<b>Example 4.5.</b> Following up on <a href="#ex43" title="">Example 4.3</a>, above, but assuming that the RIF BLD document is combined with the sample XML data, associated with the XML schema, as in <a href="#ex32" title="">Section 3.6. Example of a data model instance</a>, the following hold with respect to the interpretation of sample facts, under the semantics of the RIF BLD+schema valid XML data combination:
</p>
<ul><li> <tt>_Customer_John [&lt;http://www.w3.org/XML/1998/namespace#attribute(lang)&gt; -&gt; "en"^^xs:language]</tt> must be true in all interpretations, <i><b>I</b></i>, where <i><b>I</b></i><sub>C</sub> maps <tt>_Customer_John</tt> on the second element in <i>I<sub>DM</sub></i> (representing the first element <tt>Customer</tt> in the sample XML data);
</li><li> but <tt>_Customer_John [&lt;http://www.w3.org/XML/1998/namespace#attribute(lang)&gt; -&gt; "en"]</tt>) must not, since the <tt>xs:string</tt> constant <tt>"en"</tt> does not type-match the <tt>xs:language</tt> [typed value]: <tt>en</tt>;
</li><li> <tt>_Customer_John [&lt;http://example.org/customertable#Account&gt; -&gt; 111 ]</tt> must be true in all interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_Customer_John</tt> on the second element in <i>I<sub>DM</sub></i> (but, e.g. <tt>_Customer_John [&lt;http://example.org/customertable#Account&gt; -&gt; "111" ]</tt> must not);
</li><li> <tt>_PIN_Jane # &lt;http://example.org/customertable#type(PIN)&gt;</tt> must be true in all interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_PIN_Jane</tt> on the eighth (and last) element in <i>I<sub>DM</sub></i>
</li></ul>
<p>Notice that <tt>_PIN_Jane # &lt;http://www.w3.org/2001/XMLSchema#type(integer)&gt;</tt> is never required to be true in any interpretation of the example RIF BLD+schema valid XML data combination, even in interpretations where <i><b>I</b></i><sub>C</sub> maps <tt>_PIN_Jane</tt> on the last element in <i>I<sub>DM</sub></i>, although the XML schema type <tt>http://example.org/customertable#PIN</tt> is derived by restriction from <tt>xs:integer</tt>. That is because <tt>xs:insteger</tt> is not defined in the associated XML schema (<i>"the namespace of </i>C<i> and </i><tt>NAME</tt><i> </i>[must]<i> match, respectively, the target namespace and the name of an XML schema type defined in XSD (not including built-in XML schema data types)"</i>, condition 4.b in the <a href="#def-rif-bld.2Bxml-data.2Bschema-combined-interpretation" title="">definition of RIF BLD+schema valid XML data combined interpretations</a>).
</p><p><span class="anchor" id="sec-combined-interpretation-rif-bld-document.2Bxml-data"></span>
</p>
<a id="Combined_interpretation_of_RIF_BLD_documents_and_XML_data" name="Combined_interpretation_of_RIF_BLD_documents_and_XML_data"></a><h4> <span class="mw-headline">4.1.3  Combined interpretation of RIF BLD documents and XML data </span></h4>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The definition of the combined interpretation of non-document RIF BLD formulas and XML data, where some of the XML data is associated with an XML schema and some is not, follows directly from the definitions of the schemaless and schema valid cases. It will be developed explicitly in a future draft.</p>
<p>A RIF+XML data combination &lt;<i>R</i>, <i>D<sub>1</sub></i>, ..., <i>D<sub>n</sub></i>&gt;, <i>n &ge; 0</i>, where <i>R</i> is an RIF BLD document, and the <i>D<sub>i</sub></i>, <i>1 &le; i &le; n</i>, are all the XML documents that are, either, imported, directly or indirectly, by <i>R</i>, or that contain consumer-side XML data, is interpreted using a RIF BLD+XML data combined interpretation (<i>{I<sub>DM</sub>}</i>, <i>&Icirc;</i>), where:
</p>
<ul><li> <i>{I<sub>DM</sub>} = &cup;<sub>1...n</sub> {I<sub>DM<sub>i</sub></sub>}</i>, the union of all the sets, <i>{I<sub>DM<sub>i</sub></sub>}</i>, <i>1 &le; i &le; n</i>, of all the element information items in the instances of the data model that represent, each, one of the XML documents in (<i>D<sub>1</sub></i>, ..., <i>D<sub>n</sub></i>);
</li><li> <i>&Icirc;</i> is a semantic multi-structure that is defined exactly as specified for the interpretation of RIF BLD document formulas, except that the <i>I</i><sub>truth</sub> component in each semantic structure, <i>I</i>, contained in <i>&Icirc;</i>, is subject to the additional conditions required for the combined interpretation (<i>{I<sub>DM</sub>}</i>, <i>I</i>).
</li></ul>
<p>The truth valuation of a RIF+XML data combination &lt;<i>R</i>, <i>D<sub>1</sub></i>, ..., <i>D<sub>n</sub></i>&gt;, <i>n &ge; 0</i>, is determined exactly as specified for the truth valuation of a RIF BLD document formulas, using the RIF BLD+XML data combined interpretation (<i>{I<sub>DM</sub>}</i>, <i>&Icirc;</i>) in place of a semantic multi-structure.
</p><p>In the same way, the notions of model and of logical entailment 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, <i>&Icirc;</i>, is replaced by the RIF BLD+XML data combined interpretation (<i>{I<sub>DM</sub>}</i>, <i>&Icirc;</i>).
</p><p>Notice that, in the case where no XML data is imported, that is, if <i>n = 0</i>, <i>{I<sub>DM</sub>}</i> is empty, and the interpretation of a RIF BLD document under a RIF BLD+XML data combined interpretation (<i>&empty;</i>, <i>&Icirc;</i>) is strictly equivalent to its interpretation under the standard RIF BLD semantics.
</p><p><span class="anchor" id="sec-semantics-of-rif-prd.2Bxml-data-combinations"></span>
</p>
<a id="Operational_semantics_of_RIF_PRD.2BXML_data_combinations" name="Operational_semantics_of_RIF_PRD.2BXML_data_combinations"></a><h3> <span class="mw-headline">4.2  Operational semantics of RIF PRD+XML data combinations </span></h3>
<p>The effect of the combination with XML data, with or without an associated XML schema, on the operational semantics of a RIF PRD document, is that a ground fact, <i>f</i>, must be added to the set of ground facts that is associated with the <a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/#def-state" title="PRD">state of the fact base</a> that is to be combined with the XML data, if it 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 schema or not).
</p><p>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.
</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> The definition will be further commented and explained in a future draft.</p>
<p><b>Example.</b>
</p>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> Examples will be added in a future draft.</p>
<p><span class="anchor" id="sec-semantics-of-rif-core.2Bxml-data-combinations"></span>
</p>
<a id="Semantics_of_RIF_Core.2BXML_data_combinations" name="Semantics_of_RIF_Core.2BXML_data_combinations"></a><h3> <span class="mw-headline">4.3  Semantics of RIF Core+XML data combinations </span></h3>
<p>RIF Core is a syntactic subset of RIF BLD, and the semantics of RIF Core+XML data combinations is identical to the semantics of RIF BLD+XML data combinations for that subset. RIF Core is also a syntactic subset of RIF PRD, and the semantics of RIF Core+XML data combinations is also identical to the semantics of RIF PRD+XML data combinations for that subset.
</p><p>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 <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-bld-truth" title="BLD">truth valuation of subclass and membership formulas</a>.
</p>
<a id="Conformance" name="Conformance"></a><h2> <span class="mw-headline">5  Conformance </span></h2>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> This section will be completed in a future draft.</p>
<a id="The_special_case_of_RDF_and_OWL_data_sources" name="The_special_case_of_RDF_and_OWL_data_sources"></a><h2> <span class="mw-headline">6  The special case of RDF and OWL data sources </span></h2>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> RDF and OWL data sources can be imported in RIF documents in two different ways: according to the <a href="#ref-swc" title="">RIF-RDF-OWL</a> specification, that specifies the combination of RIF documents with RDF and OWL graphs, directly or as an XML document. This section examines how these two ways of importing RDF and OWL documents relate. The section will be completed in a future draft.</p>
<a id="References" name="References"></a><h2> <span class="mw-headline">7  References </span></h2>
<p><span class="anchor" id="ref-infoset"></span> 
</p>
<dl><dt> [Infoset]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/xml-infoset" title="http://www.w3.org/TR/xml-infoset">XML Information Set (Second Edition)</a></i>, John Cowan and Richard Tobin, Editors. World Wide Web Consortium, 04 Feb 2004. This version is <a class="external free" href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204" title="http://www.w3.org/TR/2004/REC-xml-infoset-20040204">http://www.w3.org/TR/2004/REC-xml-infoset-20040204</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xml-infoset" title="http://www.w3.org/TR/xml-infoset">http://www.w3.org/TR/xml-infoset</a>.
</dd></dl>
<p><span class="anchor" id="ref-uri"></span> 
</p>
<dl><dt> [<a class="external" href="http://tools.ietf.org/html/rfc3986" title="http://tools.ietf.org/html/rfc3986">RFC 3986</a>]
</dt><dd> <i><a class="external text" href="http://www.ietf.org/rfc/rfc3986.txt" title="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986: Uniform Resource Identifier (URI): Generic Syntax</a></i>, T. Berners-Lee, R. Fielding, and L. Masinter. January 2005.  Available at: <a class="external free" href="http://www.ietf.org/rfc/rfc3986.txt" title="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a>
</dd></dl>
<p><span class="anchor" id="ref-iri"></span> 
</p>
<dl><dt> [<a class="external" href="http://tools.ietf.org/html/rfc3987" title="http://tools.ietf.org/html/rfc3987">RFC 3987</a>]
</dt><dd> <i><a class="external text" href="http://www.ietf.org/rfc/rfc3987.txt" title="http://www.ietf.org/rfc/rfc3987.txt">RFC 3987: Internationalized Resource Identifiers (IRIs)</a></i>,  M. Duerst and M. Suignard. January 2005.  Available at: <a class="external free" href="http://www.ietf.org/rfc/rfc3987.txt" title="http://www.ietf.org/rfc/rfc3987.txt">http://www.ietf.org/rfc/rfc3987.txt</a>
</dd></dl>
<p><span class="anchor" id="ref-core"></span> 
</p>
<dl><dt> [RIF-Core]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/"><span>RIF Core Dialect</span></a></cite> Harold Boley, Gary Hallmark, Michael Kifer, Adrian Paschke, Axel Polleres, Dave Reynolds, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">http://www.w3.org/TR/2010/REC-rif-core-20100622/</a>.  Latest version available at <a href="http://www.w3.org/TR/rif-core/">http://www.w3.org/TR/rif-core/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-bld"></span> 
</p>
<dl><dt> [RIF-BLD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/"><span>RIF Basic Logic Dialect</span></a></cite> Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/">http://www.w3.org/TR/2010/REC-rif-bld-20100622/</a>.  Latest version available at <a href="http://www.w3.org/TR/rif-bld/">http://www.w3.org/TR/rif-bld/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-prd"></span> 
</p>
<dl><dt> [RIF-PRD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/"><span>RIF Production Rule Dialect</span></a></cite> Christian de Sainte Marie, Gary Hallmark, Adrian Paschke, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/">http://www.w3.org/TR/2010/REC-rif-prd-20100622/</a>.  Latest version available at <a href="http://www.w3.org/TR/rif-prd/">http://www.w3.org/TR/rif-prd/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-swc"></span> 
</p>
<dl><dt> [RIF-RDF-OWL]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/"><span>RIF RDF and OWL Compatibility</span></a></cite> Jos de Bruijn, editor. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/">http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/</a>.  Latest version available at <a href="http://www.w3.org/TR/rif-rdf-owl/">http://www.w3.org/TR/rif-rdf-owl/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-xdm"></span> 
</p>
<dl><dt> [XDM]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/xpath-datamodel/" title="http://www.w3.org/TR/xpath-datamodel/">XQuery 1.0 and XPath 2.0 Data Model (XDM)</a></i>,  M. Fern&aacute;ndez, A. Malhotra, J. Marsh, M. Nagy, N. Walsh, Editors. W3C Recommendation 23 January 2007. This version is <a class="external free" href="http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/" title="http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/">http://www.w3.org/TR/2007/REC-xpath-datamodel-20070123/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xpath-datamodel/" title="http://www.w3.org/TR/xpath-datamodel/">http://www.w3.org/TR/xpath-datamodel/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xml"></span> 
</p>
<dl><dt> [XML]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/REC-xml" title="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Fifth Edition)</a></i>, T. Bray, J. Paoli, C. M. Sperberg-McQueen, E. Maler, F. Yergeau, Editor. W3C Recommendation 26 November 2008. This version is <a class="external free" href="http://www.w3.org/TR/2005/REC-xml-id-20050909/" title="http://www.w3.org/TR/2005/REC-xml-id-20050909/">http://www.w3.org/TR/2005/REC-xml-id-20050909/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/REC-xml" title="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</a>.
</dd></dl>
<p><span class="anchor" id="ref-xml-id"></span> 
</p>
<dl><dt> [xml:id]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/xml-id" title="http://www.w3.org/TR/xml-id">xml:id Version 1.0</a></i>, J. Marsh, D. Veillard, N. Walsh, Editors. W3C Recommendation 9 September 2005. This version is <a class="external free" href="http://www.w3.org/TR/2008/REC-xml-20081126/" title="http://www.w3.org/TR/2008/REC-xml-20081126/">http://www.w3.org/TR/2008/REC-xml-20081126/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xml-id" title="http://www.w3.org/TR/xml-id">http://www.w3.org/TR/xml-id</a>.
</dd></dl>
<p><span class="anchor" id="ref-xpath-20"></span> 
</p>
<dl><dt> [XPath 2.0]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/xpath20/" title="http://www.w3.org/TR/xpath20/">XML Path Language (XPath) 2.0</a></i>, D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This version is <a class="external free" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/">http://www.w3.org/TR/2007/REC-xpath20-20070123/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xpath20/" title="http://www.w3.org/TR/xpath20/">http://www.w3.org/TR/xpath20/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xquery"></span> 
</p>
<dl><dt> [XQuery 1.0]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/xquery" title="http://www.w3.org/TR/xquery">XQuery 1.0: An XML Query Language</a></i>, D. Chamberlin , A. Berglund, S. Boag, et. al., Editors. W3C Recommendation 23 Jan 2007. This version is <a class="external free" href="http://www.w3.org/TR/2007/REC-xquery-20070123/" title="http://www.w3.org/TR/2007/REC-xquery-20070123/">http://www.w3.org/TR/2007/REC-xquery-20070123/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xquery/" title="http://www.w3.org/TR/xquery/">http://www.w3.org/TR/xquery/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xsd11-2"></span> 
</p>
<dl><dt> [XSD 1.1 Part 2]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/xmlschema11-2/" title="http://www.w3.org/TR/xmlschema11-2/">W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</a></i>, D. Peterson, S. Gao, A. Malhotra, C. M. Sperberg-McQueen, H. S. Thompson, Editors. W3C Candidate Recommendation 30 April 2009. This version is <a class="external free" href="http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/" title="http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/">http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xmlschema11-2/" title="http://www.w3.org/TR/xmlschema11-2/">http://www.w3.org/TR/xmlschema11-2/</a>.
</dd></dl>
<a id="Appendix_A:_Glossary_.28non-normative.29" name="Appendix_A:_Glossary_.28non-normative.29"></a><h2> <span class="mw-headline">8  Appendix A: Glossary (non-normative) </span></h2>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> This section will be completed in a future draft.</p>
<dl><dt>Expanded QName
</dt><dd>An expanded QName is a set of three values consisting of a possibly empty prefix, a possibly empty namespace URI, and a local name. (<a class="external free" href="http://www.w3.org/TR/xpath-datamodel/#dt-expanded-qname" title="http://www.w3.org/TR/xpath-datamodel/#dt-expanded-qname">http://www.w3.org/TR/xpath-datamodel/#dt-expanded-qname</a>)
</dd></dl>
<dl><dt>QName
</dt><dd>A qualified name is a name subject to namespace interpretation. In documents conforming to this specification, element and 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 names and to bind a default namespace that applies to unprefixed element names; these declarations are scoped by the elements on which they appear so that different bindings may apply in different parts of a document. (<a class="external free" href="http://www.w3.org/TR/REC-xml-names/#dt-qualname" title="http://www.w3.org/TR/REC-xml-names/#dt-qualname">http://www.w3.org/TR/REC-xml-names/#dt-qualname</a>)
</dd></dl>
<a id="Appendix_B:_Extract_from_the_XQuery_1.0_and_XPath_2.0_Data_Model_.28non-normative.29" name="Appendix_B:_Extract_from_the_XQuery_1.0_and_XPath_2.0_Data_Model_.28non-normative.29"></a><h2> <span class="mw-headline">9  Appendix B: Extract from the <a href="#ref-xdm" title="">XQuery 1.0 and XPath 2.0 Data Model</a> (non-normative) </span></h2>
<p><span class="anchor" id="ref-appendix-type-name"></span>
</p>
<a id="Element_and_attribute_node_type_names_.28from_.5BXDM.5D.29" name="Element_and_attribute_node_type_names_.28from_.5BXDM.5D.29"></a><h3> <span class="mw-headline">9.1  Element and attribute node type names (from [<a href="#ref-xdm" title="">XDM</a>]) </span></h3>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> This section reproduces the text of <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#PSVI2NodeTypes" title="http://www.w3.org/TR/xpath-datamodel/#PSVI2NodeTypes">Section 3.3.1.1. Element and Attribute Node Type Names</a> in [<a href="#ref-xdm" title="">XDM</a>], for the reader's convenience. Notice that, for the purpose of this specification, the type name is considered unknown, and the [type name] property is left empty, when the [validity] property does not exist or is "unknown" and the [validation attempted] property does not exist or is "none".</p>
<p>Notation: Some aspects of type assignment rely on the ability to access properties of the schema components. Such properties are indicated by the style {component property}. Note that this does not mean a lightweight schema processor cannot be used, it only means that the application must have some mechanism to access the necessary properties.
</p><p>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.
</p><p>The type depends on the declared type, the actual type, and the [validity] and [validation attempted] properties in the PSVI. If:
</p>
<ul><li> The [validity] and [validation attempted] properties exist and have the values "valid" and "full", respectively, the schema type of an element or attribute information item is represented by an expanded-QName whose namespace and local name correspond to the first applicable items in the following list:
<ul><li> If the declared type exists and is a union and the actual type is (not the same as the declared type, and not a type derived from the declared type, but) one of the member types of the union, or derived from one of its member types:
<ul><li> If the {name} property of the declared type is present: the {target namespace} and {name} properties of the declared type.
</li><li> If the {name} property of the declared type is absent: the namespace and local name of the anonymous type name supplied for the declared type.
</li></ul>
</li><li> If there is no declared type, and the actual type is a union, then:
<ul><li> If the {name} property of the actual type is present: the {target namespace} and {name} properties of the actual type.
</li><li> If the {name} property of the actual type is absent: the namespace and local name of the anonymous type name supplied for the actual type.
</li></ul>
</li><li> Otherwise:
<ul><li> If [type definition anonymous] is false: the {target namespace} and {name} properties of the actual type.
</li><li> If [type definition anonymous] is true: the namespace and local name of the anonymous type name supplied for the actual type.
</li></ul>
</li></ul>
</li><li> The [validity] property exists and is "invalid", or the [validation attempted] property exists and is "partial", the schema type of an element is xs:anyType and the type of an attribute is xs:anySimpleType.
</li><li> The [validity] property exists and is "notKnown", and the [validation attempted] property exists and is "none", the schema type of an element is xs:untyped and the type of an attribute is xs:untypedAtomic.
</li><li> The [validity] or [validation attempted] properties do not exist, the schema type of an element is xs:untyped and the type of an attribute is xs:untypedAtomic.
</li></ul>
<p>The prefix associated with the type names is implementation-dependent.
</p><p><span class="anchor" id="ref-appendix-typed-value"></span>
</p>
<a id="Typed_value_determination_.28from_.5BXDM.5D.29" name="Typed_value_determination_.28from_.5BXDM.5D.29"></a><h3> <span class="mw-headline">9.2  Typed value determination (from [<a href="#ref-xdm" title="">XDM</a>]) </span></h3>
<p>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. [...]
</p><p>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.
</p><p>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.
</p><p><b>Note.</b> For atomic and list types, the mapping is the &ldquo;lexical mapping&rdquo; 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.
</p><p>The typed value is determined as follows:
</p>
<ul><li> If the nilled property of the node in question is true, then the typed value is the empty sequence.
</li><li> If T is xs:anySimpleType or xs:anyAtomicType, the typed value is the [schema normalized value] as an instance of xs:untypedAtomic.
</li><li> Otherwise, the typed value is the result of applying M to the string value as an instance of the appropriate value type, where the appropriate value type is the [member type definition] if T is a union type, otherwise it is simply T.
</li></ul>
<p>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.
</p><p><span class="anchor" id="appendix-embedding"></span>
</p>
<a id="Appendix_C:_Embedding_imported_data_sources_as_RIF_facts_.28non-normative.29" name="Appendix_C:_Embedding_imported_data_sources_as_RIF_facts_.28non-normative.29"></a><h2> <span class="mw-headline">10  Appendix C: Embedding imported data sources as RIF facts (non-normative) </span></h2>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> This section will be completed in a future draft.</p>
<p><span class="anchor" id="appendix-D"></span>
</p>
<a id="Appendix_D:_Examples_using_the_normative_RIF.2FXML_syntax" name="Appendix_D:_Examples_using_the_normative_RIF.2FXML_syntax"></a><h2> <span class="mw-headline">11  Appendix D: Examples using the normative RIF/XML syntax </span></h2>
<p class="ednote"><span class="ednotehead">Editor's Note:</span> This section will be completed in a future draft</p>
<a id="Appendix_E:_Change_Log_.28non-normative.29" name="Appendix_E:_Change_Log_.28non-normative.29"></a><h2> <span class="mw-headline">12  Appendix E: Change Log (non-normative) </span></h2>
<ul><li> Complete rework of the semantics
</li></ul>


</body>
</html>