Another abandoned server code base... this is kind of an ancestor of taskrambler.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

4544 lines
352 KiB

<!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 Datatypes and Built-Ins 1.0</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-REC" 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 Datatypes and Built-Ins 1.0</span></h1>
<h2 id="W3C-doctype">W3C Recommendation 22 June 2010</h2>
<!-- no inplace warning -->
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/" id="this-version-url">http://www.w3.org/TR/2010/REC-rif-dtb-20100622/</a></dd>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/rif-dtb/">http://www.w3.org/TR/rif-dtb/</a></dd>
<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2010/PR-rif-dtb-20100511/">http://www.w3.org/TR/2010/PR-rif-dtb-20100511/</a> (<a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/diff-from-20100511">color-coded diff</a>)</dd>
</dl>
<dl><dt>Editors:</dt><dd>Axel Polleres, DERI</dd>
<dd>Harold Boley, National Research Council Canada</dd>
<dd>Michael Kifer, State University of New York at Stony Brook</dd>
</dl>
<p>Please refer to the <a href="http://www.w3.org/2010/rif/errata"><strong>errata</strong></a> for this document, which may include some normative corrections.</p>
<p>This document is also available in these non-normative formats: <a href="http://www.w3.org/2010/pdf/REC-rif-dtb-20100622.pdf">PDF version</a>.</p>
<p>See also <a href="http://www.w3.org/2010/rif/translation/rif-dtb">translations</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>This document, developed by the <a class="external text" href="http://www.w3.org/2005/rules/wg.html" title="http://www.w3.org/2005/rules/wg.html">Rule Interchange Format (RIF) Working Group</a>, specifies a list of datatypes, built-in functions and built-in predicates expected to be supported by RIF dialects such as the <a class="external text" href="http://www.w3.org/TR/rif-core/" title="http://www.w3.org/TR/rif-core/">RIF Core Dialect</a>, the <a class="external text" href="http://www.w3.org/TR/rif-bld/" title="http://www.w3.org/TR/rif-bld/">RIF Basic Logic Dialect</a>, and the <a class="external text" href="http://www.w3.org/TR/rif-prd/" title="http://www.w3.org/TR/rif-prd/">RIF Production Rules Dialect</a>. Each dialect supporting a superset or subset of the datatypes, built-in functions and built-in predicates defined here shall specify these additions or restrictions. Some of the datatypes are adapted from [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>]. A large part of the definitions of the listed functions and operators are adapted from [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. The <tt>rdf:PlainLiteral</tt> datatype as well as functions and operators associated with that datatype are adopted from [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].</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> (this document)</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></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">Document Unchanged</h4>
<p>There have been no changes to the body of this document since the <a href="http://www.w3.org/TR/2010/PR-rif-dtb-20100511/">previous version</a>. For details on earlier changes, see the <a href="#changelog">change log</a>.</p>
<h4 class="no-toc no-num" id="please">Please Send Comments</h4><p>Please send any comments to <a class="mailto" href="mailto:public-rif-comments@w3.org">public-rif-comments@w3.org</a>
(<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-comments/">public
archive</a>). Although work on this document by the <a href="http://www.w3.org/2005/rules/wg.html">Rule Interchange Format (RIF) Working Group</a> is complete, comments may be addressed in the <a href="http://www.w3.org/2010/rif/errata">errata</a> or in future revisions. Open discussion among developers is welcome at <a class="mailto" href="mailto:public-rif-dev@w3.org">public-rif-dev@w3.org</a> (<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-dev/">public archive</a>).</p>
<h4 class="no-toc no-num" id="endorsement">Endorsed By W3C</h4>
<p><em>This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</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.</em></p>
<hr title="Separator After Status Section" />
<p><br />
</p><p><br />
</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="#Constants.2C_Symbol_Spaces.2C_and_Datatypes"><span class="tocnumber">2</span> <span class="toctext">Constants, Symbol Spaces, and Datatypes</span></a>
<ul>
<li class="toclevel-2"><a href="#Constants_and_Symbol_Spaces"><span class="tocnumber">2.1</span> <span class="toctext">Constants and Symbol Spaces</span></a></li>
<li class="toclevel-2"><a href="#The_Base_and_Prefix_Directives"><span class="tocnumber">2.2</span> <span class="toctext">The Base and Prefix Directives</span></a>
<ul>
<li class="toclevel-3"><a href="#Symbol_Spaces"><span class="tocnumber">2.2.1</span> <span class="toctext">Symbol Spaces</span></a></li>
<li class="toclevel-3"><a href="#Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax"><span class="tocnumber">2.2.2</span> <span class="toctext">Shortcuts for Constants in RIF's Presentation Syntax</span></a></li>
<li class="toclevel-3"><a href="#Relative_IRIs"><span class="tocnumber">2.2.3</span> <span class="toctext">Relative IRIs</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Datatypes"><span class="tocnumber">2.3</span> <span class="toctext">Datatypes</span></a>
<ul>
<li class="toclevel-3"><a href="#XML_Schema_Datatypes"><span class="tocnumber">2.3.1</span> <span class="toctext">XML Schema Datatypes</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1"><a href="#Syntax_and_Semantics_of_Built-ins"><span class="tocnumber">3</span> <span class="toctext">Syntax and Semantics of Built-ins</span></a>
<ul>
<li class="toclevel-2"><a href="#Syntax__of_Built-ins"><span class="tocnumber">3.1</span> <span class="toctext">Syntax of Built-ins</span></a></li>
<li class="toclevel-2"><a href="#Semantics_of_Built-ins"><span class="tocnumber">3.2</span> <span class="toctext">Semantics of Built-ins</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#List_of_RIF_Built-in_Predicates_and_Functions"><span class="tocnumber">4</span> <span class="toctext">List of RIF Built-in Predicates and Functions</span></a>
<ul>
<li class="toclevel-2"><a href="#Predicates_for_all_Datatypes"><span class="tocnumber">4.1</span> <span class="toctext">Predicates for all Datatypes</span></a>
<ul>
<li class="toclevel-3"><a href="#Comparison_for_Literals"><span class="tocnumber">4.1.1</span> <span class="toctext">Comparison for Literals</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:literal-not-identical"><span class="tocnumber">4.1.1.1</span> <span class="toctext">pred:literal-not-identical</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Guard_Predicates_for_Datatypes"><span class="tocnumber">4.2</span> <span class="toctext">Guard Predicates for Datatypes</span></a></li>
<li class="toclevel-2"><a href="#Negative_Guard_Predicates_for_Datatypes"><span class="tocnumber">4.3</span> <span class="toctext">Negative Guard Predicates for Datatypes</span></a></li>
<li class="toclevel-2"><a href="#Datatype_Conversion_and_Casting"><span class="tocnumber">4.4</span> <span class="toctext">Datatype Conversion and Casting</span></a>
<ul>
<li class="toclevel-3"><a href="#Casting_to_XML_Schema_Datatypes"><span class="tocnumber">4.4.1</span> <span class="toctext">Casting to XML Schema Datatypes</span></a></li>
<li class="toclevel-3"><a href="#Casting_to_rdf:XMLLiteral"><span class="tocnumber">4.4.2</span> <span class="toctext">Casting to rdf:XMLLiteral</span></a></li>
<li class="toclevel-3"><a href="#Casting_to_rdf:PlainLiteral"><span class="tocnumber">4.4.3</span> <span class="toctext">Casting to rdf:PlainLiteral</span></a></li>
<li class="toclevel-3"><a href="#pred:iri-string"><span class="tocnumber">4.4.4</span> <span class="toctext">pred:iri-string</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Numeric_Functions_and_Predicates"><span class="tocnumber">4.5</span> <span class="toctext">Numeric Functions and Predicates</span></a>
<ul>
<li class="toclevel-3"><a href="#Numeric_Functions"><span class="tocnumber">4.5.1</span> <span class="toctext">Numeric Functions</span></a></li>
<li class="toclevel-3"><a href="#Numeric_Predicates"><span class="tocnumber">4.5.2</span> <span class="toctext">Numeric Predicates</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:numeric-equal_.28adapted_from_op:numeric-equal.29"><span class="tocnumber">4.5.2.1</span> <span class="toctext">pred:numeric-equal (adapted from op:numeric-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-less-than_.28adapted_from_op:numeric-less-than.29"><span class="tocnumber">4.5.2.2</span> <span class="toctext">pred:numeric-less-than (adapted from op:numeric-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-greater-than_.28adapted_from_op:numeric-greater-than.29"><span class="tocnumber">4.5.2.3</span> <span class="toctext">pred:numeric-greater-than (adapted from op:numeric-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-not-equal"><span class="tocnumber">4.5.2.4</span> <span class="toctext">pred:numeric-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-less-than-or-equal"><span class="tocnumber">4.5.2.5</span> <span class="toctext">pred:numeric-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:numeric-greater-than-or-equal"><span class="tocnumber">4.5.2.6</span> <span class="toctext">pred:numeric-greater-than-or-equal</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_Boolean_Values"><span class="tocnumber">4.6</span> <span class="toctext">Functions and Predicates on Boolean Values</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_Boolean_Values"><span class="tocnumber">4.6.1</span> <span class="toctext">Functions on Boolean Values</span></a>
<ul>
<li class="toclevel-4"><a href="#func:not__.28adapted_from_fn:not.29"><span class="tocnumber">4.6.1.1</span> <span class="toctext">func:not (adapted from fn:not)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_Boolean_Values"><span class="tocnumber">4.6.2</span> <span class="toctext">Predicates on Boolean Values</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:boolean-equal__.28adapted_from_op:boolean-equal.29"><span class="tocnumber">4.6.2.1</span> <span class="toctext">pred:boolean-equal (adapted from op:boolean-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:boolean-less-than__.28adapted_from_op:boolean-less-than.29"><span class="tocnumber">4.6.2.2</span> <span class="toctext">pred:boolean-less-than (adapted from op:boolean-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:boolean-greater-than__.28adapted_from_op:boolean-greater-than.29"><span class="tocnumber">4.6.2.3</span> <span class="toctext">pred:boolean-greater-than (adapted from op:boolean-greater-than)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_Strings"><span class="tocnumber">4.7</span> <span class="toctext">Functions and Predicates on Strings</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_Strings"><span class="tocnumber">4.7.1</span> <span class="toctext">Functions on Strings</span></a>
<ul>
<li class="toclevel-4"><a href="#func:compare_.28adapted_from_fn:compare.29"><span class="tocnumber">4.7.1.1</span> <span class="toctext">func:compare (adapted from fn:compare)</span></a></li>
<li class="toclevel-4"><a href="#func:concat_.28adapted_from_fn:concat.29"><span class="tocnumber">4.7.1.2</span> <span class="toctext">func:concat (adapted from fn:concat)</span></a></li>
<li class="toclevel-4"><a href="#func:string-join_.28adapted_from_fn:string-join.29"><span class="tocnumber">4.7.1.3</span> <span class="toctext">func:string-join (adapted from fn:string-join)</span></a></li>
<li class="toclevel-4"><a href="#func:substring_.28adapted_from_fn:substring.29"><span class="tocnumber">4.7.1.4</span> <span class="toctext">func:substring (adapted from fn:substring)</span></a></li>
<li class="toclevel-4"><a href="#func:string-length_.28adapted_from_fn:string-length.29"><span class="tocnumber">4.7.1.5</span> <span class="toctext">func:string-length (adapted from fn:string-length)</span></a></li>
<li class="toclevel-4"><a href="#func:upper-case_.28adapted_from_fn:upper-case.29"><span class="tocnumber">4.7.1.6</span> <span class="toctext">func:upper-case (adapted from fn:upper-case)</span></a></li>
<li class="toclevel-4"><a href="#func:lower-case_.28adapted_from_fn:lower-case.29"><span class="tocnumber">4.7.1.7</span> <span class="toctext">func:lower-case (adapted from fn:lower-case)</span></a></li>
<li class="toclevel-4"><a href="#func:encode-for-uri_.28adapted_from_fn:encode-for-uri.29"><span class="tocnumber">4.7.1.8</span> <span class="toctext">func:encode-for-uri (adapted from fn:encode-for-uri)</span></a></li>
<li class="toclevel-4"><a href="#func:iri-to-uri_.28adapted_from_fn:iri-to-uri.29"><span class="tocnumber">4.7.1.9</span> <span class="toctext">func:iri-to-uri (adapted from fn:iri-to-uri)</span></a></li>
<li class="toclevel-4"><a href="#func:escape-html-uri_.28adapted_from_fn:escape-html-uri.29"><span class="tocnumber">4.7.1.10</span> <span class="toctext">func:escape-html-uri (adapted from fn:escape-html-uri)</span></a></li>
<li class="toclevel-4"><a href="#func:substring-before_.28adapted_from_fn:substring-before.29"><span class="tocnumber">4.7.1.11</span> <span class="toctext">func:substring-before (adapted from fn:substring-before)</span></a></li>
<li class="toclevel-4"><a href="#func:substring-after_.28adapted_from_fn:substring-after.29"><span class="tocnumber">4.7.1.12</span> <span class="toctext">func:substring-after (adapted from fn:substring-after)</span></a></li>
<li class="toclevel-4"><a href="#func:replace_.28adapted_from_fn:replace.29"><span class="tocnumber">4.7.1.13</span> <span class="toctext">func:replace (adapted from fn:replace)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_Strings"><span class="tocnumber">4.7.2</span> <span class="toctext">Predicates on Strings</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:contains_.28adapted_from_fn:contains.29"><span class="tocnumber">4.7.2.1</span> <span class="toctext">pred:contains (adapted from fn:contains)</span></a></li>
<li class="toclevel-4"><a href="#pred:starts-with_.28adapted_from_fn:starts-with.29"><span class="tocnumber">4.7.2.2</span> <span class="toctext">pred:starts-with (adapted from fn:starts-with)</span></a></li>
<li class="toclevel-4"><a href="#pred:ends-with_.28adapted_from_fn:ends-with.29"><span class="tocnumber">4.7.2.3</span> <span class="toctext">pred:ends-with (adapted from fn:ends-with)</span></a></li>
<li class="toclevel-4"><a href="#pred:matches_.28adapted_from_fn:matches.29"><span class="tocnumber">4.7.2.4</span> <span class="toctext">pred:matches (adapted from fn:matches)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_Dates.2C_Times.2C_and_Durations"><span class="tocnumber">4.8</span> <span class="toctext">Functions and Predicates on Dates, Times, and Durations</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_Dates.2C_Times.2C_and_Durations"><span class="tocnumber">4.8.1</span> <span class="toctext">Functions on Dates, Times, and Durations</span></a>
<ul>
<li class="toclevel-4"><a href="#func:year-from-dateTime_.28adapted_from_fn:year-from-dateTime.29"><span class="tocnumber">4.8.1.1</span> <span class="toctext">func:year-from-dateTime (adapted from fn:year-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:month-from-dateTime_.28adapted_from_fn:month-from-dateTime.29"><span class="tocnumber">4.8.1.2</span> <span class="toctext">func:month-from-dateTime (adapted from fn:month-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:day-from-dateTime_.28adapted_from_fn:day-from-dateTime.29"><span class="tocnumber">4.8.1.3</span> <span class="toctext">func:day-from-dateTime (adapted from fn:day-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:hours-from-dateTime_.28adapted_from_fn:hours-from-dateTime.29"><span class="tocnumber">4.8.1.4</span> <span class="toctext">func:hours-from-dateTime (adapted from fn:hours-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:minutes-from-dateTime_.28adapted_from_fn:minutes-from-dateTime.29"><span class="tocnumber">4.8.1.5</span> <span class="toctext">func:minutes-from-dateTime (adapted from fn:minutes-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:seconds-from-dateTime_.28adapted_from_fn:seconds-from-dateTime.29"><span class="tocnumber">4.8.1.6</span> <span class="toctext">func:seconds-from-dateTime (adapted from fn:seconds-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:year-from-date_.28adapted_from_fn:year-from-date.29"><span class="tocnumber">4.8.1.7</span> <span class="toctext">func:year-from-date (adapted from fn:year-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:month-from-date_.28adapted_from_fn:month-from-date.29"><span class="tocnumber">4.8.1.8</span> <span class="toctext">func:month-from-date (adapted from fn:month-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:day-from-date_.28adapted_from_fn:day-from-date.29"><span class="tocnumber">4.8.1.9</span> <span class="toctext">func:day-from-date (adapted from fn:day-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:hours-from-time_.28adapted_from_fn:hours-from-time.29"><span class="tocnumber">4.8.1.10</span> <span class="toctext">func:hours-from-time (adapted from fn:hours-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:minutes-from-time_.28adapted_from_fn:minutes-from-time.29"><span class="tocnumber">4.8.1.11</span> <span class="toctext">func:minutes-from-time (adapted from fn:minutes-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:seconds-from-time_.28adapted_from_fn:seconds-from-time.29"><span class="tocnumber">4.8.1.12</span> <span class="toctext">func:seconds-from-time (adapted from fn:seconds-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:years-from-duration_.28adapted_from_fn:years-from-duration.29"><span class="tocnumber">4.8.1.13</span> <span class="toctext">func:years-from-duration (adapted from fn:years-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:months-from-duration_.28adapted_from_fn:months-from-duration.29"><span class="tocnumber">4.8.1.14</span> <span class="toctext">func:months-from-duration (adapted from fn:months-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:days-from-duration_.28adapted_from_fn:days-from-duration.29"><span class="tocnumber">4.8.1.15</span> <span class="toctext">func:days-from-duration (adapted from fn:days-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:hours-from-duration_.28adapted_from_fn:hours-from-duration.29"><span class="tocnumber">4.8.1.16</span> <span class="toctext">func:hours-from-duration (adapted from fn:hours-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:minutes-from-duration_.28adapted_from_fn:minutes-from-duration.29"><span class="tocnumber">4.8.1.17</span> <span class="toctext">func:minutes-from-duration (adapted from fn:minutes-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:seconds-from-duration_.28adapted_from_fn:seconds-from-duration.29"><span class="tocnumber">4.8.1.18</span> <span class="toctext">func:seconds-from-duration (adapted from fn:seconds-from-duration)</span></a></li>
<li class="toclevel-4"><a href="#func:timezone-from-dateTime_.28adapted_from_fn:timezone-from-dateTime.29"><span class="tocnumber">4.8.1.19</span> <span class="toctext">func:timezone-from-dateTime (adapted from fn:timezone-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:timezone-from-date_.28adapted_from_fn:timezone-from-date.29"><span class="tocnumber">4.8.1.20</span> <span class="toctext">func:timezone-from-date (adapted from fn:timezone-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:timezone-from-time_.28adapted_from_fn:timezone-from-time.29"><span class="tocnumber">4.8.1.21</span> <span class="toctext">func:timezone-from-time (adapted from fn:timezone-from-time)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dateTimes_.28adapted_from_op:subtract-dateTimes.29"><span class="tocnumber">4.8.1.22</span> <span class="toctext">func:subtract-dateTimes (adapted from op:subtract-dateTimes)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dates_.28adapted_from_op:subtract-dates.29"><span class="tocnumber">4.8.1.23</span> <span class="toctext">func:subtract-dates (adapted from op:subtract-dates)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-times_.28adapted_from_op:subtract-times.29"><span class="tocnumber">4.8.1.24</span> <span class="toctext">func:subtract-times (adapted from op:subtract-times)</span></a></li>
<li class="toclevel-4"><a href="#func:add-yearMonthDurations_.28adapted_from_op:add-yearMonthDurations.29"><span class="tocnumber">4.8.1.25</span> <span class="toctext">func:add-yearMonthDurations (adapted from op:add-yearMonthDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-yearMonthDurations_.28adapted_from_op:subtract-yearMonthDurations.29"><span class="tocnumber">4.8.1.26</span> <span class="toctext">func:subtract-yearMonthDurations (adapted from op:subtract-yearMonthDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:multiply-yearMonthDuration_.28adapted_from_op:multiply-yearMonthDuration.29"><span class="tocnumber">4.8.1.27</span> <span class="toctext">func:multiply-yearMonthDuration (adapted from op:multiply-yearMonthDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration.29"><span class="tocnumber">4.8.1.28</span> <span class="toctext">func:divide-yearMonthDuration (adapted from op:divide-yearMonthDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-yearMonthDuration-by-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration-by-yearMonthDuration.29"><span class="tocnumber">4.8.1.29</span> <span class="toctext">func:divide-yearMonthDuration-by-yearMonthDuration (adapted from op:divide-yearMonthDuration-by-yearMonthDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDurations_.28adapted_from_op:add-dayTimeDurations.29"><span class="tocnumber">4.8.1.30</span> <span class="toctext">func:add-dayTimeDurations (adapted from op:add-dayTimeDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDurations_.28adapted_from_op:subtract-dayTimeDurations.29"><span class="tocnumber">4.8.1.31</span> <span class="toctext">func:subtract-dayTimeDurations (adapted from op:subtract-dayTimeDurations)</span></a></li>
<li class="toclevel-4"><a href="#func:multiply-dayTimeDuration_.28adapted_from_op:multiply-dayTimeDuration.29"><span class="tocnumber">4.8.1.32</span> <span class="toctext">func:multiply-dayTimeDuration (adapted from op:multiply-dayTimeDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration.29"><span class="tocnumber">4.8.1.33</span> <span class="toctext">func:divide-dayTimeDuration (adapted from op:divide-dayTimeDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:divide-dayTimeDuration-by-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration-by-dayTimeDuration.29"><span class="tocnumber">4.8.1.34</span> <span class="toctext">func:divide-dayTimeDuration-by-dayTimeDuration (adapted from op:divide-dayTimeDuration-by-dayTimeDuration)</span></a></li>
<li class="toclevel-4"><a href="#func:add-yearMonthDuration-to-dateTime_.28adapted_from_op:add-yearMonthDuration-to-dateTime.29"><span class="tocnumber">4.8.1.35</span> <span class="toctext">func:add-yearMonthDuration-to-dateTime (adapted from op:add-yearMonthDuration-to-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:add-yearMonthDuration-to-date_.28adapted_from_op:add-yearMonthDuration-to-date.29"><span class="tocnumber">4.8.1.36</span> <span class="toctext">func:add-yearMonthDuration-to-date (adapted from op:add-yearMonthDuration-to-date)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDuration-to-dateTime_.28adapted_from_op:add-dayTimeDuration-to-dateTime.29"><span class="tocnumber">4.8.1.37</span> <span class="toctext">func:add-dayTimeDuration-to-dateTime (adapted from op:add-dayTimeDuration-to-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDuration-to-date_.28adapted_from_op:add-dayTimeDuration-to-date.29"><span class="tocnumber">4.8.1.38</span> <span class="toctext">func:add-dayTimeDuration-to-date (adapted from op:add-dayTimeDuration-to-date)</span></a></li>
<li class="toclevel-4"><a href="#func:add-dayTimeDuration-to-time_.28adapted_from_op:add-dayTimeDuration-to-time.29"><span class="tocnumber">4.8.1.39</span> <span class="toctext">func:add-dayTimeDuration-to-time (adapted from op:add-dayTimeDuration-to-time)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-yearMonthDuration-from-dateTime_.28adapted_from_op:subtract-yearMonthDuration-from-dateTime.29"><span class="tocnumber">4.8.1.40</span> <span class="toctext">func:subtract-yearMonthDuration-from-dateTime (adapted from op:subtract-yearMonthDuration-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-yearMonthDuration-from-date_.28adapted_from_op:subtract-yearMonthDuration-from-date.29"><span class="tocnumber">4.8.1.41</span> <span class="toctext">func:subtract-yearMonthDuration-from-date (adapted from op:subtract-yearMonthDuration-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDuration-from-dateTime_.28adapted_from_op:subtract-dayTimeDuration-from-dateTime.29"><span class="tocnumber">4.8.1.42</span> <span class="toctext">func:subtract-dayTimeDuration-from-dateTime (adapted from op:subtract-dayTimeDuration-from-dateTime)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDuration-from-date_.28adapted_from_op:subtract-dayTimeDuration-from-date.29"><span class="tocnumber">4.8.1.43</span> <span class="toctext">func:subtract-dayTimeDuration-from-date (adapted from op:subtract-dayTimeDuration-from-date)</span></a></li>
<li class="toclevel-4"><a href="#func:subtract-dayTimeDuration-from-time_.28adapted_from_op:subtract-dayTimeDuration-from-time.29"><span class="tocnumber">4.8.1.44</span> <span class="toctext">func:subtract-dayTimeDuration-from-time (adapted from op:subtract-dayTimeDuration-from-time)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_Dates.2C_Times.2C_and_Durations"><span class="tocnumber">4.8.2</span> <span class="toctext">Predicates on Dates, Times, and Durations</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:dateTime-equal_.28adapted_from_op:dateTime-equal.29"><span class="tocnumber">4.8.2.1</span> <span class="toctext">pred:dateTime-equal (adapted from op:dateTime-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-less-than_.28adapted_from_op:dateTime-less-than.29"><span class="tocnumber">4.8.2.2</span> <span class="toctext">pred:dateTime-less-than (adapted from op:dateTime-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-greater-than_.28adapted_from_op:dateTime-greater-than.29"><span class="tocnumber">4.8.2.3</span> <span class="toctext">pred:dateTime-greater-than (adapted from op:dateTime-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:date-equal_.28adapted_from_op:date-equal.29"><span class="tocnumber">4.8.2.4</span> <span class="toctext">pred:date-equal (adapted from op:date-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:date-less-than_.28adapted_from_op:date-less-than.29"><span class="tocnumber">4.8.2.5</span> <span class="toctext">pred:date-less-than (adapted from op:date-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:date-greater-than_.28adapted_from_op:date-greater-than.29"><span class="tocnumber">4.8.2.6</span> <span class="toctext">pred:date-greater-than (adapted from op:date-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:time-equal_.28adapted_from_op:time-equal.29"><span class="tocnumber">4.8.2.7</span> <span class="toctext">pred:time-equal (adapted from op:time-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:time-less-than_.28adapted_from_op:time-less-than.29"><span class="tocnumber">4.8.2.8</span> <span class="toctext">pred:time-less-than (adapted from op:time-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:time-greater-than_.28adapted_from_op:time-greater-than.29"><span class="tocnumber">4.8.2.9</span> <span class="toctext">pred:time-greater-than (adapted from op:time-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:duration-equal_.28adapted_from_op:duration-equal.29"><span class="tocnumber">4.8.2.10</span> <span class="toctext">pred:duration-equal (adapted from op:duration-equal)</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-less-than_.28adapted_from_op:dayTimeDuration-less-than.29"><span class="tocnumber">4.8.2.11</span> <span class="toctext">pred:dayTimeDuration-less-than (adapted from op:dayTimeDuration-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-greater-than_.28adapted_from_op:dayTimeDuration-greater-than.29"><span class="tocnumber">4.8.2.12</span> <span class="toctext">pred:dayTimeDuration-greater-than (adapted from op:dayTimeDuration-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-less-than_.28adapted_from_op:yearMonthDuration-less-than.29"><span class="tocnumber">4.8.2.13</span> <span class="toctext">pred:yearMonthDuration-less-than (adapted from op:yearMonthDuration-less-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-greater-than_.28adapted_from_op:yearMonthDuration-greater-than.29"><span class="tocnumber">4.8.2.14</span> <span class="toctext">pred:yearMonthDuration-greater-than (adapted from op:yearMonthDuration-greater-than)</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-not-equal"><span class="tocnumber">4.8.2.15</span> <span class="toctext">pred:dateTime-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-less-than-or-equal"><span class="tocnumber">4.8.2.16</span> <span class="toctext">pred:dateTime-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dateTime-greater-than-or-equal"><span class="tocnumber">4.8.2.17</span> <span class="toctext">pred:dateTime-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:date-not-equal"><span class="tocnumber">4.8.2.18</span> <span class="toctext">pred:date-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:date-less-than-or-equal"><span class="tocnumber">4.8.2.19</span> <span class="toctext">pred:date-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:date-greater-than-or-equal"><span class="tocnumber">4.8.2.20</span> <span class="toctext">pred:date-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:time-not-equal"><span class="tocnumber">4.8.2.21</span> <span class="toctext">pred:time-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:time-less-than-or-equal"><span class="tocnumber">4.8.2.22</span> <span class="toctext">pred:time-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:time-greater-than-or-equal"><span class="tocnumber">4.8.2.23</span> <span class="toctext">pred:time-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:duration-not-equal"><span class="tocnumber">4.8.2.24</span> <span class="toctext">pred:duration-not-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-less-than-or-equal"><span class="tocnumber">4.8.2.25</span> <span class="toctext">pred:dayTimeDuration-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:dayTimeDuration-greater-than-or-equal"><span class="tocnumber">4.8.2.26</span> <span class="toctext">pred:dayTimeDuration-greater-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-less-than-or-equal"><span class="tocnumber">4.8.2.27</span> <span class="toctext">pred:yearMonthDuration-less-than-or-equal</span></a></li>
<li class="toclevel-4"><a href="#pred:yearMonthDuration-greater-than-or-equal"><span class="tocnumber">4.8.2.28</span> <span class="toctext">pred:yearMonthDuration-greater-than-or-equal</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_rdf:XMLLiterals"><span class="tocnumber">4.9</span> <span class="toctext">Functions and Predicates on rdf:XMLLiterals</span></a>
<ul>
<li class="toclevel-3"><a href="#pred:XMLLiteral-equal"><span class="tocnumber">4.9.1</span> <span class="toctext">pred:XMLLiteral-equal</span></a></li>
<li class="toclevel-3"><a href="#pred:XMLLiteral-not-equal"><span class="tocnumber">4.9.2</span> <span class="toctext">pred:XMLLiteral-not-equal</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_rdf:PlainLiteral"><span class="tocnumber">4.10</span> <span class="toctext">Functions and Predicates on rdf:PlainLiteral</span></a>
<ul>
<li class="toclevel-3"><a href="#Functions_on_rdf:PlainLiteral"><span class="tocnumber">4.10.1</span> <span class="toctext">Functions on rdf:PlainLiteral</span></a>
<ul>
<li class="toclevel-4"><a href="#func:PlainLiteral-from-string-lang_.28adapted_from_plfn:PlainLiteral-from-string-lang.29"><span class="tocnumber">4.10.1.1</span> <span class="toctext">func:PlainLiteral-from-string-lang (adapted from plfn:PlainLiteral-from-string-lang)</span></a></li>
<li class="toclevel-4"><a href="#func:string-from-PlainLiteral_.28adapted_from_plfn:string-from-PlainLiteral.29"><span class="tocnumber">4.10.1.2</span> <span class="toctext">func:string-from-PlainLiteral (adapted from plfn:string-from-PlainLiteral)</span></a></li>
<li class="toclevel-4"><a href="#func:lang-from-PlainLiteral_.28adapted_from_plfn:lang-from-PlainLiteral.29"><span class="tocnumber">4.10.1.3</span> <span class="toctext">func:lang-from-PlainLiteral (adapted from plfn:lang-from-PlainLiteral)</span></a></li>
<li class="toclevel-4"><a href="#func:PlainLiteral-compare_.28adapted_from_plfn:compare.29"><span class="tocnumber">4.10.1.4</span> <span class="toctext">func:PlainLiteral-compare (adapted from plfn:compare)</span></a></li>
<li class="toclevel-4"><a href="#func:PlainLiteral-length_.28adapted_from_plfn:length.29"><span class="tocnumber">4.10.1.5</span> <span class="toctext">func:PlainLiteral-length (adapted from plfn:length)</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Predicates_on_rdf:PlainLiteral"><span class="tocnumber">4.10.2</span> <span class="toctext">Predicates on rdf:PlainLiteral</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:matches-language-range_.28adapted_from_plfn:matches-language-range.29"><span class="tocnumber">4.10.2.1</span> <span class="toctext">pred:matches-language-range (adapted from plfn:matches-language-range)</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2"><a href="#Functions_and_Predicates_on_RIF_Lists"><span class="tocnumber">4.11</span> <span class="toctext">Functions and Predicates on RIF Lists</span></a>
<ul>
<li class="toclevel-3"><a href="#Position_Numbering"><span class="tocnumber">4.11.1</span> <span class="toctext">Position Numbering</span></a></li>
<li class="toclevel-3"><a href="#Item_Comparison"><span class="tocnumber">4.11.2</span> <span class="toctext">Item Comparison</span></a></li>
<li class="toclevel-3"><a href="#Predicates_on_RIF_Lists"><span class="tocnumber">4.11.3</span> <span class="toctext">Predicates on RIF Lists</span></a>
<ul>
<li class="toclevel-4"><a href="#pred:is-list"><span class="tocnumber">4.11.3.1</span> <span class="toctext">pred:is-list</span></a></li>
<li class="toclevel-4"><a href="#pred:list-contains"><span class="tocnumber">4.11.3.2</span> <span class="toctext">pred:list-contains</span></a></li>
</ul>
</li>
<li class="toclevel-3"><a href="#Functions_on_RIF_Lists"><span class="tocnumber">4.11.4</span> <span class="toctext">Functions on RIF Lists</span></a>
<ul>
<li class="toclevel-4"><a href="#func:make-list"><span class="tocnumber">4.11.4.1</span> <span class="toctext">func:make-list</span></a></li>
<li class="toclevel-4"><a href="#func:count_.28adapted_from_fn:count.29"><span class="tocnumber">4.11.4.2</span> <span class="toctext">func:count (adapted from fn:count)</span></a></li>
<li class="toclevel-4"><a href="#func:get"><span class="tocnumber">4.11.4.3</span> <span class="toctext">func:get</span></a></li>
<li class="toclevel-4"><a href="#func:sublist_.28adapted_from_fn:subsequence.29"><span class="tocnumber">4.11.4.4</span> <span class="toctext">func:sublist (adapted from fn:subsequence)</span></a></li>
<li class="toclevel-4"><a href="#func:append"><span class="tocnumber">4.11.4.5</span> <span class="toctext">func:append</span></a></li>
<li class="toclevel-4"><a href="#func:concatenate_.28adapted_from_fn:concatenate.29"><span class="tocnumber">4.11.4.6</span> <span class="toctext">func:concatenate (adapted from fn:concatenate)</span></a></li>
<li class="toclevel-4"><a href="#func:insert-before_.28adapted_from_fn:insert-before.29"><span class="tocnumber">4.11.4.7</span> <span class="toctext">func:insert-before (adapted from fn:insert-before)</span></a></li>
<li class="toclevel-4"><a href="#func:remove_.28adapted_from_fn:remove.29"><span class="tocnumber">4.11.4.8</span> <span class="toctext">func:remove (adapted from fn:remove)</span></a></li>
<li class="toclevel-4"><a href="#func:reverse_.28adapted_from_fn:reverse.29"><span class="tocnumber">4.11.4.9</span> <span class="toctext">func:reverse (adapted from fn:reverse)</span></a></li>
<li class="toclevel-4"><a href="#func:index-of_.28adapted_from_fn:index-of.29"><span class="tocnumber">4.11.4.10</span> <span class="toctext">func:index-of (adapted from fn:index-of)</span></a></li>
<li class="toclevel-4"><a href="#func:union_.28inspired_by_fn:union.29"><span class="tocnumber">4.11.4.11</span> <span class="toctext">func:union (inspired by fn:union)</span></a></li>
<li class="toclevel-4"><a href="#func:distinct-values_.28adapted_from_fn:distinct-values.29"><span class="tocnumber">4.11.4.12</span> <span class="toctext">func:distinct-values (adapted from fn:distinct-values)</span></a></li>
<li class="toclevel-4"><a href="#func:intersect_.28inspired_by_fn:intersect.29"><span class="tocnumber">4.11.4.13</span> <span class="toctext">func:intersect (inspired by fn:intersect)</span></a></li>
<li class="toclevel-4"><a href="#func:except_.28inspired_by_fn:except.29"><span class="tocnumber">4.11.4.14</span> <span class="toctext">func:except (inspired by fn:except)</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1"><a href="#References"><span class="tocnumber">5</span> <span class="toctext">References</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_Schemas_for_Externally_Defined_Terms"><span class="tocnumber">6</span> <span class="toctext">Appendix: Schemas for Externally Defined Terms</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_Changes_from_Candidate_Recommendation_Version_of_October_1.2C_2010"><span class="tocnumber">7</span> <span class="toctext">Appendix: Changes from Candidate Recommendation Version of October 1, 2010</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><h1> <span class="mw-headline">1 Overview </span></h1>
<p><span class="anchor" id="sec-overview"></span> This specification develops <i><b>RIF-DTB</b></i> (<b>D</b>ata<b>t</b>ypes and <b>B</b>uilt-Ins of the <b>R</b>ule <b>I</b>nterchange <b>F</b>ormat). It lists the datatypes, built-in functions and built-in predicates expected to be supported by RIF dialects such as the <a class="external text" href="http://www.w3.org/TR/rif-core/" title="http://www.w3.org/TR/rif-core/">RIF Core Dialect</a>, the <a class="external text" href="http://www.w3.org/TR/rif-bld/" title="http://www.w3.org/TR/rif-bld/">RIF Basic Logic Dialect</a>, and the <a class="external text" href="http://www.w3.org/TR/rif-prd/" title="http://www.w3.org/TR/rif-prd/">RIF Production Rules Dialect</a>.
</p><p>Some of the datatypes are adapted from [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>]. A large part of the definitions of the listed functions and operators are adapted from [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. The <tt>rdf:PlainLiteral</tt> datatype as well as functions and operators associated with that datatype are adopted from [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>]. Unlike the earlier SWRL built-ins [<a href="#ref-swrl" title="">SWRL</a>], which write n-ary functions as (1+n)-ary relations, functional RIF-DTB built-ins remain functions.
</p><p>Currently in 1.0, RIF-DTB can also help in the interoperation of RIF with other (Semantic) Web formalisms by providing a general infrastructure of datatypes and built-ins.
</p>
<a id="Constants.2C_Symbol_Spaces.2C_and_Datatypes" name="Constants.2C_Symbol_Spaces.2C_and_Datatypes"></a><h1> <span class="mw-headline">2 <span class="anchor" id="sec-constants"> Constants, Symbol Spaces, and Datatypes </span> </span></h1>
<a id="Constants_and_Symbol_Spaces" name="Constants_and_Symbol_Spaces"></a><h2> <span class="mw-headline">2.1 <span class="anchor" id="sec-symbol-spaces">Constants and Symbol Spaces</span> </span></h2>
<p>Each constant (that is, each non-keyword symbol) in RIF belongs to a particular symbol space. A constant in a particular RIF symbol space has the following presentation syntax:
</p>
<p><tt>"<i>literal</i>"^^&lt;<i>symbolSpaceIri</i>&gt;</tt></p>
<p>where <tt><i>literal</i></tt> is called the <i><b>lexical part</b></i> of the symbol, and <tt><i>symbolSpaceIri</i></tt> is the (absolute or relative) IRI identifying the <i><b>symbol space</b></i>. Here <tt>literal</tt> is a Unicode string that must be an element in the lexical space of the symbol space identified by the IRI <i>symbolSpaceIri</i>.
</p>
<a id="The_Base_and_Prefix_Directives" name="The_Base_and_Prefix_Directives"></a><h2> <span class="mw-headline">2.2 <span class="anchor" id="sec-base">The Base and Prefix Directives</span> </span></h2>
<p>Since IRIs typically require long strings of characters, many Web languages have special provisions for abbreviating these strings. One well-known technique is called <i>compact URI</i> [<a href="#ref-curie" title="">CURIE</a>], and RIF uses a similar technique by allowing RIF documents to have the directives <tt>Base</tt> and <tt>Prefix</tt>.
</p>
<ul>
<li>
A <i><b>base directive</b></i> has the form <tt>Base(&lt;iri&gt;)</tt>, where <tt>iri</tt> is a Unicode string in the form of an <i><b>absolute</b></i> IRI [<a href="#ref-rfc-3987" title="">RFC-3987</a>].
<p>
The <tt>Base</tt> directive defines a syntactic shortcut for expanding
relative IRIs into full IRIs.
</p>
</li>
<li>
A <i><b>prefix directive</b></i> has the form <tt>Prefix(p &lt;v&gt;)</tt>, where <tt>p</tt> is called a <i><b>prefix</b></i> and <tt>v</tt> is its <i><b>expansion</b></i>.
The prefix p is an alphanumeric string and the expansion v is a string that forms an IRI.
(An alphanumeric string is a sequence of ASCII characters, where each character is a letter, a digit, or an underscore "_", and the first character is a letter.)
<p>
The basic idea is that in certain contexts prefixes can be used instead of their much longer expansions, and this provides for a much more concise and simple notation.
</p>
</li>
</ul>
<p>
The precise way in which these directives work is explained in Section <a href="#sec-shortcuts-constants" title="">Shortcuts for Constants in RIF's Presentation Syntax</a>.
</p>
<p>To avoid writing down long IRIs, this document will
assume that the following <tt>Prefix</tt> directives have been specified in all the RIF documents under consideration:
</p>
<ul><li> <tt>Prefix( xs &lt;http://www.w3.org/2001/XMLSchema#&gt; )</tt>. This prefix stands for the XML Schema namespace URI.
</li><li> <tt>Prefix( rdf &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; )</tt>. This prefix stands for the RDF URI.
</li><li> <tt>Prefix( rif &lt;http://www.w3.org/2007/rif#&gt; )</tt>. The <tt>rif</tt> prefix stands for the RIF URI.
</li><li> <tt>Prefix( func &lt;http://www.w3.org/2007/rif-builtin-function#&gt; )</tt>. This prefix expands into a URI used for RIF builtin functions.
</li><li> <tt>Prefix( pred &lt;http://www.w3.org/2007/rif-builtin-predicate#&gt; )</tt>. This is the prefix used for RIF builtin predicates.
</li></ul>
<p>Using these prefixes and the shorthand mechanism defined in Section <a href="#sec-shortcuts-constants" title="">Shortcuts for Constants in RIF's Presentation Syntax</a>, we can, for example, abbreviate a
constant such as <tt>"http://www.example.org"^^&lt;http://www.w3.org/2007/rif#iri&gt;</tt> into <tt>"http://www.example.org"^^rif:iri</tt>.
</p>
<a id="Symbol_Spaces" name="Symbol_Spaces"></a><h3> <span class="mw-headline">2.2.1 Symbol Spaces </span></h3>
<p>Formally, we define symbol spaces as follows.
</p><p><span class="anchor" id="def-symspace"></span>
<b>Definition (Symbol space).</b>
A <i><b>symbol space</b></i> is a named subset of the set of all constants, <tt>Const</tt> in RIF. Each symbol in <tt>Const</tt> belongs to exactly one symbol space.
</p><p>Each symbol space has an associated lexical space, a unique IRI identifying it and a short name. More precisely,
</p>
<ul><li> <span class="anchor" id="def-lexical-space"></span> The <i><b>lexical space</b></i> of a symbol space is a non-empty set of Unicode character strings.
</li><li> <span class="anchor" id="def-symspace-identifier"></span> The <i><b>identifier</b></i> of a symbol space is a sequence of Unicode characters that form an absolute IRI.
</li><li> Different symbol spaces supported by a dialect cannot share the same identifier or short name.
</li></ul>
<p>The identifiers of symbol spaces are <b>not</b> themselves constant symbols in RIF.
</p>
<p>
For convenience we will often use symbol space identifiers to refer to the actual symbol spaces (for instance, we may use "symbol space <tt>xs:string</tt>" instead of "symbol space <i>identified by</i> <tt>xs:string</tt>").
</p>
<p>RIF dialects are expected to include the symbol spaces listed in the following. However, rule sets that are exchanged through RIF can use additional symbol spaces.
</p>
<p><span class="anchor" id="def-shortname"></span>
</p>
<p>In the following list we introduce <i><b>short name</b></i>s for some of the symbol spaces. Short names are <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCNames</a>, typically the character sequence after the last '/' or '#' in the symbol space IRI (similar to the <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-LocalPart" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-LocalPart">XML local name</a> part of a <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-QName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-QName">QName</a>). Short names are used for the predicates in Sections <a href="#Guard_Predicates_for_Datatypes" title="">Guard Predicates for Datatypes</a> and <a href="#Negative_Guard_Predicates_for_Datatypes" title="">Negative Guard Predicates for Datatypes</a> below.
</p>
<ul>
<li><tt>xs:anyURI</tt> (<tt>http://www.w3.org/2001/XMLSchema#anyURI</tt>), short name: <tt>anyURI</tt></li>
<li><tt>xs:base64Binary</tt> (<tt>http://www.w3.org/2001/XMLSchema#base64Binary</tt>), short name: <tt>base64Binary</tt></li>
<li><tt>xs:boolean</tt> (<tt>http://www.w3.org/2001/XMLSchema#boolean</tt>), short name: <tt>boolean</tt></li>
<li><tt>xs:date</tt> (<tt>http://www.w3.org/2001/XMLSchema#date</tt>), short name: <tt>date</tt></li>
<li><tt>xs:dateTime</tt> (<tt>http://www.w3.org/2001/XMLSchema#dateTime</tt>), short name: <tt>dateTime</tt></li>
<li><tt>xs:dateTimeStamp</tt> (<tt>http://www.w3.org/2001/XMLSchema#dateTimeStamp</tt>), short name: <tt>dateTimeStamp</tt></li>
<li><tt>xs:double</tt> (<tt>http://www.w3.org/2001/XMLSchema#double</tt>), short name: <tt>double</tt></li>
<li><tt>xs:float</tt> (<tt>http://www.w3.org/2001/XMLSchema#float</tt>), short name: <tt>float</tt></li>
<li><tt>xs:hexBinary</tt> (<tt>http://www.w3.org/2001/XMLSchema#hexBinary</tt>), short name: <tt>hexBinary</tt></li>
<li><tt>xs:decimal</tt> (<tt>http://www.w3.org/2001/XMLSchema#decimal</tt>), short name: <tt>decimal</tt></li>
<li><span class="anchor" id="xs-integer-space"><tt>xs:integer</tt></span> (<tt>http://www.w3.org/2001/XMLSchema#integer</tt>), short name: <tt>integer</tt></li>
<li><tt>xs:long</tt> (<tt>http://www.w3.org/2001/XMLSchema#long</tt>), short name: <tt>long</tt></li>
<li><tt>xs:int</tt> (<tt>http://www.w3.org/2001/XMLSchema#int</tt>), short name: <tt>int</tt></li>
<li><tt>xs:short</tt> (<tt>http://www.w3.org/2001/XMLSchema#short</tt>), short name: <tt>short</tt></li>
<li><tt>xs:byte</tt> (<tt>http://www.w3.org/2001/XMLSchema#byte</tt>), short name:<tt>byte</tt></li>
<li><tt>xs:nonNegativeInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</tt>), short name: <tt>nonNegativeInteger</tt></li>
<li><tt>xs:positiveInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#positiveInteger</tt>), short name: <tt>positiveInteger</tt></li>
<li><tt>xs:unsignedLong</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedLong</tt>), short name: <tt>unsignedLong</tt></li>
<li><tt>xs:unsignedInt</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedInt</tt>), short name: <tt>unsignedInt</tt></li>
<li><tt>xs:unsignedShort</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedShort</tt>), short name: <tt>unsignedShort</tt></li>
<li><tt>xs:unsignedByte</tt> (<tt>http://www.w3.org/2001/XMLSchema#unsignedByte</tt>), short name: <tt>unsignedByte</tt></li>
<li><tt>xs:nonPositiveInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#nonPositiveInteger</tt>), short name: <tt>nonPositiveInteger</tt></li>
<li><tt>xs:negativeInteger</tt> (<tt>http://www.w3.org/2001/XMLSchema#negativeInteger</tt>), short name: <tt>negativeInteger</tt></li>
<li><span class="anchor" id="xs-string-space"><tt>xs:string</tt></span> (<tt>http://www.w3.org/2001/XMLSchema#string</tt>), short name: <tt>string</tt></li>
<li><tt>xs:normalizedString</tt> (<tt>http://www.w3.org/2001/XMLSchema#normalizedString</tt>), short name: <tt>normalizedString</tt></li>
<li><tt>xs:token</tt> (<tt>http://www.w3.org/2001/XMLSchema#token</tt>), short name: <tt>token</tt></li>
<li><tt>xs:language</tt> (<tt>http://www.w3.org/2001/XMLSchema#language</tt>), short name: <tt>language</tt></li>
<li><tt>xs:Name</tt> (<tt>http://www.w3.org/2001/XMLSchema#Name</tt>), short name: <tt>Name</tt></li>
<li><tt>xs:NCName</tt> (<tt>http://www.w3.org/2001/XMLSchema#NCName</tt>), short name: <tt>NCName</tt></li>
<li><tt>xs:NMTOKEN</tt> (<tt>http://www.w3.org/2001/XMLSchema#NMTOKEN</tt>), short name: <tt>NMTOKEN</tt></li>
<li><tt>xs:time</tt> (<tt>http://www.w3.org/2001/XMLSchema#time</tt>), short name: <tt>time</tt></li>
</ul>
<p>The lexical spaces of the above symbol spaces are defined in the document [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].</p>
<ul>
<li><tt>xs:dayTimeDuration</tt> (<tt>http://www.w3.org/2001/XMLSchema#dayTimeDuration</tt>), short name: <tt>dayTimeDuration</tt></li>
<li><tt>xs:yearMonthDuration</tt> (<tt>http://www.w3.org/2001/XMLSchema#yearMonthDuration</tt>), short name: <tt>yearMonthDuration</tt></li>
</ul>
<p>These two symbol spaces represent two subtypes of the XML Schema datatype <tt>xs:duration</tt>. The lexical spaces of the above symbol spaces are defined in the document [<a href="#ref-xdm" title="">XDM</a>].</p>
<ul>
<li><span class="anchor" id="rdf-PlainLiteral-space"><tt>rdf:PlainLiteral</tt></span> (<tt>http://www.w3.org/1999/02/22-rdf-syntax-ns#text</tt>), short name: <tt>text</tt>.</li>
</ul>
<p>The <tt>rdf:PlainLiteral</tt> symbol space represents text strings with a language tag attached. The lexical space of <tt>rdf:PlainLiteral</tt> is defined in the document [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].</p>
<ul>
<li><span id="rif-xmlliteral-space"><span class="anchor" id="rdf-xmlliteral-space"><tt>rdf:XMLLiteral</tt></span></span> (<tt>http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral</tt>), short name: <tt>XMLLiteral</tt>.
</li>
</ul>
<p>The <tt>rdf:XMLLiteral</tt> symbol space represents XML content. The lexical space of <tt>rdf:XMLLiteral</tt> is defined in the document [<a href="#ref-rdf-concepts" title="">RDF-CONCEPTS</a>].</p>
<ul>
<li><span class="anchor" id="rif-iri-space"><tt>rif:iri</tt></span> (<tt>http://www.w3.org/2007/rif#iri</tt>), for <i><b>internationalized resource identifiers</b></i> or <i><b>IRI</b></i>s.
</li>
</ul>
<p>Constants in the <tt>rif:iri</tt> symbol space are intended to be used in a way similar to RDF resources [<a href="#ref-rdf-schema" title="">RDF-SCHEMA</a>]. The lexical space consists of all absolute IRIs as specified in [<a href="#ref-rfc-3987" title="">RFC-3987</a>]; it is unrelated to the XML primitive type <tt>xs:anyURI</tt>.</p>
<ul>
<li><span class="anchor" id="rif-local-space"><tt>rif:local</tt></span> (<tt>http://www.w3.org/2007/rif#local</tt>), for constant symbols that are not visible outside of the RIF document in which they occur.</li>
</ul>
<p>Constants in the <tt>rif:local</tt> symbol space are local to the RIF documents in which they occur. This means that occurrences of the same <tt>rif:local</tt> constant in different documents are viewed as unrelated distinct constants, but occurrences of the same <tt>rif:local</tt> constant in the same document must refer to the same object. The lexical space of <tt>rif:local</tt> is the same as the lexical space of <tt>xs:string</tt>.</p>
<p><br />
</p>
<p>Note that, by the associated lexical space, not all Unicode strings are syntactically valid lexical parts for all symbol spaces. That is, for instance, <tt>"1.2"^^xs:decimal</tt> and <tt>"1"^^xs:integer</tt> are syntactically valid constant because 1.2 and 1 are members of the lexical space of symbol spaces <tt>xs:decimal</tt> and <tt>xs:integer</tt>, respectively. On the other hand, <tt>"a+2"^^xs:decimal</tt> is not a syntactically valid constant, since <tt>a+2</tt> is not part of the lexical space of <tt>xs:decimal</tt>.</p>
<p>We will often refer to constant symbols that come from a particular symbol space, <tt>X</tt>, as <tt>X</tt> <i><b>constants</b></i>, where <tt>X</tt> is the (short) name of the respective symbol space. For instance, the constants in the symbol space <tt>rif:iri</tt> will be referred to as <i><b>IRI constants</b></i> or <tt>rif:iri</tt> <i><b>constants</b></i> and the constants found in the symbol space <tt>rif:local</tt> as <i><b>local constants</b></i>
or <tt>rif:local</tt> <i><b>constants</b></i>.</p>
<a id="Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax" name="Shortcuts_for_Constants_in_RIF.27s_Presentation_Syntax"></a><h3> <span class="mw-headline">2.2.2 <span class="anchor" id="sec-shortcuts-constants">Shortcuts for Constants in RIF's Presentation Syntax</span> </span></h3>
<p>Besides the basic notion
</p>
<p><tt>"<i>literal</i>"^^&lt;<i>identifier</i>&gt;</tt></p>
<p>RIF's presentation syntax introduces several shortcuts for particular symbol spaces, in order to make the presentation syntax more readable. RIF's presentation syntax for constants is defined by the following EBNF.
</p>
<pre> ANGLEBRACKIRI&nbsp;::= <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF" title="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF">IRI_REF</a>
SYMSPACE &nbsp;::= ANGLEBRACKIRI | CURIE
CURIE &nbsp;::= <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN">PNAME_LN</a> | <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS">PNAME_NS</a>
Const &nbsp;::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
CONSTSHORT &nbsp;::= ANGLEBRACKIRI // <i><b>shortcut for</b></i> "..."^^rif:iri
| CURIE // <i><b>shortcut for</b></i> "..."^^rif:iri
| '"' UNICODESTRING '"' // <i><b>shortcut for</b></i> "..."^^xs:string
| <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral" title="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral">NumericLiteral</a> // <i><b>shortcut for</b></i> "..."^^xs:integer,xs:decimal,xs:double
| '_' <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCName</a> // <i><b>shortcut for</b></i> "..."^^rif:local
| '"' UNICODESTRING '"' '@' <a class="external text" href="http://tools.ietf.org/html/bcp47#section-2.1" title="http://tools.ietf.org/html/bcp47#section-2.1">langtag</a> // <i><b>shortcut for</b></i> "...@..."^^rdf:PlainLiteral
</pre>
<p>The EBNF grammar relies on reuse of nonterminals defined in the following grammar productions from other documents:
</p>
<ul>
<li><tt>IRI_REF</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF" title="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF">http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF</a></li>
<li><tt>PNAME_LN</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN">http://www.w3.org/TR/rdf-sparql-query/#rPNAME_LN</a></li>
<li><tt>PNAME_NS</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS" title="http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS">http://www.w3.org/TR/rdf-sparql-query/#rPNAME_NS</a></li>
<li><tt>NumericLiteral</tt>, cf. <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral" title="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral">http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral</a></li>
<li><tt>NCName</tt>, cf. <a class="external free" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName</a></li>
<li><tt>UNICODESTRING</tt>, any Unicode string where quotes are escaped and additionally all the other escape sequences defined in <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#grammarEscapes" title="http://www.w3.org/TR/rdf-sparql-query/#grammarEscapes">http://www.w3.org/TR/rdf-sparql-query/#grammarEscapes</a> and <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/#codepointEscape" title="http://www.w3.org/TR/rdf-sparql-query/#codepointEscape">http://www.w3.org/TR/rdf-sparql-query/#codepointEscape</a> are allowed.</li>
<li><tt>langtag</tt>, cf. [<a href="#ref-bcp-47" title="">BCP-47</a>]</li>
</ul>
<p>In this grammar, <tt>CURIE</tt> stands for <i>compact IRIs</i> [<a href="#ref-curie" title="">CURIE</a>], which
are used to abbreviate symbol space IRIs. For instance, one can write <tt>"http://www.example.org"^^rif:iri</tt> instead of <tt>"http://www.example.org"^^&lt;http://www.w3.org/2007/rif#iri&gt;</tt>, where <tt>rif</tt> is a prefix defined in Section <a href="#sec-base" title="">Base and Prefix Directives</a>.
</p>
<p>Apart from compact IRIs, there exist convenient shortcut notations for constants in specific symbol spaces, namely for constants in the symbol spaces <tt>rif:iri</tt>, <tt>xs:string</tt>, <tt>xs:integer</tt>, <tt>xs:decimal</tt>, <tt>xs:double</tt>, and <tt>rif:local</tt>:</p>
<ul>
<li>
<p>Constants in the the symbol space <tt>rif:iri</tt> can be abbreviated in two ways, either by simply using an absolute or relative IRI enclosed in angle brackets, or by writing a compact IRI. The symbol space identifier is dropped in both of these alternatives. For instance, <tt>&lt;http://www.example.org/xyz&gt;</tt> is a valid abbreviation for <tt>"http://www.example.org/xyz"^^rif:iri</tt>, and <tt>ex:xyz</tt> is a valid abbreviation for this constant, if the directive</p>
<p>
<tt>Prefix(ex &lt;http://www.example.org/&gt; )</tt>
</p>
<p>is present in the RIF document in question.</p>
</li>
<li>
Constants in the symbol space <tt>xs:string</tt> can be abbreviated by simply using quoted strings, i.e. <tt>"My String!"</tt> is a valid abbreviation for the constant <tt>"My String!"^^xs:string</tt> (which in turn is itself an abbreviation for <tt>"My String!"^^&lt;http://www.w3.org/2001/XMLSchema#string&gt;</tt>).
</li>
<li>Numeric constants can be abbreviated using the grammar rules for <a class="external text" href="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral" title="http://www.w3.org/TR/rdf-sparql-query/#rNumericLiteral">NumericLiteral</a>s from the [<a href="#ref-sparql" title="">SPARQL</a>] grammar: Integers can be written directly (without quotation marks and explicit symbol space identifier) and are interpreted as constants in the symbol space <tt>xs:integer</tt>; decimal numbers for which there is '.' in the number but no exponent are interpreted as constants in the symbol space <tt>xs:decimal</tt>; and numbers with exponents are interpreted as <tt>xs:double</tt>. For instance, one could use <tt>1.2</tt> and <tt>1</tt> as shortcuts for <tt>"1.2"^^xs:decimal</tt> and <tt>"1"^^xs:integer</tt>, respectively. However, there is no shortcut for <tt>"1"^^xs:decimal</tt>.
</li>
<li>The shortcut notation for <tt>rif:local</tt> applies to only a subset of the lexical space of syntactically valid lexical parts of constants in this symbol space: We allow "_"-prefixed Unicode strings which are also valid XML <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCName</a>s as defined in [<a href="#ref-xml-ns" title="">XML-NS</a>]. For other constants in the <tt>rif:local</tt> symbol space one has to use the long notation.
That is, for instance, <tt>_myLocalConstant</tt> is a valid abbreviation for the constant <tt>"myLocalConstant"^^rif:local</tt>, whereas <tt>"http://www.example.org"^^rif:local</tt> cannot be abbreviated.
</li>
</ul>
<a id="Relative_IRIs" name="Relative_IRIs"></a><h3> <span class="mw-headline">2.2.3 Relative IRIs </span></h3>
<p>
Relative IRIs in RIF documents are resolved with respect to the <i><b>base IRI</b></i>. Relative IRIs are combined with base IRIs as per <a class="external text" href="http://www.ietf.org/rfc/rfc3986.txt" title="http://www.ietf.org/rfc/rfc3986.txt">Uniform Resource Identifier (URI): Generic Syntax</a> [<a href="#ref-rfc-3986" title="">RFC-3986</a>] using only the basic algorithm in Section 5.2. Neither Syntax-Based Normalization nor Scheme-Based Normalization (described in Sections 6.2.2 and 6.2.3 of RFC-3986) are performed. Characters additionally allowed in IRI references are treated in the same way that unreserved characters are treated in URI references, per Section 6.5 of <a class="external text" href="http://www.ietf.org/rfc/rfc3987.txt" title="http://www.ietf.org/rfc/rfc3987.txt">Internationalized Resource Identifiers (IRIs)</a> [<a href="#ref-rfc-3987" title="">RFC-3987</a>].
</p>
<p>
Base IRIs are specified using the <tt>Base</tt> directive described in Section <a href="#sec-base" title="">Base and Prefix Directives</a>. At most one base directive per document is allowed. In the XML syntax, base IRIs are specified using the attribute <tt>xml:base</tt>.
</p>
<p>
For instance, the constant &lt;./xyz&gt; or "./xyz"^^rif:iri are both valid abbreviations in RIF for the constant <tt>http://www.example.org/xyz"^^rif:iri</tt>, if the following directive is present in the document:
</p>
<p>
<tt>Base(&lt;http://www.example.org&gt;)</tt>
</p>
<a id="Datatypes" name="Datatypes"></a><h2> <span class="mw-headline">2.3 <span class="anchor" id="sec-data-types">Datatypes</span> </span></h2>
<p>Datatypes in RIF are symbol spaces which have special semantics. That is, each datatype is characterized by a fixed lexical space, value space and lexical-to-value-mapping.
</p><p><span class="anchor" id="def-datatype"></span>
<b>Definition (Datatype).</b>
A <i><b>datatype</b></i> is a symbol space that has
</p>
<ul><li> an associated set, called the <i><b>value space</b></i>, and
</li><li> a mapping from the lexical space of the symbol space to the value space, called <i><b>lexical-to-value-space mapping</b></i>. &nbsp;&nbsp;
</li></ul>
<p>Semantic structures are always defined with respect to a particular set of datatypes, denoted by <i><b>DTS</b></i>. In a concrete dialect, <i><b>DTS</b></i> always includes the datatypes supported by that dialect. <span class="anchor" id="def-required-datatypes">RIF dialects are expected to support the following datatypes. However, RIF dialects may include additional datatypes. Subitems in the following lists indicate <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#derivation" title="http://www.w3.org/TR/xmlschema11-2/#derivation">derived</a> datatypes.</span>
</p>
<ul><li> <tt>xs:anyURI</tt>
</li><li> <tt>xs:base64Binary</tt>
</li><li> <tt>xs:boolean</tt>
</li><li> <tt>xs:date</tt>
</li><li> <tt>xs:dateTime</tt>
<ul><li> <tt>xs:dateTimeStamp</tt>
</li></ul>
</li><li> <tt>xs:double</tt>
</li><li> <tt>xs:float</tt>
</li><li> <tt>xs:hexBinary</tt>
</li><li> <tt>xs:decimal</tt>
<ul><li> <tt>xs:integer</tt>
<ul><li> <tt>xs:long</tt>
<ul><li> <tt>xs:int</tt>
<ul><li> <tt>xs:short</tt>
<ul><li> <tt>xs:byte</tt>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:nonNegativeInteger</tt>
<ul><li> <tt>xs:positiveInteger</tt>
</li><li> <tt>xs:unsignedLong</tt>
<ul><li> <tt>xs:unsignedInt</tt>
<ul><li> <tt>xs:unsignedShort</tt>
<ul><li> <tt>xs:unsignedByte</tt>
</li></ul>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:nonPositiveInteger</tt>
<ul><li> <tt>xs:negativeInteger</tt>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:string</tt>
<ul><li> <tt>xs:normalizedString</tt>
<ul><li> <tt>xs:token</tt>
<ul><li> <tt>xs:language</tt>
</li><li> <tt>xs:Name</tt>
<ul><li> <tt>xs:NCName</tt>
</li></ul>
</li><li> <tt>xs:NMTOKEN</tt>
</li></ul>
</li></ul>
</li></ul>
</li><li> <tt>xs:time</tt>
</li><li> <tt>xs:dayTimeDuration</tt>
</li><li> <tt>xs:yearMonthDuration</tt>
</li><li> <tt>rdf:PlainLiteral</tt>
</li><li> <tt>rdf:XMLLiteral</tt>
</li></ul>
<p>Their value spaces and the lexical-to-value-space mappings are defined as follows:
</p>
<ul><li> For the XML Schema datatypes of RIF, namely all RIF datatypes within the <tt>xs:</tt> namespace, except <tt>xs:dayTimeDuration</tt> and <tt>xs:yearMonthDuration</tt>, the value spaces and the lexical-to-value-space mappings are defined in the XML Schema specification [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].
</li><li> The value spaces and the lexical-to-value-space mappings for the datatypes <tt>xs:dayTimeDuration</tt> and <tt>xs:yearMonthDuration</tt> are defined in the XQuery 1.0 and XPath 2.0 Data Model [<a href="#ref-xdm" title="">XDM</a>].
</li><li> The value space and the lexical-to-value-space mapping for <tt>rdf:PlainLiteral</tt> are defined in the document [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].
</li><li> The value space and lexical-to-value-space mapping for the datatype <tt>rdf:XMLLiteral</tt> is defined in RDF [<a href="#ref-rdf-concepts" title="">RDF-CONCEPTS</a>].
</li></ul>
<a id="XML_Schema_Datatypes" name="XML_Schema_Datatypes"></a><h3> <span class="mw-headline">2.3.1 XML Schema Datatypes </span></h3>
<p>As of the publication of this document, XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] is not yet a W3C Recommendation. Both the RIF Working Group and the XML Schema Working Group are confident that there will be only minor changes before it becomes a W3C Recommendation. In order to take advantage of the anticipated corrections and new features sooner, while also providing stability in case the specification does not advance as expected, conformance to RIF as it relates to XML Schema Datatypes is defined as follows:
</p>
<ul><li> If [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] becomes a W3C Recommendation, all references in RIF to XML Schema Datatype features will be normative references to the 1.1 Recommendation.
</li><li> Until that time, references in RIF to XML Schema Datatype features operate as follows:
<ul><li> If <a class="external text" href="http://www.w3.org/TR/xmlschema-2/" title="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2: Datatypes Second Edition</a> (XSD 1.0) defines the features, then the reference is normative to the 1.0 definition;
</li><li> otherwise, the feature is optional in RIF and the reference is informative only.
</li></ul>
</li></ul>
<p>This "change in normative reference" is effective as of the publication of XSD 1.1 as a W3C Recommendation. However, W3C expects to publish a new edition of RIF Datatypes and Built-Ins 1.0 once XSD 1.1 becomes a Recommendation to update the reference explicitly.
</p>
<a id="Syntax_and_Semantics_of_Built-ins" name="Syntax_and_Semantics_of_Built-ins"></a><h1> <span class="mw-headline">3 Syntax and Semantics of Built-ins </span></h1>
<a id="Syntax__of_Built-ins" name="Syntax__of_Built-ins"></a><h2> <span class="mw-headline">3.1 Syntax of Built-ins </span></h2>
<p>A RIF built-in function or predicate is a special case of externally defined terms, which are defined in <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-terms" title="FLD">RIF Framework for Logic Dialects</a> and also reproduced in the direct definition of <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-terms" title="BLD">RIF Basic Logic Dialect</a> (RIF-BLD).
</p><p>In RIF's presentation syntax built-in predicates and functions are syntactically represented as external terms of the form:
</p>
<p><tt>'External' '(' Expr ')'</tt></p>
<p>where <tt>Expr</tt> is a positional term as defined in <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-terms" title="FLD">RIF Framework for Logic Dialects</a> (see also in <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-terms" title="BLD">RIF Basic Logic Dialect</a>). For RIF's normative syntax, see the <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#XML_Serialization_Framework" title="FLD">XML Serialization Framework </a> in <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a>, or, specifically for <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a>, see <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-xml-bld" title="BLD">XML Serialization Syntax for RIF-BLD</a>.
</p><p><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a> introduces the notion of an <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-formal-external-schema" title="FLD">external schema</a> to describe both the syntax and semantics of exernally defined terms. In the special case of a RIF built-in, external schemas have an especially simple form. A built-in named <tt>f</tt> that takes <tt>n</tt> arguments has the schema
</p>
<p><tt>(&nbsp;?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>; &nbsp; f(?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>) )</tt></p>
<p>Here <tt>f(?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>)</tt> is the actual positional term that is used to refer to the built-in (in expressions of the form <tt>External(f(?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>))</tt>) and <tt>?X<sub>1</sub> ...&nbsp;?X<sub>n</sub></tt> is the list of all variables in that term.
</p><p>Note that <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a> allows additional forms of built-ins, which includes named-argument terms.
</p><p>RIF-FLD defines a <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#sec-formal-external-schema" title="FLD">very general notion of external terms and schemas</a>, but RIF-BLD and the present document use more restricted notions.
For convenience, we present a complete definition of these restricted notions in <a href="#app-external-schema" title="">Appendix: Schemas for Externally Defined Terms</a>.
</p>
<a id="Semantics_of_Built-ins" name="Semantics_of_Built-ins"></a><h2> <span class="mw-headline">3.2 <span class="anchor" id="sec-semantics-builtin">Semantics of Built-ins</span> </span></h2>
<p>The semantics of external terms is defined using two mappings: <i><b>I</b></i><sub>external</sub> and <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>.
</p>
<ul>
<li>
<i><b>I</b></i><sub>external</sub>. This mapping takes an external schema, <tt>&sigma;</tt>, and returns a mapping, <i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>).
<p>
If <tt>&sigma;</tt> represents a built-in function, <i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>) must be that function.
</p>
<p>
For each built-in function with external schema <tt>&sigma;</tt>, the present document specifies the mapping <i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>).
</p>
</li>
<li>
<i><b>I</b></i><sub>truth</sub>. This mapping takes an element of the domain of interpretation and returns a truth value.
<p>
In RIF logical semantics, this mapping is used to assign truth values to formulas. In the special case of RIF built-ins, it is used to assign truth values to RIF built-in predicates. The built-in predicates can have the truth values <b>t</b> or <b>f</b> only.
</p>
<p>
For a built-in predicate with schema <tt>&sigma;</tt>, RIF-FLD and RIF-BLD require that the truth-valued mapping <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>) must agree with the specification of the corresponding built-in predicate.
</p>
<p>
For each RIF built-in predicate with schema <tt>&sigma;</tt>, the present document specifies <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>).
</p>
</li>
</ul>
<a id="List_of_RIF_Built-in_Predicates_and_Functions" name="List_of_RIF_Built-in_Predicates_and_Functions"></a><h1> <span class="mw-headline">4 List of RIF Built-in Predicates and Functions</span></h1>
<p>This section provides a catalogue defining the syntax and semantics of a list of built-in predicates and functions in RIF. For each built-in, the following is defined:
</p>
<ol>
<li>
The <i><b>name</b></i> of the built-in.
</li>
<li>
The <i><b>external schema</b></i> of the built-in.
</li>
<li>
For a built-in function, how it maps its arguments into a result.
<p>
As explained in Section <a href="#sec-semantics-builtin" title="">Semantics of Built-ins</a>, this corresponds to the mapping <i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>) in the formal semantics of <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#def-fld-truth" title="FLD">RIF-FLD</a> and <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-bld-truth" title="BLD">RIF-BLD</a>, where <tt>&sigma;</tt> is the external schema of the built-in.
</p>
</li>
<li>
For a built-in predicate, its truth value when the arguments are substituted with values in the domain.
<p>
As explained in Section <a href="#sec-semantics-builtin" title="">Semantics of Built-ins</a>, this corresponds to the mapping <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>) in the formal semantics of <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/#def-fld-truth" title="FLD">RIF-FLD</a> and <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-bld-truth" title="BLD">RIF-BLD</a>, where <tt>&sigma;</tt> is the external schema of the built-in.
</p>
</li>
<li>
The <i><b>domains</b></i> for the arguments of the built-in.
<p>
Typically, built-in functions and predicates are defined over the value spaces of appropriate datatypes, i.e. the domains of the arguments. When an argument falls outside of its domain, it is understood as an error. Since this document defines a model-theoretic semantics for RIF built-ins, which does not support the notion of an error, the definitions leave the values of the built-in predicates and functions <b>unspecified</b> in such cases. This means that if one or more of the arguments is not in its domain, the value of <i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>)(<tt>a<sub>1</sub> ... a<sub>n</sub></tt>) is unspecified. In particular, this
means it can vary from one implementation to another. Similarly, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(<tt>&sigma;</tt>)(<tt>a<sub>1</sub> ... a<sub>n</sub></tt>) is unspecified when an argument is not in its domain.
</p>
<p>
This indeterminacy in case of an error implies that applications should not make any assumptions about the values of built-ins in such situations. Implementations are even allowed to abort in such cases and the only safe way to communicate rule sets that contain built-ins among RIF-compliant systems is to use <a href="#sec-guard" title="">datatype guards</a>.
</p>
</li>
</ol>
<p><br />
Many built-in functions and predicates described below are adapted from [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] and, when appropriate, we will refer to the definitions in that specification in order to avoid copying them. The differences from the original [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] include the handling of errors, the differentiation between predicates and functions, and a few specific differences noted in the definitions below.
</p><p><br />
</p>
<a id="Predicates_for_all_Datatypes" name="Predicates_for_all_Datatypes"></a><h2> <span class="mw-headline">4.1 <span class="anchor" id="sec-guard">Predicates for all Datatypes</span> </span></h2>
<a id="Comparison_for_Literals" name="Comparison_for_Literals"></a><h3> <span class="mw-headline">4.1.1 Comparison for Literals </span></h3>
<p>RIF supports identity for typed literals through the "=" predicate in all dialects that extend RIF-Core. Identity for typed literals is defined as being the same point in the value space for that type. Certain datatypes use more specific notions of equality that allow for multiple points in the value space to be considered equal. For each datatype specific notion of equality we refer to the supported predicate for that datatype.
</p><p>Since the basic RIF dialects do not support negation, dialects that extend RIF-Core define a built-in for checking the non-identity of two typed literals.
</p>
<a id="pred:literal-not-identical" name="pred:literal-not-identical"></a><h4> <span class="mw-headline">4.1.1.1 <tt>pred:literal-not-identical</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:literal-not-identical(
&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
This predicate does not depend on a specific domain.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt>
&omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>
?arg<sub>2</sub>; pred:literal-not-identical(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if s<sub>1</sub> and s<sub>2</sub> are both in the value spaces of some datatypes in <a href="#sec-data-types" title=""><i><b>DTS</b></i></a> and s<sub>1</sub> &ne; s<sub>2</sub>. This includes the case where s<sub>1</sub> and s<sub>2</sub> are of disjoint types.</p>
<p>
<i><b>I</b></i><sub>truth</sub><tt>
&omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>
?arg<sub>2</sub>; pred:literal-not-identical(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>f</b> otherwise. This includes the case where s<sub>1</sub> or s<sub>2</sub> are not in the value spaces of datatypes in <a href="#sec-data-types" title=""><i><b>DTS</b></i></a>. </p>
</li>
</ul>
<a id="Guard_Predicates_for_Datatypes" name="Guard_Predicates_for_Datatypes"></a><h2> <span class="mw-headline">4.2 Guard Predicates for Datatypes </span></h2>
<p>RIF defines guard predicates for all datatypes in Section <a href="#Datatypes" title="">Datatypes</a>.
</p>
<ul>
<li>
<em>Schema</em>: The schemas for these predicates have the general form
<p><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-<i>DATATYPE</i> (&nbsp;?arg<sub>1</sub> ) )
</tt></p>
<p>Here, <i>DATATYPE</i> is the <a href="#def-shortname" title="">short name</a> for a datatype. For instance, we use <tt>pred:is-literal-string</tt> for the guard predicate for <tt>xs:string</tt>, <tt>pred:is-literal-PlainLiteral</tt> for the guard predicate for <tt>rdf:PlainLiteral</tt>, or <tt>pred:is-literal-XMLLiteral</tt> for the guard predicate for<tt>rdf:XMLLiteral</tt>. Parties defining their own datatypes to be used in RIF exchanged rules may define their own guard predicates for these datatypes. Labels used for such additional guard predicates for datatypes not mentioned in the present document MAY follow a similar naming convention where applicable without creating ambiguities with predicate names defined in the present document. Particularly, upcoming W3C specifications MAY - but 3rd party dialects MUST NOT - reuse the <tt>pred:</tt> namespace for such guard predicates.</p>
</li>
<li>
<em>Domain</em>:
<p>
Guard predicates do not depend on a specific domain.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>; pred:is-literal-<i>DATATYPE</i> (&nbsp;?arg<sub>1</sub> ) )(s<sub>1</sub>) = <b>t</b> if and only if s<sub>1</sub> is in the value space of <i>DATATYPE</i> and <b>f</b> otherwise.</p>
</li>
</ul>
<p>Accordingly, the following schemas are defined.
</p>
<ul>
<li><span class="anchor" id="is-literal-anyURI"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-anyURI(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-base64Binary"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-base64Binary(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-boolean"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-boolean(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-date"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-date (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-dateTime">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-dateTime (&nbsp;?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li>
<span class="anchor" id="is-literal-dateTimeStamp">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-dateTimeStamp (&nbsp;?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li><span class="anchor" id="is-literal-double"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-double (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-float"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-float (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-hexBinary"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-hexBinary (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-decimal">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-decimal (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-integer"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-integer(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-long"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-long&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-int">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-int(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-short"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-short(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-byte"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-byte(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-nonNegativeInteger"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-nonNegativeInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-positiveInteger">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-positiveInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-unsignedLong">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-unsignedLong(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-unsignedInt">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-unsignedInt(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-unsignedShort">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-unsignedShort(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-unsignedByte">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-unsignedByte(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-nonPositiveInteger"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-nonPositiveInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-negativeInteger"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-negativeInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-PlainLiteral"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-PlainLiteral (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-string"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-string (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-normalizedString"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-normalizedString (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-token">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-token (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-language">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-language (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-Name"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-Name (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-NCName">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-NCName (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-NMTOKEN">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-NMTOKEN (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-time"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-time (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-dayTimeDuration">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-dayTimeDuration (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-yearMonthDuration"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-yearMonthDuration (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-XMLLiteral"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-XMLLiteral (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
</ul>
<p>Future dialects may extend this list of guards to other datatypes, but
RIF does not require guards for all datatypes.
</p>
<a id="Negative_Guard_Predicates_for_Datatypes" name="Negative_Guard_Predicates_for_Datatypes"></a><h2> <span class="mw-headline">4.3 Negative Guard Predicates for Datatypes </span></h2>
<p>Likewise, RIF defines negative guard predicates for all datatypes in Section <a href="#Datatypes" title="">Datatypes</a>.
</p>
<ul>
<li>
<em>Schema</em>: The schemas for negative guards have the general form
<p><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-<i>DATATYPE</i> (&nbsp;?arg<sub>1</sub> ) )
</tt></p>
<p>Here, <i>DATATYPE</i> is the <a href="#def-shortname" title="">short name</a> for one of the datatypes mentioned in this document. For instance, we use <tt>pred:is-literal-not-String</tt> for the negative guard predicate for <tt>xs:string</tt>, <tt>pred:is-literal-not-PlainLiteral</tt> for the negative guard predicate for <tt>rdf:PlainLiteral</tt>, or <tt>pred:is-literal-not-XMLLiteral</tt> for the negative guard predicate for <tt>rdf:XMLLiteral</tt>. Parties defining their own datatypes to be used in RIF exchanged rules may define their own negative guard predicates for these datatypes. Labels used for such additional negative guard predicates for datatypes not mentioned in the present document MAY follow a similar naming convention where applicable without creating ambiguities with predicate names defined in the present document. Particularly, upcoming W3C specifications MAY, but 3rd party dialects MUST NOT reuse, the <tt>pred:</tt> namespace for such negative guard predicates.</p>
<p><br />
</p>
</li>
<li>
<em>Domain</em>:
<p>
Negative guard predicates do not depend on a specific domain.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-<i>DATATYPE</i> (&nbsp;?arg<sub>1</sub> ) )(s<sub>1</sub>) = <b>t</b> if and only if s<sub>1</sub> is in the value space of one of the datatypes in <a href="#sec-data-types" title=""><i><b>DTS</b></i></a> but not in the value space of the datatype with shortname <i>DATATYPE</i>, and <b>f</b> otherwise.</p>
</li>
</ul>
<p>Accordingly, the following schemas are defined.
</p>
<ul>
<li><span class="anchor" id="is-literal-not-anyURI"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-anyURI(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-base64Binary"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-base64Binary(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-boolean"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-boolean(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-date"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-date (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-dateTime">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-dateTime (&nbsp;?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li>
<span class="anchor" id="is-literal-not-dateTimeStamp">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-dateTimeStamp (&nbsp;?arg<sub>1</sub> ) )
</tt>
</span>
</li>
<li><span class="anchor" id="is-literal-not-double"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-double (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-float"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-float (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-hexBinary"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-hexBinary (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-decimal">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-decimal (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-integer"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-integer(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-long"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-long&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-int">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-int(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-short"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-short(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-byte"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-byte(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-nonNegativeInteger"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-nonNegativeInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-positiveInteger">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-positiveInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-unsignedLong">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-unsignedLong(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-unsignedInt">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-unsignedInt(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-unsignedShort">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-unsignedShort(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-unsignedByte">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-unsignedByte(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-nonPositiveInteger"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-nonPositiveInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-negativeInteger"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-negativeInteger(&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-PlainLiteral"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-PlainLiteral (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-string"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-string (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-normalizedString"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-normalizedString (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-token">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-token (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-language">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-language (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-Name"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-Name (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-NCName">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-NCName (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-NMTOKEN">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-NMTOKEN (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-time"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-time (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li><span class="anchor" id="is-literal-not-dayTimeDuration">
<tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-dayTimeDuration (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-yearMonthDuration"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-yearMonthDuration (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
<li>
<span class="anchor" id="is-literal-not-XMLLiteral"><tt>
(&nbsp;?arg<sub>1</sub>; pred:is-literal-not-XMLLiteral (&nbsp;?arg<sub>1</sub> ) )
</tt></span>
</li>
</ul>
<p>Future dialects may extend this list of negative guards to other datatypes, but
RIF does not require negative guards for all datatypes.
</p><p><i>Note:</i> The semantics of negative guards may be surprising. The is-literal-not-String guard essentially asks, "Is this a literal, <i>and</i> (if it is) is it something other than a String?" It could also be read as "Is this a decimal or a float or a double or a date or a dateTime, etc, [for every datatype except string]&nbsp;?". The negative guards are formulated like this to allow for rules which detect, for instance, some kinds of bad inputs, while still using the open world assumption of some RIF dialects.
</p><p><span class="anchor" id="sec-casts"></span>
</p>
<a id="Datatype_Conversion_and_Casting" name="Datatype_Conversion_and_Casting"></a><h2> <span class="mw-headline">4.4 Datatype Conversion and Casting </span></h2>
<p>In the following, we adapt several cast functions according to the conversions defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. Note that some of these conversions are only partially defined, which affects the domains of these cast functions.</p>
<p>Likewise we define a conversion predicate useful for converting between <tt>rif:iri</tt> constants and strings, as well as a predicate to check the datatype of a constant.</p>
<a id="Casting_to_XML_Schema_Datatypes" name="Casting_to_XML_Schema_Datatypes"></a><h3> <span class="mw-headline">4.4.1 Casting to XML Schema Datatypes </span></h3>
<p>The casting functions in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] define mappings from source values <i>SV</i>, which are data values, annotated with source types <i>ST</i>, to target values <i>TV</i>, annotated with target types <i>TT</i>. The data values <i>V</i> we consider are not necessarily explicitly annotated with types. However, one can view the datatypes <i>D</i><sub>1</sub>,...,<i>D</i><sub>n</sub> whose value spaces include a data value <i>V</i> as the types of <i>V</i>. We assume in the following that any of the data types <i>D</i><sub>1</sub>,...,<i>D</i><sub>n</sub> is used as the annotation of the source value <i>SV</i>; the conversions in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] are defined equivalently for all such datatypes.
</p>
<ul>
<li>
<em>Schema</em>: The schemas for casting functions have the general form
<p><tt>
(&nbsp;?arg; <i>DATATYPE-IRI</i> (&nbsp;?arg ) )
</tt></p>
<p>Here, <i>DATATYPE-IRI</i> is the IRI identifying a datatype. For instance, we use <tt>xs:string(?V)</tt> for casting to <tt>xs:string</tt>. Parties defining their own datatypes to be used in RIF exchanged rules may define their own casting function for these datatypes. Labels used for such additional guard predicates for datatypes not mentioned in the present document MAY follow the same naming convention using the IRI identifying a datatype as function name for the casting function.</p>
</li>
<li>
<em>Domain</em>:
<p>The domain for casting functions to XML schema datatypes depends on where the casting is defined according to <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]:
for all the casting functions to XML schema datatypes the domain of <tt>?arg</tt> is at most the set of all data values in the value spaces of XML schema datatypes such that the conversion to <i>DATATYPE-IRI</i> does not raise a type error or an invalid value for cast/constructor error <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFORG0001" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFORG0001">[err:FORG0001</a>] or an invalid lexical value error <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFOCA0002" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#ERRFOCA0002">[err:FOCA0002</a>] according to <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
We will mention additional constraints on the domain for casts to specific datatypes below separately.
</p>
</li>
<li>
<em>Mapping:</em> The mappings for casting functions to XML schema datatypes are defined as follows:
<p>
<i><b>I</b></i><sub>external</sub>(&nbsp;?arg; <i>DATATYPE-IRI</i> ( <tt>?arg</tt> ) )(<i>SV</i>) = <i>TV</i>, which is a value the value space of the datatype with IRI <i>DATATYPE-IRI</i> in derived from a type of <i>SV</i>, as defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-primitive-to-primitive">Section 17.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. We will mention additional constraints on the mappings for casts to specific datatypes below separately.</p>
</li>
</ul>
<p>Accordingly, the following schemas are defined:
</p>
<ul>
<li><span class="anchor" id="func-anyURI"><tt> (&nbsp;?arg; xs:anyURI (&nbsp;?arg ) ) </tt></span>
<p>
<em>Additional restriction on the Domain</em>:
Note that unlike [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] the extent to which an implementation validates the lexical form of <tt>xs:anyURI</tt>
is not implementation dependent, but RIF requires all lexical forms of <tt>xs:anyURI</tt> appearing as constants in the <tt>xs:string</tt> symbol space to be
castable to <tt>xs:anyURI</tt>.
</p>
</li>
<li><span class="anchor" id="func-base64Binary"><tt>(&nbsp;?arg; xs:base64Binary(&nbsp;?arg ) )</tt></span>
</li>
<li><span class="anchor" id="func-boolean"><tt>(&nbsp;?arg; xs:boolean(&nbsp;?arg ) )
</tt></span>
</li>
<li><span class="anchor" id="func-date"><tt>(&nbsp;?arg; xs:date (&nbsp;?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this function is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:date</tt> does not result in a value from the <tt>xs:date</tt> value space outside what [<a class="external free" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming</a>
minimal conformance] as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>]
requires for <tt>xs:date</tt>.
</p>
</li>
<li><span class="anchor" id="func-dateTime"><tt>(&nbsp;?arg; xs:dateTime (&nbsp;?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this functions is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:date</tt> does not result in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for <tt>xs:dateTime</tt>.
</p>
</li>
<li><span class="anchor" id="func-dateTimeStamp"><tt>(&nbsp;?arg; xs:dateTimeStamp (&nbsp;?arg ) )</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
Since <tt>xs:dateTimeStamp</tt> is a derived type of <tt>dateTime</tt> the domain if this function is the same as for casting to <tt>xs:dateTime</tt>
with the additional restriction that casting to <tt>xs:dateTimeStamp</tt> is only defined for values such that the conversion to <tt>xs:dateTime</tt> has a non-empty
timezone component.
</p>
</li>
<li><span class="anchor" id="func-double"><tt>(&nbsp;?arg; xs:double (&nbsp;?arg ) )</tt></span>
</li>
<li><span class="anchor" id="func-float"><tt>(&nbsp;?arg; xs:float (&nbsp;?arg ) )</tt></span>
</li>
<li>
<span class="anchor" id="func-hexBinary"><tt>(&nbsp;?arg; xs:hexBinary (&nbsp;?arg ) )</tt></span>
</li>
<li>
<span class="anchor" id="func-decimal">
<tt>
(&nbsp;?arg; xs:decimal (&nbsp;?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this functions is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:decimal</tt> does not result in a value from the <tt>xs:decimal</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for <tt>xs:decimal</tt>.
</p>
</li>
<li>
<span class="anchor" id="func-integer"><tt>
(&nbsp;?arg; xs:integer(&nbsp;?arg ) )
</tt></span>
<p>
<em>Additional restriction on the Domain</em>:
The domain where this functions is specified in RIF is further restricted to data values in the value spaces of XML schema datatypes such that the conversion to
<tt>xs:integer</tt> does not result in a value from the <tt>xs:integer</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for <tt>xs:integer</tt>.
</p>
</li>
<li>
<span class="anchor" id="func-long"><tt>
(&nbsp;?arg; xs:long&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-int"><tt>
(&nbsp;?arg; xs:int(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-short"><tt>
(&nbsp;?arg; xs:short(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-byte"><tt>
(&nbsp;?arg; xs:byte(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-nonNegativeInteger"><tt>
(&nbsp;?arg; xs:nonNegativeInteger(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-positiveInteger"><tt>
(&nbsp;?arg; xs:positiveInteger(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedLong"><tt>
(&nbsp;?arg; xs:unsignedLong(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedInt"><tt>
(&nbsp;?arg; xs:unsignedInt(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedShort"><tt>
(&nbsp;?arg; xs:unsignedShort(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-unsignedByte"><tt>
(&nbsp;?arg; xs:unsignedByte(&nbsp;?arg ) )
</tt></span>
</li>
<li><span class="anchor" id="func-nonPositiveInteger">
<tt>
(&nbsp;?arg; xs:nonPositiveInteger(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-negativeInteger"><tt>
(&nbsp;?arg; xs:negativeInteger(&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-string"><tt>
(&nbsp;?arg; xs:string (&nbsp;?arg ) )
</tt></span>
<p>
<em>Additional restrictions on the Domain</em>:
</p>
<ol>
<li>Note that conversions from <tt>xs:float</tt> and <tt>xs:double</tt> to <tt>xs:string</tt> according to <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-strings" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#casting-from-strings">Section 17.1.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]
may vary between implementations. Thus, the domain where this functions is specified in RIF is further restricted for data values in the value spaces of
XML schema datatypes such that the conversion to
<tt>xs:string</tt> is non-ambiguous in a <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimally conformant</a> implementation as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].
</li>
<li>RIF additionally includes values in the <tt>rdf:XMLLiteral</tt> value space to the domain.
</li>
</ol>
<p>
<em>Additional remark on the mapping</em>:<br />
If <i>SV</i> is a value in the value space of <tt>rdf:XMLLiteral</tt>, then
<i><b>I</b></i><sub>external</sub>(&nbsp;?arg; <tt>xs:string</tt>( <tt>?arg</tt> ) )(<i>SV</i>) = <i>TV</i> such that
<i>TV</i> is the string in the lexical space of rdf:XMLLiteral correspoding to <i>SV</i> (cf. [<a href="#ref-rdf-concepts" title="">RDF-CONCEPTS</a>]).
</p>
</li>
<li>
<span class="anchor" id="func-normalizedString"><tt>
(&nbsp;?arg; xs:normalizedString (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-token"><tt>
(&nbsp;?arg; xs:token (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-language"><tt>
(&nbsp;?arg; xs:language (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-Name"><tt>
(&nbsp;?arg; xs:Name (&nbsp;?arg ) )
</tt></span>
</li>
<li><span class="anchor" id="func-NCName"><tt>
(&nbsp;?arg; xs:NCName (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-NMTOKEN"><tt>
(&nbsp;?arg; xs:NMTOKEN (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-time"><tt>
(&nbsp;?arg; xs:time (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-dayTimeDuration"><tt>
(&nbsp;?arg; xs:dayTimeDuration (&nbsp;?arg ) )
</tt></span>
</li>
<li>
<span class="anchor" id="func-yearMonthDuration"><tt>
(&nbsp;?arg; xs:yearMonthDuration (&nbsp;?arg ) )
</tt></span>
</li>
</ul>
<a id="Casting_to_rdf:XMLLiteral" name="Casting_to_rdf:XMLLiteral"></a><h3> <span class="mw-headline">4.4.2 Casting to <tt>rdf:XMLLiteral</tt> </span></h3>
<ul>
<li>
<em>Schema</em>:
<p>
<tt> (&nbsp;?arg; rdf:XMLLiteral (&nbsp;?arg ) ) </tt>
</p>
</li>
<li>
<em>Domain</em>:
<p>
The intersection of the value space of <tt>xs:string</tt> with the lexical space of <tt>rdf:XMLLiteral</tt>, i.e. an <tt>xs:string</tt> can be cast to <tt>rdf:XMLLiteral</tt> if and only if its value is in the lexical space of <tt>rdf:XMLLiteral</tt> as defined in <a class="external text" href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">Resource Description Framework (RDF): Concepts and Abstract Syntax</a>
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; xs:XMLLiteral (&nbsp;?arg ) )(s) = s'
such that s' is the XMLLiteral corresponding to the given string s.</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Casting_to_rdf:PlainLiteral" name="Casting_to_rdf:PlainLiteral"></a><h3> <span class="mw-headline">4.4.3 Casting to <tt>rdf:PlainLiteral</tt> </span></h3>
<ul>
<li>
<em>Schema</em>:
<p>
<tt> (&nbsp;?arg; rdf:PlainLiteral (&nbsp;?arg ) ) </tt>
</p>
</li>
<li>
<em>Domain</em>:
<p>The union of the value spaces of XML schema datatypes.
</p>
</li>
<li>
<em>Mapping:</em>
<p>Since the value space of <tt>xs:string</tt> is included in the value space of <tt>rdf:PlainLiteral</tt>, the mapping is defined in precisely the same way as for <a href="#func-string" title="">casts to <tt>xs:string</tt></a>.</p>
</li>
</ul>
<a id="pred:iri-string" name="pred:iri-string"></a><h3> <span class="mw-headline">4.4.4 <tt>pred:iri-string</tt> </span></h3>
<p>Conversions from <tt>rif:iri</tt> to <tt>xs:string</tt> and vice versa cannot be defined by the casting functions as above since <tt>rif:iri</tt> is not a datatype with a well-defined value space.
</p><p>To this end, since conversions from IRIs (resources) to strings are a needed feature, for instance, for conversions between RDF formats (see example below), we introduce a built-in predicate which supports such conversions.
</p>
<ul>
<li>
<em>Schema</em>:
<p>
<tt> (&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:iri-string (&nbsp;?arg<sub>1</sub>,&nbsp;?arg<sub>2</sub> ) ) </tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>
The first argument is not restricted by a specific domain, the second argument is the value space of <tt>xs:string</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:iri-string (&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(iri<sub>1</sub> str<sub>1</sub>) = <b>t</b> if and only if str<sub>1</sub> is a string in the lexical space of <tt>rif:iri</tt> and iri<sub>1</sub> is an element of the domain such that <i><b>I</b></i>( <tt>"</tt>str<sub>1</sub><tt>"^^rif:iri</tt> ) = iri<sub>1</sub> holds in the current interpretation.
</p>
<p>
Note that this definition restricts allowed RIF interpretations in such a way that the interpretation of <tt>pred:iri-string</tt> always needs to comply with respect to the symbols in the <tt>rif:iri</tt> symbol space for the first argument and elements of the <tt>xs:string</tt> value space for the second argument. The truth value of the predicate is left unspecified for other elements of the domain.
</p>
<p>
This predicate could be usable, for instance, to map telephone numbers between an RDF Format for vCard (<a class="external free" href="http://www.w3.org/TR/vcard-rdf" title="http://www.w3.org/TR/vcard-rdf">http://www.w3.org/TR/vcard-rdf</a>) and FOAF (<a class="external free" href="http://xmlns.com/foaf/0.1/" title="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>). vCard stores telephone numbers as string literals, whereas FOAF uses resources, i.e., URIs with the tel: URI-scheme. So, a mapping from FOAF to vCard would need to convert the <tt>tel:</tt> URI to a string and then cut off the first four characters ("tel:"). Such a mapping expressed in RIF could involve e.g. a rule as follows:</p>
<pre> ...
Prefix( VCard &lt;<a class="external free" href="http://www.w3.org/TR/vcard-rdf" title="http://www.w3.org/TR/vcard-rdf#">http://www.w3.org/TR/vcard-rdf#</a>&gt; )
Prefix( foaf &lt;<a class="external free" href="http://xmlns.com/foaf/0.1/" title="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</a>&gt; )
...
Forall&nbsp;?X&nbsp;?foafTelIri&nbsp;?foafTelString (
&nbsp;?X[ VCard:tel -&gt; External( func:substring(&nbsp;?foafTelString 4 ) ]&nbsp;:-
And (&nbsp;?X[ foaf:phone -&gt;&nbsp;?foafTelIri ]
External( pred:iri-string(&nbsp;?foafTelIri&nbsp;?foafTelString ) ) )
</pre>
</li>
</ul>
<a id="Numeric_Functions_and_Predicates" name="Numeric_Functions_and_Predicates"></a><h2> <span class="mw-headline">4.5 Numeric Functions and Predicates </span></h2>
<p>The following functions and predicates are adapted from the respective numeric functions and operators in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="Numeric_Functions" name="Numeric_Functions"></a><h3> <span class="mw-headline">4.5.1 Numeric Functions </span></h3>
<p>The following numeric binary built-in functions <tt>func:numeric-add</tt>, <tt>func:numeric-subtract</tt>, <tt>func:numeric-multiply</tt>, <tt>func:numeric-divide</tt>, <tt>func:numeric-integer-divide</tt>, and <tt>func:numeric-mod</tt> are defined in accordance with their corresponding operators in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<ul>
<li>
<em>Schema</em>:
<p>
The schemas for these functions have the general form
</p>
<p>
<tt>(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-<i>BINOP</i>(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>))</tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>The domain of these functions is made up of pairs of values from value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments such that <tt>op:numeric-<i>BINOP</i></tt> as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] after type promotion does not result in a numeric operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOAR0002" title="http://www.w3.org/TR/xpath-functions/#ERRFOAR0002">err:FOAR0002</a>, division by zero error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOAR0001" title="http://www.w3.org/TR/xpath-functions/#ERRFOAR0001">err:FOAR0001</a>, or a value from the <tt>xs:decimal</tt> value spaces expressible with sixteen total digits, i.e., RIF requires <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>].
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-<i>BINOP</i>(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <i>res</i> such that <i>res</i> is the result of <tt>op:numeric-<i>BINOP</i></tt>(a<sub>1</sub>', a<sub>2</sub>') as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case both a<sub>1</sub> and a<sub>2</sub> belong to their domains. Here, a<sub>1</sub>' and a<sub>2</sub>' are obtained from a<sub>1</sub> and a<sub>2</sub> as follows:</p>
<ul><li> if a<sub>1</sub> and a<sub>2</sub> are both in the value space of <tt>xs:decimal</tt>, in the value space of <tt>xs:float</tt>, or in the value space of <tt>xs:double</tt>, a<sub>1</sub>' = a<sub>1</sub> and a<sub>2</sub>' = a<sub>2</sub>, else
</li><li> if neither a<sub>1</sub> nor a<sub>2</sub> is in the value space of <tt>xs:double</tt>, a<sub>1</sub>' and a<sub>2</sub>' are obtained by <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion">promoting</a> a<sub>1</sub> and a<sub>2</sub> to <tt>xs:float</tt>, as defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion">Appendix B.1</a> of [<a href="#ref-xpath" title="">XPath</a>], else
</li><li> a<sub>1</sub>' and a<sub>2</sub>' are obtained by <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-promotion">promoting</a> a<sub>1</sub> and a<sub>2</sub> to <tt>xs:double</tt>, as defined in <a class="external text" href="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion" title="http://www.w3.org/TR/2007/REC-xpath20-20070123/#promotion">Appendix B.1</a> of [<a href="#ref-xpath" title="">XPath</a>].
</li></ul>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<p><br />
Accordingly, the following schemas are defined:
</p>
<ul>
<li><span class="anchor" id="func-numeric-add"><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-add(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-add" title="http://www.w3.org/TR/xpath-functions/#func-numeric-add">op:numeric-add</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-subtract"><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-subtract(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-subtract" title="http://www.w3.org/TR/xpath-functions/#func-numeric-subtract">op:numeric-subtract</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-multiply"><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-multiply(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-multiply" title="http://www.w3.org/TR/xpath-functions/#func-numeric-multiply">op:numeric-multiply</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-divide"><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-divide(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-divide" title="http://www.w3.org/TR/xpath-functions/#func-numeric-divide">op:numeric-divide</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-integer-divide"><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-integer-divide(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-integer-divide" title="http://www.w3.org/TR/xpath-functions/#func-numeric-integer-divide">op:numeric-integer-divide</a></tt>)
</li>
<li><span class="anchor" id="func-numeric-mod"><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:numeric-mod(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></span>
(adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-mod" title="http://www.w3.org/TR/xpath-functions/#func-numeric-mod">op:numeric-integer-mod</a></tt>)
</li>
</ul>
<a id="Numeric_Predicates" name="Numeric_Predicates"></a><h3> <span class="mw-headline">4.5.2 Numeric Predicates </span></h3>
<p><span class="anchor" id="pred-numeric-equal"></span>
</p>
<a id="pred:numeric-equal_.28adapted_from_op:numeric-equal.29" name="pred:numeric-equal_.28adapted_from_op:numeric-equal.29"></a><h4> <span class="mw-headline">4.5.2.1 <tt>pred:numeric-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-equal" title="http://www.w3.org/TR/xpath-functions/#func-numeric-equal">op:numeric-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p>
<tt>(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-equal(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>))</tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>
The value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both a<sub>1</sub> and a<sub>2</sub> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-equal(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-equal" title="http://www.w3.org/TR/xpath-functions/#func-numeric-equal">op:numeric-equal</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:numeric-less-than_.28adapted_from_op:numeric-less-than.29" name="pred:numeric-less-than_.28adapted_from_op:numeric-less-than.29"></a><h4> <span class="mw-headline">4.5.2.2 <tt>pred:numeric-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than">op:numeric-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both a<sub>1</sub> and a<sub>2</sub> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-less-than">op:numeric-less-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:numeric-greater-than_.28adapted_from_op:numeric-greater-than.29" name="pred:numeric-greater-than_.28adapted_from_op:numeric-greater-than.29"></a><h4> <span class="mw-headline">4.5.2.3 <tt>pred:numeric-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than">op:numeric-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both a<sub>1</sub> and a<sub>2</sub> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-numeric-greater-than">op:numeric-greater-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:numeric-not-equal" name="pred:numeric-not-equal"></a><h4> <span class="mw-headline">4.5.2.4 <tt>pred:numeric-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-not-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:numeric-not-equal</tt> has the same domains as <tt>pred:numeric-equal</tt> and is true whenever <tt>pred:numeric-equal</tt> is false and false otherwise.</p>
<a id="pred:numeric-less-than-or-equal" name="pred:numeric-less-than-or-equal"></a><h4> <span class="mw-headline">4.5.2.5 <tt>pred:numeric-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-less-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:numeric-less-than-or-equal</tt> has the same domains as <tt>pred:numeric-equal</tt> and is true whenever <tt>pred:numeric-equal</tt> is true or <tt>pred:numeric-less-than</tt> is true and false otherwise.</p>
<a id="pred:numeric-greater-than-or-equal" name="pred:numeric-greater-than-or-equal"></a><h4> <span class="mw-headline">4.5.2.6 <tt>pred:numeric-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:numeric-greater-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:numeric-greater-than-or-equal</tt> has the same domains as <tt>pred:numeric-equal</tt> and is true whenever <tt>pred:numeric-equal</tt> is true or <tt>pred:numeric-greater-than</tt> is true and false otherwise.</p>
<a id="Functions_and_Predicates_on_Boolean_Values" name="Functions_and_Predicates_on_Boolean_Values"></a><h2> <span class="mw-headline">4.6 Functions and Predicates on Boolean Values </span></h2>
<p>The following functions and predicates are adapted from the respective functions and operators on boolean values in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="Functions_on_Boolean_Values" name="Functions_on_Boolean_Values"></a><h3> <span class="mw-headline">4.6.1 Functions on Boolean Values </span></h3>
<a id="func:not__.28adapted_from_fn:not.29" name="func:not__.28adapted_from_fn:not.29"></a><h4> <span class="mw-headline">4.6.1.1 <tt>func:not</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-not" title="http://www.w3.org/TR/xpath-functions/#func-not">fn:not</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg&nbsp;; func:not(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:boolean</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:numeric-mod(?arg) )(a<sub>1</sub>) = <i>res</i> such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-not" title="http://www.w3.org/TR/xpath-functions/#func-not">fn:not</a>(a<sub>1</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case a<sub>1</sub> belongs to its domain.
</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Predicates_on_Boolean_Values" name="Predicates_on_Boolean_Values"></a><h3> <span class="mw-headline">4.6.2 Predicates on Boolean Values </span></h3>
<p><span class="anchor" id="pred-boolean-equal"></span>
</p>
<a id="pred:boolean-equal__.28adapted_from_op:boolean-equal.29" name="pred:boolean-equal__.28adapted_from_op:boolean-equal.29"></a><h4> <span class="mw-headline">4.6.2.1 <tt>pred:boolean-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-equal" title="http://www.w3.org/TR/xpath-functions/#func-boolean-equal">op:boolean-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p>
<tt>(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:boolean-equal(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>))</tt>
</p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:boolean</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both <tt>a<sub>1</sub></tt> and <tt>a<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:boolean-equal(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-equal" title="http://www.w3.org/TR/xpath-functions/#func-boolean-equal">op:boolean-equal</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<p>The following built-in predicates <tt>pred:boolean-less-than</tt> and <tt>pred:boolean-greater-than</tt> are defined analogously with respect to their corresponding operators in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="pred:boolean-less-than__.28adapted_from_op:boolean-less-than.29" name="pred:boolean-less-than__.28adapted_from_op:boolean-less-than.29"></a><h4> <span class="mw-headline">4.6.2.2 <tt>pred:boolean-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than">op:boolean-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:boolean-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:boolean</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both <tt>a<sub>1</sub></tt> and <tt>a<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:boolean-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-less-than">op:boolean-less-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:boolean-greater-than__.28adapted_from_op:boolean-greater-than.29" name="pred:boolean-greater-than__.28adapted_from_op:boolean-greater-than.29"></a><h4> <span class="mw-headline">4.6.2.3 <tt>pred:boolean-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than">op:boolean-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:boolean-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:boolean</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When both <tt>a<sub>1</sub></tt> and <tt>a<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:boolean-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(a<sub>1</sub> a<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-boolean-greater-than">op:boolean-greater-than</a>(a<sub>1</sub>, a<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Functions_and_Predicates_on_Strings" name="Functions_and_Predicates_on_Strings"></a><h2> <span class="mw-headline">4.7 Functions and Predicates on Strings </span></h2>
<p>The following functions and predicates are adapted from the respective functions and operators on strings in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<a id="Functions_on_Strings" name="Functions_on_Strings"></a><h3> <span class="mw-headline">4.7.1 Functions on Strings </span></h3>
<a id="func:compare_.28adapted_from_fn:compare.29" name="func:compare_.28adapted_from_fn:compare.29"></a><h4> <span class="mw-headline">4.7.1.1 <tt>func:compare</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-compare" title="http://www.w3.org/TR/xpath-functions/#func-compare">fn:compare</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>; func:compare(?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>) )
</tt></p>
<p><tt>
(&nbsp;?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>&nbsp;?collation; func:compare(?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>&nbsp;?collation) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?comparand<sub>1</sub></tt> and <tt>?comparand<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>; func:compare(?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i>
such that <i>res</i> = <tt>-1</tt>, <tt>0</tt>, or <tt>1</tt> (from the value space of <tt>xs:integer</tt>), depending on whether the value of the s<sub>1</sub> is respectively less than, equal to, or greater than the value of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. I.e., this function computes the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-compare" title="http://www.w3.org/TR/xpath-functions/#func-compare">fn:compare</a>(s<sub>1</sub>, s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains, where the default behavior in RIF is the <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a>.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:concat_.28adapted_from_fn:concat.29" name="func:concat_.28adapted_from_fn:concat.29"></a><h4> <span class="mw-headline">4.7.1.2 <tt>func:concat</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concat" title="http://www.w3.org/TR/xpath-functions/#func-concat">fn:concat</a></tt>) </span></h4>
<ul>
<li>
<em>Schemata</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:concat(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
...
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub> &nbsp;?arg<sub>2</sub> ...&nbsp;?arg<sub><i>n</i></sub>; func:concat(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ...&nbsp;?arg<sub><i>n</i></sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
Following the definition of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concat" title="http://www.w3.org/TR/xpath-functions/#func-concat">fn:concat</a> this function casts its arguments to <tt>xs:string</tt>. Thus, the domain for all arguments is the union of all values castable to <tt>xs:string</tt> as defined in Section <a href="#sec-casts" title="">Datatype Conversion and Casting</a> above.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub> ...&nbsp;?arg<sub><i>n</i></sub>; func:concat(?arg<sub>1</sub> ...&nbsp;?arg<sub><i>n</i></sub>) )(s<sub>1</sub> ... s<sub><i>n</i></sub>) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concat" title="http://www.w3.org/TR/xpath-functions/#func-concat">fn:concat</a></tt>(s<sub>1</sub> ... s<sub><i>n</i></sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:string-join_.28adapted_from_fn:string-join.29" name="func:string-join_.28adapted_from_fn:string-join.29"></a><h4> <span class="mw-headline">4.7.1.3 <tt>func:string-join</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-join" title="http://www.w3.org/TR/xpath-functions/#func-string-join">fn:string-join</a></tt>) </span></h4>
<ul>
<li>
<em>Schemata</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:string-join(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?arg<sub>3</sub>; func:string-join(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?arg<sub>3</sub> ) )
</tt></p>
<p><tt>
...
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub> &nbsp;?arg<sub>2</sub> ...&nbsp;?arg<sub><i>n-1</i></sub>&nbsp;?arg<sub><i>n</i></sub>; func:string-join(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ...&nbsp;?arg<sub><i>n-1</i></sub>&nbsp;?arg<sub><i>n</i></sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for all arguments.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub> ...&nbsp;?arg<sub><i>n-1</i></sub>&nbsp;?arg<sub><i>n</i></sub>; func:string-join(?arg<sub>1</sub> ...&nbsp;?arg<sub><i>n-1</i></sub>&nbsp;?arg<sub><i>n</i></sub>) )(s<sub>1</sub> ... s<sub><i>n-1</i></sub> s<sub><i>n</i></sub>) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-join" title="http://www.w3.org/TR/xpath-functions/#func-string-join">fn:string-join</a></tt>((s<sub>1</sub> ... s<sub><i>n-1</i></sub> ) s<sub><i>n</i></sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:substring_.28adapted_from_fn:substring.29" name="func:substring_.28adapted_from_fn:substring.29"></a><h4> <span class="mw-headline">4.7.1.4 <tt>func:substring</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring" title="http://www.w3.org/TR/xpath-functions/#func-substring">fn:substring</a></tt>) </span></h4>
<ul>
<li>
<em>Schemata</em>:
<p><tt>
(&nbsp;?sourceString&nbsp;?startingLoc; func:substring(&nbsp;?sourceString&nbsp;?startingLoc) )
</tt></p>
<p><tt>
(&nbsp;?sourceString&nbsp;?startingLoc&nbsp;?length&nbsp;; func:substring(&nbsp;?sourceString&nbsp;?startingLoc&nbsp;?length) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for &nbsp;?sourceString and the union of the value spaces of <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt> and <tt>xs:decimal</tt> for the remaining two arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?sourceString&nbsp;?startingLoc&nbsp;?length; func:substring(&nbsp;?sourceString&nbsp;?startingLoc&nbsp;?length ) )(src loc len) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring" title="http://www.w3.org/TR/xpath-functions/#func-substring">fn:substring</a></tt>(src loc len) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case all arguments belong to their domains.
</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<p>Note that, as in <a href="#ref-xpath-functions" title="">XPath-Functions</a>, the first character of a string is located at position 1, not position 0.
</p>
<a id="func:string-length_.28adapted_from_fn:string-length.29" name="func:string-length_.28adapted_from_fn:string-length.29"></a><h4> <span class="mw-headline">4.7.1.5 <tt>func:string-length</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-length" title="http://www.w3.org/TR/xpath-functions/#func-string-length">fn:string-length</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:string-length(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for &nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; func:string-length(&nbsp;?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-string-length" title="http://www.w3.org/TR/xpath-functions/#func-string-length">fn:string-length</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:upper-case_.28adapted_from_fn:upper-case.29" name="func:upper-case_.28adapted_from_fn:upper-case.29"></a><h4> <span class="mw-headline">4.7.1.6 <tt>func:upper-case</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-upper-case" title="http://www.w3.org/TR/xpath-functions/#func-upper-case">fn:upper-case</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:upper-case(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for &nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; func:upper-case(&nbsp;?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-upper-case" title="http://www.w3.org/TR/xpath-functions/#func-upper-case">fn:upper-case</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:lower-case_.28adapted_from_fn:lower-case.29" name="func:lower-case_.28adapted_from_fn:lower-case.29"></a><h4> <span class="mw-headline">4.7.1.7 <tt>func:lower-case</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-lower-case" title="http://www.w3.org/TR/xpath-functions/#func-lower-case">fn:lower-case</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:lower-case(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for &nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; func:lower-case(&nbsp;?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-lower-case" title="http://www.w3.org/TR/xpath-functions/#func-lower-case">fn:lower-case</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:encode-for-uri_.28adapted_from_fn:encode-for-uri.29" name="func:encode-for-uri_.28adapted_from_fn:encode-for-uri.29"></a><h4> <span class="mw-headline">4.7.1.8 <tt>func:encode-for-uri</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri" title="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri">fn:encode-for-uri</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:encode-for-uri(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for &nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; func:encode-for-uri(&nbsp;?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri" title="http://www.w3.org/TR/xpath-functions/#func-encode-for-uri">fn:encode-for-uri</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:iri-to-uri_.28adapted_from_fn:iri-to-uri.29" name="func:iri-to-uri_.28adapted_from_fn:iri-to-uri.29"></a><h4> <span class="mw-headline">4.7.1.9 <tt>func:iri-to-uri</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri" title="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri">fn:iri-to-uri</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?iri&nbsp;; func:iri-to-uri (&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for &nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; func:iri-to-uri(&nbsp;?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri" title="http://www.w3.org/TR/xpath-functions/#func-iri-to-uri">fn:iri-to-uri</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:escape-html-uri_.28adapted_from_fn:escape-html-uri.29" name="func:escape-html-uri_.28adapted_from_fn:escape-html-uri.29"></a><h4> <span class="mw-headline">4.7.1.10 <tt>func:escape-html-uri</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri" title="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri">fn:escape-html-uri</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?uri&nbsp;;func:escape-html-uri(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>xs:string</tt> for&nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg; func:escape-html-uri(&nbsp;?arg ) )(s) = <i>res</i> such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri" title="http://www.w3.org/TR/xpath-functions/#func-escape-html-uri">fn:escape-html-uri</a></tt>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the argument belongs to its domain.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:substring-before_.28adapted_from_fn:substring-before.29" name="func:substring-before_.28adapted_from_fn:substring-before.29"></a><h4> <span class="mw-headline">4.7.1.11 <tt>func:substring-before</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring-before" title="http://www.w3.org/TR/xpath-functions/#func-substring-before">fn:substring-before</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:substring-before(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation; func:substring-before(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:substring-before(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i>, such that <i>res</i> is the substring of s<sub>1</sub> that precedes in the value of s<sub>1</sub> the first occurrence of a sequence of collation units that provides a minimal match to the collation units of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:substring-after_.28adapted_from_fn:substring-after.29" name="func:substring-after_.28adapted_from_fn:substring-after.29"></a><h4> <span class="mw-headline">4.7.1.12 <tt>func:substring-after</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-substring-after" title="http://www.w3.org/TR/xpath-functions/#func-substring-after">fn:substring-after</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:substring-after(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation; func:substring-after(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:substring-after(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i>, such that <i>res</i> is the substring of s<sub>1</sub> that follows in the value of&nbsp;?s<sub>1</sub> the first occurrence of a sequence of collation units that provides a minimal match to the collation units of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:replace_.28adapted_from_fn:replace.29" name="func:replace_.28adapted_from_fn:replace.29"></a><h4> <span class="mw-headline">4.7.1.13 <tt>func:replace</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-replace" title="http://www.w3.org/TR/xpath-functions/#func-replace">fn:replace</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?input&nbsp;?pattern&nbsp;?replacement; func:replace(&nbsp;?input&nbsp;?pattern&nbsp;?replacement ) )
</tt></p>
<p><tt>
(&nbsp;?input&nbsp;?pattern&nbsp;?replacement&nbsp;?flags; func:replace(&nbsp;?input&nbsp;?pattern&nbsp;?replacement&nbsp;?flags ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for the first three arguments and all values in the value space of <tt>xs:string</tt> that are valid flags following <a class="external text" href="http://www.w3.org/TR/xpath-functions/#flags" title="http://www.w3.org/TR/xpath-functions/#flags">Section 7.6.1.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] for <tt>?flags</tt>.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub> (&nbsp;?input&nbsp;?pattern&nbsp;?replacement&nbsp;?flags; func:replace(&nbsp;?input&nbsp;?pattern&nbsp;?replacement&nbsp;?flags ) ) (i p r f ) = <i>res</i>, such that <i>res</i> is the result of <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-replace" title="http://www.w3.org/TR/xpath-functions/#func-replace">fn:replace</a></tt>(i p r f) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], in case the arguments belongs to their domains.
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Predicates_on_Strings" name="Predicates_on_Strings"></a><h3> <span class="mw-headline">4.7.2 Predicates on Strings </span></h3>
<a id="pred:contains_.28adapted_from_fn:contains.29" name="pred:contains_.28adapted_from_fn:contains.29"></a><h4> <span class="mw-headline">4.7.2.1 <tt>pred:contains</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-contains" title="http://www.w3.org/TR/xpath-functions/#func-contains">fn:contains</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:contains(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation&nbsp;; pred:contains(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?a<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:contains(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-contains" title="http://www.w3.org/TR/xpath-functions/#func-contains">fn:contains</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise. I.e., this function returns true or false indicating whether or not&nbsp;?s<sub>1</sub> contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of&nbsp;?s<sub>2</sub>, according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified. Note that specifically the defined domain for the <tt>?collation</tt> argument is empty in RIF. That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="pred:starts-with_.28adapted_from_fn:starts-with.29" name="pred:starts-with_.28adapted_from_fn:starts-with.29"></a><h4> <span class="mw-headline">4.7.2.2 <tt>pred:starts-with</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-starts-with" title="http://www.w3.org/TR/xpath-functions/#func-starts-with">fn:starts-with</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:starts-with(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> )
</tt></p>
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation; pred:starts-with(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation)
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?a<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:starts-with(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-starts-with" title="http://www.w3.org/TR/xpath-functions/#func-starts-with">fn:starts-with</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:ends-with_.28adapted_from_fn:ends-with.29" name="pred:ends-with_.28adapted_from_fn:ends-with.29"></a><h4> <span class="mw-headline">4.7.2.3 <tt>pred:ends-with</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-ends-with" title="http://www.w3.org/TR/xpath-functions/#func-ends-with">fn:ends-with</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; fn:ends-with(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation; fn:ends-with(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;?collation) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for <tt>?arg<sub>1</sub></tt> and <tt>?a<sub>2</sub></tt>; the domain of <tt>?collation</tt> is empty.
</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:ends-with(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-ends-with" title="http://www.w3.org/TR/xpath-functions/#func-ends-with">fn:ends-with</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="pred:matches_.28adapted_from_fn:matches.29" name="pred:matches_.28adapted_from_fn:matches.29"></a><h4> <span class="mw-headline">4.7.2.4 <tt>pred:matches</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-matches" title="http://www.w3.org/TR/xpath-functions/#func-matches">fn:matches</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?input&nbsp;?pattern; pred:matches(&nbsp;?input&nbsp;?pattern) )
</tt></p>
<p><tt>
(&nbsp;?input&nbsp;?pattern&nbsp;?flags; pred:matches(&nbsp;?input&nbsp;?pattern&nbsp;?flags ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>The value space of <tt>xs:string</tt> for the first two arguments and all values in the value space of <tt>xs:string</tt> that are valid flags following <a class="external text" href="http://www.w3.org/TR/xpath-functions/#flags" title="http://www.w3.org/TR/xpath-functions/#flags">Section 7.6.1.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>] for <tt>?flags</tt>.</p>
</li>
<li>
<em>Mapping:</em>
<p>When all arguments belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?input&nbsp;?pattern&nbsp;?flags; pred:matches(?input&nbsp;?pattern&nbsp;?flags) )(i p f) = <b>t</b> if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-matches" title="http://www.w3.org/TR/xpath-functions/#func-matches">pred:matches</a>( i p f ) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> otherwise.</p>
<p>
If an argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Functions_and_Predicates_on_Dates.2C_Times.2C_and_Durations" name="Functions_and_Predicates_on_Dates.2C_Times.2C_and_Durations"></a><h2> <span class="mw-headline">4.8 Functions and Predicates on Dates, Times, and Durations </span></h2>
<p>If not stated otherwise, in the following we define schemas for functions and operators defined on the date, time and duration datatypes in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p><p>As defined in <a class="external text" href="http://www.w3.org/TR/xpath-datamodel/#dates-and-times" title="http://www.w3.org/TR/xpath-datamodel/#dates-and-times">Section 3.3.2 Dates and Times</a>, <tt>xs:dateTime</tt>, <tt>xs:date</tt>, <tt>xs:time</tt>, <tt>xs:gYearMonth</tt>, <tt>xs:gYear</tt>, <tt>xs:gMonthDay</tt>, <tt>xs:gMonth</tt>, <tt>xs:gDay</tt> values, referred to collectively as date/time values, are represented as seven components or properties: year, month, day, hour, minute, second and timezone. The value of the first five components are <tt>xs:integer</tt>s. The value of the second component is an <tt>xs:decimal</tt> and the value of the timezone component is an <tt>xs:dayTimeDuration</tt>. For all the date/time datatypes, the timezone property is optional and may or may not be present. Depending on the datatype, some of the remaining six properties must be present and some must be absent. Absent, or missing, properties are represented by the empty sequence. This value is referred to as the local value in that the value is in the given timezone. Before comparing or subtracting <tt>xs:dateTime</tt> values, this local value must be translated or normalized to UTC.
</p>
<a id="Functions_on_Dates.2C_Times.2C_and_Durations" name="Functions_on_Dates.2C_Times.2C_and_Durations"></a><h3> <span class="mw-headline">4.8.1 Functions on Dates, Times, and Durations </span></h3>
<a id="func:year-from-dateTime_.28adapted_from_fn:year-from-dateTime.29" name="func:year-from-dateTime_.28adapted_from_fn:year-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.1 <tt>func:year-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime">fn:year-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:year-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:year-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime">fn:year-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<p>Note that we we slightly deviate here from the original definition of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-year-from-dateTime">fn:year-from-dateTime</a> which says: "If&nbsp;?arg is the empty sequence, returns the empty sequence." The RIF version of func:year-from-dateTime does not support "empty sequences".
</p>
<a id="func:month-from-dateTime_.28adapted_from_fn:month-from-dateTime.29" name="func:month-from-dateTime_.28adapted_from_fn:month-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.2 <tt>func:month-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime">fn:month-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:month-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:month-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-month-from-dateTime">fn:month-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:day-from-dateTime_.28adapted_from_fn:day-from-dateTime.29" name="func:day-from-dateTime_.28adapted_from_fn:day-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.3 <tt>func:day-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime">fn:day-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:day-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:day-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-day-from-dateTime">fn:day-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:hours-from-dateTime_.28adapted_from_fn:hours-from-dateTime.29" name="func:hours-from-dateTime_.28adapted_from_fn:hours-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.4 <tt>func:hours-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime">fn:hours-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:hours-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:hours-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime">fn:hours-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:minutes-from-dateTime_.28adapted_from_fn:minutes-from-dateTime.29" name="func:minutes-from-dateTime_.28adapted_from_fn:minutes-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.5 <tt>func:minutes-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime">fn:minutes-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:minutes-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:minutes-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime">fn:minutes-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:seconds-from-dateTime_.28adapted_from_fn:seconds-from-dateTime.29" name="func:seconds-from-dateTime_.28adapted_from_fn:seconds-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.6 <tt>func:seconds-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime">fn:seconds-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:seconds-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTime</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:seconds-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime">fn:seconds-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:year-from-date_.28adapted_from_fn:year-from-date.29" name="func:year-from-date_.28adapted_from_fn:year-from-date.29"></a><h4> <span class="mw-headline">4.8.1.7 <tt>func:year-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-date" title="http://www.w3.org/TR/xpath-functions/#func-year-from-date">fn:year-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:year-from-date(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:year-from-date(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-year-from-date" title="http://www.w3.org/TR/xpath-functions/#func-year-from-date">fn:year-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:month-from-date_.28adapted_from_fn:month-from-date.29" name="func:month-from-date_.28adapted_from_fn:month-from-date.29"></a><h4> <span class="mw-headline">4.8.1.8 <tt>func:month-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-date" title="http://www.w3.org/TR/xpath-functions/#func-month-from-date">fn:month-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:month-from-date(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:month-from-date(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-month-from-date" title="http://www.w3.org/TR/xpath-functions/#func-month-from-date">fn:month-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:day-from-date_.28adapted_from_fn:day-from-date.29" name="func:day-from-date_.28adapted_from_fn:day-from-date.29"></a><h4> <span class="mw-headline">4.8.1.9 <tt>func:day-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-date" title="http://www.w3.org/TR/xpath-functions/#func-day-from-date">fn:day-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:day-from-date(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:day-from-date(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-day-from-date" title="http://www.w3.org/TR/xpath-functions/#func-day-from-date">fn:day-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:hours-from-time_.28adapted_from_fn:hours-from-time.29" name="func:hours-from-time_.28adapted_from_fn:hours-from-time.29"></a><h4> <span class="mw-headline">4.8.1.10 <tt>func:hours-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-time" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-time">fn:hours-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:hours-from-time(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:time</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:hours-from-time(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-time" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-time">fn:hours-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:minutes-from-time_.28adapted_from_fn:minutes-from-time.29" name="func:minutes-from-time_.28adapted_from_fn:minutes-from-time.29"></a><h4> <span class="mw-headline">4.8.1.11 <tt>func:minutes-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time">fn:minutes-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:minutes-from-time(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:minutes-from-time(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-time">fn:minutes-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:seconds-from-time_.28adapted_from_fn:seconds-from-time.29" name="func:seconds-from-time_.28adapted_from_fn:seconds-from-time.29"></a><h4> <span class="mw-headline">4.8.1.12 <tt>func:seconds-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time">fn:seconds-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:seconds-from-time(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:time</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:seconds-from-time(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-time">fn:seconds-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li></ul>
<a id="func:years-from-duration_.28adapted_from_fn:years-from-duration.29" name="func:years-from-duration_.28adapted_from_fn:years-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.13 <tt>func:years-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-years-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-years-from-duration">fn:years-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:years-from-duration(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:years-from-duration(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-years-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-years-from-duration">fn:years-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
</li>
</ul>
<a id="func:months-from-duration_.28adapted_from_fn:months-from-duration.29" name="func:months-from-duration_.28adapted_from_fn:months-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.14 <tt>func:months-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-months-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-months-from-duration">fn:months-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:months-from-duration(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:months-from-duration(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-months-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-months-from-duration">fn:months-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:days-from-duration_.28adapted_from_fn:days-from-duration.29" name="func:days-from-duration_.28adapted_from_fn:days-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.15 <tt>func:days-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-days-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-days-from-duration">fn:days-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:days-from-duration(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:days-from-duration(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-days-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-days-from-duration">fn:days-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:hours-from-duration_.28adapted_from_fn:hours-from-duration.29" name="func:hours-from-duration_.28adapted_from_fn:hours-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.16 <tt>func:hours-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration">fn:hours-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:hours-from-duration(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:hours-from-duration(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-hours-from-duration">fn:hours-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:minutes-from-duration_.28adapted_from_fn:minutes-from-duration.29" name="func:minutes-from-duration_.28adapted_from_fn:minutes-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.17 <tt>func:minutes-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration">fn:minutes-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:minutes-from-duration(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:minutes-from-duration(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-minutes-from-duration">fn:minutes-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:seconds-from-duration_.28adapted_from_fn:seconds-from-duration.29" name="func:seconds-from-duration_.28adapted_from_fn:seconds-from-duration.29"></a><h4> <span class="mw-headline">4.8.1.18 <tt>func:seconds-from-duration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration">fn:seconds-from-duration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:seconds-from-duration(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for <tt>?arg</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:seconds-from-duration(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration" title="http://www.w3.org/TR/xpath-functions/#func-seconds-from-duration">fn:seconds-from-duration</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:timezone-from-dateTime_.28adapted_from_fn:timezone-from-dateTime.29" name="func:timezone-from-dateTime_.28adapted_from_fn:timezone-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.19 <tt>func:timezone-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime">fn:timezone-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:timezone-from-dateTime(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTimeStamp</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:timezone-from-dateTime(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime">fn:timezone-from-dateTime</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:dateTimeStamp</tt> instead of <tt>xs:dateTime</tt>, i.e. RIF leaves the return value for <tt>xs:dateTime</tt> values without a timezone unspecified.
</p>
</li>
</ul>
<p>The following two functions are defined analogously for domains <tt>xs:date</tt> and <tt>xs:time</tt>
</p>
<a id="func:timezone-from-date_.28adapted_from_fn:timezone-from-date.29" name="func:timezone-from-date_.28adapted_from_fn:timezone-from-date.29"></a><h4> <span class="mw-headline">4.8.1.20 <tt>func:timezone-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date">fn:timezone-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:timezone-from-date(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The values of value space <tt>xs:date</tt> with a timezone component.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:timezone-from-date(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-date">fn:timezone-from-date</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:date</tt> values with a timezone component, i.e. RIF leaves the return value for <tt>xs:date</tt> values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:timezone-from-time_.28adapted_from_fn:timezone-from-time.29" name="func:timezone-from-time_.28adapted_from_fn:timezone-from-time.29"></a><h4> <span class="mw-headline">4.8.1.21 <tt>func:timezone-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time">fn:timezone-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:timezone-from-time(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The values of value space <tt>xs:time</tt> with a timezone component.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:timezone-from-time(&nbsp;?arg ) )(s) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time" title="http://www.w3.org/TR/xpath-functions/#func-timezone-from-time">fn:timezone-from-time</a>(s) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:time</tt> values with a timezone component, i.e. RIF leaves the return value for <tt>xs:time</tt> values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dateTimes_.28adapted_from_op:subtract-dateTimes.29" name="func:subtract-dateTimes_.28adapted_from_op:subtract-dateTimes.29"></a><h4> <span class="mw-headline">4.8.1.22 <tt>func:subtract-dateTimes</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes">op:subtract-dateTimes</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dateTimes(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:dateTimeStamp</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dateTimes(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dateTimes">fn:subtract-dateTimes</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:dateTimeStamp</tt>s instead of <tt>xs:dateTime</tt>, i.e. RIF leaves the return value for <tt>xs:dateTime</tt> arguments values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dates_.28adapted_from_op:subtract-dates.29" name="func:subtract-dates_.28adapted_from_op:subtract-dates.29"></a><h4> <span class="mw-headline">4.8.1.23 <tt>func:subtract-dates</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dates" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dates">op:subtract-dates</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dates(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:date</tt> with given timezone for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dates(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dates" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dates">fn:subtract-dates</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:date</tt>s with explicit timezone, i.e. RIF leaves the return value for <tt>xs:date</tt> arguments values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:subtract-times_.28adapted_from_op:subtract-times.29" name="func:subtract-times_.28adapted_from_op:subtract-times.29"></a><h4> <span class="mw-headline">4.8.1.24 <tt>func:subtract-times</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-times" title="http://www.w3.org/TR/xpath-functions/#func-subtract-times">op:subtract-times</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-times(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>xs:time</tt> with given timezone for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-times(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-times" title="http://www.w3.org/TR/xpath-functions/#func-subtract-times">fn:subtract-times</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified. Note that RIF restricts the domain of this function to
<tt>xs:time</tt>s with explicit timezone, i.e. RIF leaves the return value for <tt>xs:date</tt> arguments values without a timezone unspecified.
</p>
</li>
</ul>
<a id="func:add-yearMonthDurations_.28adapted_from_op:add-yearMonthDurations.29" name="func:add-yearMonthDurations_.28adapted_from_op:add-yearMonthDurations.29"></a><h4> <span class="mw-headline">4.8.1.25 <tt>func:add-yearMonthDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations">op:add-yearMonthDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-yearMonthDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration </tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations">fn:add-yearMonthDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-yearMonthDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDurations">fn:add-yearMonthDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-yearMonthDurations_.28adapted_from_op:subtract-yearMonthDurations.29" name="func:subtract-yearMonthDurations_.28adapted_from_op:subtract-yearMonthDurations.29"></a><h4> <span class="mw-headline">4.8.1.26 <tt>func:subtract-yearMonthDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations">op:subtract-yearMonthDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-yearMonthDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration </tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations">fn:subtract-yearMonthDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-yearMonthDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDurations">fn:subtract-yearMonthDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If any argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:multiply-yearMonthDuration_.28adapted_from_op:multiply-yearMonthDuration.29" name="func:multiply-yearMonthDuration_.28adapted_from_op:multiply-yearMonthDuration.29"></a><h4> <span class="mw-headline">4.8.1.27 <tt>func:multiply-yearMonthDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration">op:multiply-yearMonthDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:multiply-yearMonthDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration">fn:multiply-yearMonthDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:multiply-yearMonthDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-yearMonthDuration">fn:multiply-yearMonthDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration.29" name="func:divide-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration.29"></a><h4> <span class="mw-headline">4.8.1.28 <tt>func:divide-yearMonthDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration">op:divide-yearMonthDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:divide-yearMonthDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration">fn:divide-yearMonthDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:divide-yearMonthDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration">fn:divide-yearMonthDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-yearMonthDuration-by-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration-by-yearMonthDuration.29" name="func:divide-yearMonthDuration-by-yearMonthDuration_.28adapted_from_op:divide-yearMonthDuration-by-yearMonthDuration.29"></a><h4> <span class="mw-headline">4.8.1.29 <tt>func:divide-yearMonthDuration-by-yearMonthDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration">op:divide-yearMonthDuration-by-yearMonthDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:divide-yearMonthDuration-by-yearMonthDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:yearMonthDuration</tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration">fn:divide-yearMonthDuration-by-yearMonthDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:yearMonthDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:divide-yearMonthDuration-by-yearMonthDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-yearMonthDuration-by-yearMonthDuration">fn:divide-yearMonthDuration-by-yearMonthDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDurations_.28adapted_from_op:add-dayTimeDurations.29" name="func:add-dayTimeDurations_.28adapted_from_op:add-dayTimeDurations.29"></a><h4> <span class="mw-headline">4.8.1.30 <tt>func:add-dayTimeDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations">op:add-dayTimeDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-dayTimeDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value space of <tt>xs:dayTimeDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations">fn:add-dayTimeDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-dayTimeDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDurations">fn:add-dayTimeDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDurations_.28adapted_from_op:subtract-dayTimeDurations.29" name="func:subtract-dayTimeDurations_.28adapted_from_op:subtract-dayTimeDurations.29"></a><h4> <span class="mw-headline">4.8.1.31 <tt>func:subtract-dayTimeDurations</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations">op:subtract-dayTimeDurations</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dayTimeDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value space of <tt>xs:dayTimeDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations">fn:subtract-dayTimeDurations</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dayTimeDurations(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDurations">fn:subtract-dayTimeDurations</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:multiply-dayTimeDuration_.28adapted_from_op:multiply-dayTimeDuration.29" name="func:multiply-dayTimeDuration_.28adapted_from_op:multiply-dayTimeDuration.29"></a><h4> <span class="mw-headline">4.8.1.32 <tt>func:multiply-dayTimeDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration">op:multiply-dayTimeDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:multiply-dayTimeDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dayTimeDuration </tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration">fn:multiply-dayTimeDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:multiply-dayTimeDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-multiply-dayTimeDuration">fn:multiply-dayTimeDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration.29" name="func:divide-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration.29"></a><h4> <span class="mw-headline">4.8.1.33 <tt>func:divide-dayTimeDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration">op:divide-dayTimeDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:divide-dayTimeDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:integer</tt>, <tt>xs:double</tt>, <tt>xs:float</tt>, or <tt>xs:decimal</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration">fn:divide-dayTimeDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a>, NaN supplied as double value error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005" title="http://www.w3.org/TR/xpath-functions/#ERRFOCA0005">err:FOCA0005</a>, or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:divide-dayTimeDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration">fn:divide-dayTimeDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:divide-dayTimeDuration-by-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration-by-dayTimeDuration.29" name="func:divide-dayTimeDuration-by-dayTimeDuration_.28adapted_from_op:divide-dayTimeDuration-by-dayTimeDuration.29"></a><h4> <span class="mw-headline">4.8.1.34 <tt>func:divide-dayTimeDuration-by-dayTimeDuration</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration">op:divide-dayTimeDuration-by-dayTimeDuration</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:divide-dayTimeDuration-by-dayTimeDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dayTimeDuration</tt> for both <tt>?arg<sub>1</sub></tt> and <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration">fn:divide-dayTimeDuration-by-dayTimeDuration</a> does not result in a duration operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0002" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0002">err:FODT0002</a> or in a value from the <tt>xs:dayTimeDuration</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:divide-dayTimeDuration-by-dayTimeDuration(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration" title="http://www.w3.org/TR/xpath-functions/#func-divide-dayTimeDuration-by-dayTimeDuration">fn:divide-dayTimeDuration-by-dayTimeDuration</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-yearMonthDuration-to-dateTime_.28adapted_from_op:add-yearMonthDuration-to-dateTime.29" name="func:add-yearMonthDuration-to-dateTime_.28adapted_from_op:add-yearMonthDuration-to-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.35 <tt>func:add-yearMonthDuration-to-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime">op:add-yearMonthDuration-to-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:add-yearMonthDuration-to-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime">fn:add-yearMonthDuration-to-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-yearMonthDuration-to-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-dateTime">fn:add-yearMonthDuration-to-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-yearMonthDuration-to-date_.28adapted_from_op:add-yearMonthDuration-to-date.29" name="func:add-yearMonthDuration-to-date_.28adapted_from_op:add-yearMonthDuration-to-date.29"></a><h4> <span class="mw-headline">4.8.1.36 <tt>func:add-yearMonthDuration-to-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date">op:add-yearMonthDuration-to-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:add-yearMonthDuration-to-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date">fn:add-yearMonthDuration-to-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-yearMonthDuration-to-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-yearMonthDuration-to-date">fn:add-yearMonthDuration-to-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDuration-to-dateTime_.28adapted_from_op:add-dayTimeDuration-to-dateTime.29" name="func:add-dayTimeDuration-to-dateTime_.28adapted_from_op:add-dayTimeDuration-to-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.37 <tt>func:add-dayTimeDuration-to-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime">op:add-dayTimeDuration-to-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:add-dayTimeDuration-to-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime">fn:add-dayTimehDuration-to-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-dayTimeDuration-to-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-dateTime">fn:add-dayTimeDuration-to-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDuration-to-date_.28adapted_from_op:add-dayTimeDuration-to-date.29" name="func:add-dayTimeDuration-to-date_.28adapted_from_op:add-dayTimeDuration-to-date.29"></a><h4> <span class="mw-headline">4.8.1.38 <tt>func:add-dayTimeDuration-to-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date">op:add-dayTimeDuration-to-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:add-dayTimeDuration-to-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date">fn:add-dayTimehDuration-to-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-dayTimeDuration-to-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-date">fn:add-dayTimeDuration-to-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:add-dayTimeDuration-to-time_.28adapted_from_op:add-dayTimeDuration-to-time.29" name="func:add-dayTimeDuration-to-time_.28adapted_from_op:add-dayTimeDuration-to-time.29"></a><h4> <span class="mw-headline">4.8.1.39 <tt>func:add-dayTimeDuration-to-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time">op:add-dayTimeDuration-to-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:add-dayTimeDuration-to-time(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:time</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time">fn:add-dayTimehDuration-to-time</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:time</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:add-dayTimeDuration-to-time(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time" title="http://www.w3.org/TR/xpath-functions/#func-add-dayTimeDuration-to-time">fn:add-dayTimeDuration-to-time</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li></ul>
<a id="func:subtract-yearMonthDuration-from-dateTime_.28adapted_from_op:subtract-yearMonthDuration-from-dateTime.29" name="func:subtract-yearMonthDuration-from-dateTime_.28adapted_from_op:subtract-yearMonthDuration-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.40 <tt>func:subtract-yearMonthDuration-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime">op:subtract-yearMonthDuration-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:subtract-yearMonthDuration-from-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime">fn:subtract-yearMonthDuration-from-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-yearMonthDuration-from-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-dateTime">fn:subtract-yearMonthDuration-from-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-yearMonthDuration-from-date_.28adapted_from_op:subtract-yearMonthDuration-from-date.29" name="func:subtract-yearMonthDuration-from-date_.28adapted_from_op:subtract-yearMonthDuration-from-date.29"></a><h4> <span class="mw-headline">4.8.1.41 <tt>func:subtract-yearMonthDuration-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date">op:subtract-yearMonthDuration-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:subtract-yearMonthDuration-from-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:yearMonthDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date">fn:subtract-yearMonthDuration-from-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-yearMonthDuration-from-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-yearMonthDuration-from-date">fn:subtract-yearMonthDuration-from-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDuration-from-dateTime_.28adapted_from_op:subtract-dayTimeDuration-from-dateTime.29" name="func:subtract-dayTimeDuration-from-dateTime_.28adapted_from_op:subtract-dayTimeDuration-from-dateTime.29"></a><h4> <span class="mw-headline">4.8.1.42 <tt>func:subtract-dayTimeDuration-from-dateTime</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime">op:subtract-dayTimeDuration-from-dateTime</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:subtract-dayTimeDuration-from-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:dateTime</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime">fn:subtract-dayTimehDuration-from-dateTime</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:dateTime</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dayTimeDuration-from-dateTime(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-dateTime">fn:subtract-dayTimeDuration-from-dateTime</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDuration-from-date_.28adapted_from_op:subtract-dayTimeDuration-from-date.29" name="func:subtract-dayTimeDuration-from-date_.28adapted_from_op:subtract-dayTimeDuration-from-date.29"></a><h4> <span class="mw-headline">4.8.1.43 <tt>func:subtract-dayTimeDuration-from-date</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date">op:subtract-dayTimeDuration-from-date</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:subtract-dayTimeDuration-from-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:date</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date">fn:subtract-dayTimehDuration-from-date</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:date</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dayTimeDuration-from-date(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-date">fn:subtract-dayTimeDuration-from-date</a>(s<sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="func:subtract-dayTimeDuration-from-time_.28adapted_from_op:subtract-dayTimeDuration-from-time.29" name="func:subtract-dayTimeDuration-from-time_.28adapted_from_op:subtract-dayTimeDuration-from-time.29"></a><h4> <span class="mw-headline">4.8.1.44 <tt>func:subtract-dayTimeDuration-from-time</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time">op:subtract-dayTimeDuration-from-time</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:subtract-dayTimeDuration-from-time(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The domain of this functions is made up of pairs of values from value spaces of <tt>xs:time</tt> for <tt>?arg<sub>1</sub></tt> and <tt>xs:dayTimeDuration</tt> for <tt>?arg<sub>2</sub></tt> such that <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time">fn:subtract-dayTimehDuration-from-time</a> does not result in a date/time operation overflow/underflow error <a class="external text" href="http://www.w3.org/TR/xpath-functions/#ERRFODT0001" title="http://www.w3.org/TR/xpath-functions/#ERRFODT0001">err:FODT0001</a> or in a value from the <tt>xs:time</tt> value space outside what <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming" title="http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming">minimal conformance</a> as defined in <a class="external text" href="http://www.w3.org/TR/xmlschema11-2/#partial-implementation" title="http://www.w3.org/TR/xmlschema11-2/#partial-implementation">Section 5.4</a> of [<a href="#ref-xml-schema2" title="">XML Schema Datatypes</a>] requires for durations.
</p>
</li>
<li>
<em>Mapping:</em>
<p> <i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; func:subtract-dayTimeDuration-from-time(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <i>res</i></p>
<p>such that <i>res</i> is the result of <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time" title="http://www.w3.org/TR/xpath-functions/#func-subtract-dayTimeDuration-from-time">fn:subtract-dayTimeDuration-from-Time</a><sub>1</sub> s<sub>2</sub>) as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].
</p>
<p>
If the arguments are outside of the domain, the value of the function is left unspecified.
</p>
</li></ul>
<a id="Predicates_on_Dates.2C_Times.2C_and_Durations" name="Predicates_on_Dates.2C_Times.2C_and_Durations"></a><h3> <span class="mw-headline">4.8.2 Predicates on Dates, Times, and Durations </span></h3>
<a id="pred:dateTime-equal_.28adapted_from_op:dateTime-equal.29" name="pred:dateTime-equal_.28adapted_from_op:dateTime-equal.29"></a><h4> <span class="mw-headline">4.8.2.1 <tt>pred:dateTime-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal">op:dateTime-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dateTime</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-equal">op:dateTime-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dateTime-less-than_.28adapted_from_op:dateTime-less-than.29" name="pred:dateTime-less-than_.28adapted_from_op:dateTime-less-than.29"></a><h4> <span class="mw-headline">4.8.2.2 <tt>pred:dateTime-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than">op:dateTime-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dateTime</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-less-than">op:dateTime-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dateTime-greater-than_.28adapted_from_op:dateTime-greater-than.29" name="pred:dateTime-greater-than_.28adapted_from_op:dateTime-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.3 <tt>pred:dateTime-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than">op:dateTime-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dateTime</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dateTime-greater-than">op:dateTime-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:date-equal_.28adapted_from_op:date-equal.29" name="pred:date-equal_.28adapted_from_op:date-equal.29"></a><h4> <span class="mw-headline">4.8.2.4 <tt>pred:date-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-equal" title="http://www.w3.org/TR/xpath-functions/#func-date-equal">op:date-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:date</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-equal" title="http://www.w3.org/TR/xpath-functions/#func-date-equal">op:date-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:date-less-than_.28adapted_from_op:date-less-than.29" name="pred:date-less-than_.28adapted_from_op:date-less-than.29"></a><h4> <span class="mw-headline">4.8.2.5 <tt>pred:date-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-less-than" title="http://www.w3.org/TR/xpath-functions/#func-date-less-than">op:date-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:date</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-less-than" title="http://www.w3.org/TR/xpath-functions/#func-date-less-than">op:date-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:date-greater-than_.28adapted_from_op:date-greater-than.29" name="pred:date-greater-than_.28adapted_from_op:date-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.6 <tt>pred:date-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-date-greater-than">op:date-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:date</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-date-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-date-greater-than">op:date-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:time-equal_.28adapted_from_op:time-equal.29" name="pred:time-equal_.28adapted_from_op:time-equal.29"></a><h4> <span class="mw-headline">4.8.2.7 <tt>pred:time-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-equal" title="http://www.w3.org/TR/xpath-functions/#func-time-equal">op:time-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:time</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-equal" title="http://www.w3.org/TR/xpath-functions/#func-time-equal">op:time-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:time-less-than_.28adapted_from_op:time-less-than.29" name="pred:time-less-than_.28adapted_from_op:time-less-than.29"></a><h4> <span class="mw-headline">4.8.2.8 <tt>pred:time-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-less-than" title="http://www.w3.org/TR/xpath-functions/#func-time-less-than">op:time-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:time</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-less-than" title="http://www.w3.org/TR/xpath-functions/#func-time-less-than">op:time-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:time-greater-than_.28adapted_from_op:time-greater-than.29" name="pred:time-greater-than_.28adapted_from_op:time-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.9 <tt>pred:time-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-time-greater-than">op:time-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:time</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-time-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-time-greater-than">op:time-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:duration-equal_.28adapted_from_op:duration-equal.29" name="pred:duration-equal_.28adapted_from_op:duration-equal.29"></a><h4> <span class="mw-headline">4.8.2.10 <tt>pred:duration-equal</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-duration-equal" title="http://www.w3.org/TR/xpath-functions/#func-duration-equal">op:duration-equal</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:duration-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The union of the value spaces of <tt>xs:dayTimeDuration</tt> and <tt>xs:yearMonthDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:duration-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-duration-equal" title="http://www.w3.org/TR/xpath-functions/#func-duration-equal">op:duration-equal</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dayTimeDuration-less-than_.28adapted_from_op:dayTimeDuration-less-than.29" name="pred:dayTimeDuration-less-than_.28adapted_from_op:dayTimeDuration-less-than.29"></a><h4> <span class="mw-headline">4.8.2.11 <tt>pred:dayTimeDuration-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than">op:dayTimeDuration-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dayTimeDuration-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dayTimeDuration-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-less-than">op:dayTimeDuration-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:dayTimeDuration-greater-than_.28adapted_from_op:dayTimeDuration-greater-than.29" name="pred:dayTimeDuration-greater-than_.28adapted_from_op:dayTimeDuration-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.12 <tt>pred:dayTimeDuration-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than">op:dayTimeDuration-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dayTimeDuration-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:dayTimeDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dayTimeDuration-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-dayTimeDuration-greater-than">op:dayTimeDuration-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:yearMonthDuration-less-than_.28adapted_from_op:yearMonthDuration-less-than.29" name="pred:yearMonthDuration-less-than_.28adapted_from_op:yearMonthDuration-less-than.29"></a><h4> <span class="mw-headline">4.8.2.13 <tt>pred:yearMonthDuration-less-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than">op:yearMonthDuration-less-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:yearMonthDuration-less-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:yearMonthDuration-less-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-less-than">op:yearMonthDuration-less-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:yearMonthDuration-greater-than_.28adapted_from_op:yearMonthDuration-greater-than.29" name="pred:yearMonthDuration-greater-than_.28adapted_from_op:yearMonthDuration-greater-than.29"></a><h4> <span class="mw-headline">4.8.2.14 <tt>pred:yearMonthDuration-greater-than</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than">op:yearMonthDuration-greater-than</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:yearMonthDuration-greater-than(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:yearMonthDuration</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:yearMonthDuration-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than" title="http://www.w3.org/TR/xpath-functions/#func-yearMonthDuration-greater-than">op:yearMonthDuration-greater-than</a>(s<sub>1</sub>, s<sub>2</sub>) returns <tt>true</tt>, as defined in [<a href="#ref-xpath-functions" title="">XPath-Functions</a>], <b>f</b> in case <tt>false</tt> is returned.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<p><br />
</p>
<a id="pred:dateTime-not-equal" name="pred:dateTime-not-equal"></a><h4> <span class="mw-headline">4.8.2.15 <tt>pred:dateTime-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-not-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dateTime-not-equal</tt> has the same domains as <tt>pred:dateTime-equal</tt> and is true whenever <tt>pred:dateTime-equal</tt> is false.</p>
<a id="pred:dateTime-less-than-or-equal" name="pred:dateTime-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.16 <tt>pred:dateTime-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-less-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dateTime-less-than-or-equal</tt> has the same domains as <tt>pred:dateTime-equal</tt> and is true whenever <tt>pred:dateTime-equal</tt> is true or <tt>pred:dateTime-less-than</tt> is true.</p>
<a id="pred:dateTime-greater-than-or-equal" name="pred:dateTime-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.17 <tt>pred:dateTime-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dateTime-greater-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dateTime-greater-than-or-equal</tt> has the same domains as <tt>pred:dateTime-equal</tt> and is true whenever <tt>pred:dateTime-equal</tt> is true or <tt>pred:dateTime-greater-than</tt> is true.</p>
<a id="pred:date-not-equal" name="pred:date-not-equal"></a><h4> <span class="mw-headline">4.8.2.18 <tt>pred:date-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-not-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:date-not-equal</tt> has the same domains as <tt>pred:date-equal</tt> and is true whenever <tt>pred:date-equal</tt> is false.</p>
<a id="pred:date-less-than-or-equal" name="pred:date-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.19 <tt>pred:date-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-less-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:date-less-than-or-equal</tt> has the same domains as <tt>pred:date-equal</tt> and is true whenever <tt>pred:date-equal</tt> is true or <tt>pred:date-less-than</tt> is true.</p>
<a id="pred:date-greater-than-or-equal" name="pred:date-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.20 <tt>pred:date-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:date-greater-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:date-greater-than-or-equal</tt> has the same domains as <tt>pred:date-equal</tt> and is true whenever <tt>pred:date-equal</tt> is true or <tt>pred:date-greater-than</tt> is true.</p>
<a id="pred:time-not-equal" name="pred:time-not-equal"></a><h4> <span class="mw-headline">4.8.2.21 <tt>pred:time-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-not-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-not-equal</tt> has the same domains as <tt>pred:time-equal</tt> and is true whenever <tt>pred:time-equal</tt> is false.</p>
<a id="pred:time-less-than-or-equal" name="pred:time-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.22 <tt>pred:time-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-less-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-less-than-or-equal</tt> has the same domains as <tt>pred:time-equal</tt> and is true whenever <tt>pred:time-equal</tt> is true or <tt>pred:time-less-than</tt> is true.</p>
<a id="pred:time-greater-than-or-equal" name="pred:time-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.23 <tt>pred:time-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:time-greater-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-greater-than-or-equal</tt> has the same domains as <tt>pred:time-equal</tt> and is true whenever <tt>pred:time-equal</tt> is true or <tt>pred:time-greater-than</tt> is true.</p>
<a id="pred:duration-not-equal" name="pred:duration-not-equal"></a><h4> <span class="mw-headline">4.8.2.24 <tt>pred:duration-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:duration-not-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:duration-equal</tt> has the same domains as <tt>pred:duration-equal</tt> and is true whenever <tt>pred:duration-equal</tt> is false.</p>
<a id="pred:dayTimeDuration-less-than-or-equal" name="pred:dayTimeDuration-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.25 <tt>pred:dayTimeDuration-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dayTimeDuration-less-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dayTimeDuration-less-than-or-equal</tt> has the same domains as <tt>pred:dayTimeDuration-less-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:dayTimeDuration-less-than</tt> is true.</p>
<a id="pred:dayTimeDuration-greater-than-or-equal" name="pred:dayTimeDuration-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.26 <tt>pred:dayTimeDuration-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:dayTimeDuration-greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:dayTimeDuration-greater-than-or-equal</tt> has the same domains as <tt>pred:dayTimeDuration-greater-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:dayTimeDuration-greater-than</tt> is true.</p>
<a id="pred:yearMonthDuration-less-than-or-equal" name="pred:yearMonthDuration-less-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.27 <tt>pred:yearMonthDuration-less-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:yearMonthDuration-less-than-or-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:yearMonthDuration-less-than-or-equal</tt> has the same domains as <tt>pred:yearMonthDuration-less-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:yearMonthDuration-less-than</tt> is true.</p>
<a id="pred:yearMonthDuration-greater-than-or-equal" name="pred:yearMonthDuration-greater-than-or-equal"></a><h4> <span class="mw-headline">4.8.2.28 <tt>pred:yearMonthDuration-greater-than-or-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:yearMonthDuration--greater-than(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:yearMonthDuration-greater-than-or-equal</tt> has the same domains as <tt>pred:yearMonthDuration-greater-than</tt> and is true whenever <tt>pred:duration-equal</tt> is true or <tt>pred:yearMonthDuration-greater-than</tt> is true.</p>
<a id="Functions_and_Predicates_on_rdf:XMLLiterals" name="Functions_and_Predicates_on_rdf:XMLLiterals"></a><h2> <span class="mw-headline">4.9 Functions and Predicates on rdf:XMLLiterals </span></h2>
<a id="pred:XMLLiteral-equal" name="pred:XMLLiteral-equal"></a><h4> <span class="mw-headline">4.9.1 <tt>pred:XMLLiteral-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:XMLLiteral-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>rdf:XMLLiteral</tt> for both arguments.
</p>
</li>
<li>
<em>Mapping:</em>
<p>
When both <tt>s<sub>1</sub></tt> and <tt>s<sub>2</sub></tt> belong to their domains, <i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:XMLLiteral-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s<sub>1</sub> s<sub>2</sub>) = <b>t</b>
</p>
<p>if and only if s<sub>1</sub> = s<sub>2</sub>, <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the function is left unspecified.</p>
</li>
</ul>
<a id="pred:XMLLiteral-not-equal" name="pred:XMLLiteral-not-equal"></a><h4> <span class="mw-headline">4.9.2 <tt>pred:XMLLiteral-not-equal</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>; pred:XMLLiteral-not-equal(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>) )
</tt></p>
</li>
</ul>
<p>The predicate <tt>pred:time-not-equal</tt> has the same domains as <tt>pred:XMLLiteral-equal</tt> and is true whenever <tt>pred:XMLLiteral-equal</tt> is false.</p>
<a id="Functions_and_Predicates_on_rdf:PlainLiteral" name="Functions_and_Predicates_on_rdf:PlainLiteral"></a><h2> <span class="mw-headline">4.10 Functions and Predicates on rdf:PlainLiteral </span></h2>
<p>The following functions and predicates are adapted from the respective functions and operators in [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>].
</p>
<a id="Functions_on_rdf:PlainLiteral" name="Functions_on_rdf:PlainLiteral"></a><h3> <span class="mw-headline">4.10.1 Functions on rdf:PlainLiteral </span></h3>
<a id="func:PlainLiteral-from-string-lang_.28adapted_from_plfn:PlainLiteral-from-string-lang.29" name="func:PlainLiteral-from-string-lang_.28adapted_from_plfn:PlainLiteral-from-string-lang.29"></a><h4> <span class="mw-headline">4.10.1.1 <tt>func:PlainLiteral-from-string-lang</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:PlainLiteral-from-string-lang" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:PlainLiteral-from-string-lang">plfn:PlainLiteral-from-string-lang</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:PlainLiteral-from-string-lang(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>xs:string</tt> for&nbsp;?arg<sub>1</sub> and the intersection of the elements of the value space of <tt>xs:string</tt> which represent valid language tags according to [<a href="#ref-bcp-47" title="">BCP-47</a>] for&nbsp;?arg<sub>2</sub>.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>((?arg<sub>1</sub>&nbsp;?arg<sub>2</sub>&nbsp;; func:PlainLiteral-from-string-lang(&nbsp;?arg<sub>1</sub>&nbsp;?arg<sub>2</sub> ) )(s l) = <i>res</i>
such that <i>res</i> is the pair &lt; s, l &gt; in the value space of <tt>rdf:PlainLiteral</tt>.</p>
<p>If any argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
</ul>
<a id="func:string-from-PlainLiteral_.28adapted_from_plfn:string-from-PlainLiteral.29" name="func:string-from-PlainLiteral_.28adapted_from_plfn:string-from-PlainLiteral.29"></a><h4> <span class="mw-headline">4.10.1.2 <tt>func:string-from-PlainLiteral</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:string-from-PlainLiteral" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:string-from-PlainLiteral">plfn:string-from-PlainLiteral</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg&nbsp;; func:string-from-PlainLiteral(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(?arg&nbsp;; func:string-from-PlainLiteral(&nbsp;?arg ) )(t) = <i>res</i> such that <i>res</i> is the string part s of t if t is a pair &lt; s, l &gt; or <i>res</i> = t if t is a string value.
</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
</ul>
<a id="func:lang-from-PlainLiteral_.28adapted_from_plfn:lang-from-PlainLiteral.29" name="func:lang-from-PlainLiteral_.28adapted_from_plfn:lang-from-PlainLiteral.29"></a><h4> <span class="mw-headline">4.10.1.3 <tt>func:lang-from-PlainLiteral</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:lang-from-PlainLiteral" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:lang-from-PlainLiteral">plfn:lang-from-PlainLiteral</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(?arg&nbsp;; func:lang-from-PlainLiteral(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for&nbsp;?arg.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(?arg&nbsp;; func:lang-from-PlainLiteral(&nbsp;?arg ) )(t) = <i>l</i> such that <i>l</i> is the language tag string of t if t is a pair &lt; s, l &gt; and <tt>""^^xs:string</tt> if t is a string value.
</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
</ul>
<a id="func:PlainLiteral-compare_.28adapted_from_plfn:compare.29" name="func:PlainLiteral-compare_.28adapted_from_plfn:compare.29"></a><h4> <span class="mw-headline">4.10.1.4 <tt>func:PlainLiteral-compare</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:compare" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:compare">plfn:compare</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>; func:PlainLiteral-compare(?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>) )
</tt></p>
<p><tt>
(&nbsp;?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>&nbsp;?collation; func:PlainLiteral-compare(?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>&nbsp;?collation) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for <tt>?comparand<sub>1</sub></tt> and <tt>$comparand<sub>2</sub></tt>, and the empty set for <tt>?collation</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>; func:PlainLiteral-compare(?comparand<sub>1</sub>&nbsp;?comparand<sub>2</sub>) )(t<sub>1</sub> t<sub>2</sub>) = <i>res</i>
such that, whenever t<sub>1</sub>=( s<sub>1</sub>, l ) and t<sub>2</sub>=( s<sub>2</sub>, l ) are two pairs with the same language tag l in the value space of<tt>rdf:PlainLiteral</tt>, or two string values t<sub>1</sub>=s<sub>1</sub> and t<sub>2</sub>=s<sub>2</sub>, respectively, then <i>res</i> = <tt>-1</tt>, <tt>0</tt>, or <tt>1</tt> (from the value space of <tt>xs:integer</tt>), depending on whether the value of s<sub>1</sub> is respectively less than, equal to, or greater than the value of s<sub>2</sub> according to the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> as defined in <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">Section 7.3.1</a> of [<a href="#ref-xpath-functions" title="">XPath-Functions</a>].</p>
<p>
In case an argument value is outside of its domain, or if the language tags of the values for <tt>?comparand<sub>1</sub></tt> and <tt>$comparand<sub>2</sub></tt> differ, the function value is left unspecified.
That means RIF does not prescribe any specific <a class="external text" href="http://www.w3.org/TR/xpath-functions/#collations" title="http://www.w3.org/TR/xpath-functions/#collations">collation</a> apart from the default <a class="external text" href="http://www.w3.org/2005/xpath-functions/collation/codepoint" title="http://www.w3.org/2005/xpath-functions/collation/codepoint">codepoint collation</a> and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
</p>
</li>
</ul>
<a id="func:PlainLiteral-length_.28adapted_from_plfn:length.29" name="func:PlainLiteral-length_.28adapted_from_plfn:length.29"></a><h4> <span class="mw-headline">4.10.1.5 <tt>func:PlainLiteral-length</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:length" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:length">plfn:length</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?arg&nbsp;; func:PlainLiteral-length(&nbsp;?arg ) )
</tt></p>
</li>
<li>
<em>Domain</em>:
<p>The value space of <tt>rdf:PlainLiteral</tt> for&nbsp;?arg.</p>
</li>
<li>
<em>Mapping:</em>
<p><i><b>I</b></i><sub>external</sub>(&nbsp;?arg&nbsp;; func:PlainLiteral-length(&nbsp;?arg ) )(s) = <i>res</i>
such that <i>res</i> is a value in the value space of <tt>xs:integer</tt> equal to the length in characters of the string part <i>s</i> of the argument if it is a pair ( <i>s</i>,l ), or the argument is a string value <i>s</i>, respectively.
</p>
<p>
If the argument value is outside of its domain, the value of the function is left unspecified.
</p>
</li>
</ul>
<a id="Predicates_on_rdf:PlainLiteral" name="Predicates_on_rdf:PlainLiteral"></a><h3> <span class="mw-headline">4.10.2 Predicates on rdf:PlainLiteral </span></h3>
<a id="pred:matches-language-range_.28adapted_from_plfn:matches-language-range.29" name="pred:matches-language-range_.28adapted_from_plfn:matches-language-range.29"></a><h4> <span class="mw-headline">4.10.2.1 <tt>pred:matches-language-range</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range">plfn:matches-language-range</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>
(&nbsp;?input&nbsp;?range; pred:matches-language-range(&nbsp;?input&nbsp;?range) )
</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
The value space of <tt>rdf:PlainLiteral</tt> for <tt>?input</tt> and the values of value space <tt>xs:string</tt> that correspond to valid language tags according to [<a href="#ref-bcp-47" title="">BCP-47</a>] for <tt>?range</tt>.
</p>
</li>
<li>
<em>Mapping:</em>
<p>Whenever both arguments are within their domains,
&lt;p&gt;<i><b>I</b></i><sub>external</sub> (&nbsp;?input&nbsp;?range; pred:matches-language-range(&nbsp;?input&nbsp;?range) )(i r) = <b>t</b>
if and only if <tt><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range" title="http://www.w3.org/TR/rdf-plain-literal/#plfn:matches-language-range">plfn:matches-language-range</a></tt>(i r)
as specified in [<a href="#ref-rdf-PlainLiteral" title="">RDF-PLAINLITERAL</a>] returns <tt>true</tt>, <b>f</b> otherwise.
</p>
<p>
If an argument value is outside of its domain, the truth value of the predicate is left unspecified.
</p>
</li>
</ul>
<a id="Functions_and_Predicates_on_RIF_Lists" name="Functions_and_Predicates_on_RIF_Lists"></a><h2> <span class="mw-headline">4.11 Functions and Predicates on RIF Lists </span></h2>
<p>RIF Lists are similar to list and array types in many systems, as well
as <a class="external text" href="http://www.w3.org/TR/xpath-functions/#sequence-functions" title="http://www.w3.org/TR/xpath-functions/#sequence-functions">XPath/XQuery Sequences</a> [<a href="#ref-xpath-functions" title="">XPath-Functions</a>]. They differ from XPath as follows:
</p>
<ul><li> They are called "lists" instead of sequences (so the "subsequence" function is called "sublist")
</li><li> Positions (indexes) count from zero, instead of one, and negative indexes are defined to count back from the end of the list
</li><li> They are not limited to containing only atomic data; in particular, they may contain other lists.
</li><li> There is no equivalence between an atomic value and a singleton list; in RIF these are distinct values.
</li></ul>
<a id="Position_Numbering" name="Position_Numbering"></a><h3> <span class="mw-headline">4.11.1 Position Numbering </span></h3>
<p>The positions in a list are numbered starting with zero.
That is, in a list of length n+1, the first item
has position 0, and the last item has position n.
When a negative position number is provided to a builtin,
the length of the list is added to it before it is used, so it
effectively counts backward from the end of the list: position -1
points to the last item in the list, i.e. corresponds effectively to position n, etc.
</p>
<a id="Item_Comparison" name="Item_Comparison"></a><h3> <span class="mw-headline">4.11.2 Item Comparison </span></h3>
<p>List items are compared for equality (as required by many of these
builtins) using normal RIF equality testing, not datatype equality (e.g.,
pred:numeric-equal).
</p><p>Several list builtins need to establish inequality in order to compute
a result. If all the compared items are literals or lists, this is
not a problem, but if they are rif:local or rif:iri terms, the
knowledge base is unlikely to contain inequality information. This
may lead to counter-intuitive results. For example, the empty ruleset
does not entail <tt>External(func:index-of( List(ex:foo ex:bar) ex:foo) ) == List(0)</tt>,
because the empty ruleset provides no indication whether <tt>eg:foo =
eg:bar</tt>.
</p>
<a id="Predicates_on_RIF_Lists" name="Predicates_on_RIF_Lists"></a><h3> <span class="mw-headline">4.11.3 Predicates on RIF Lists </span></h3>
<a id="pred:is-list" name="pred:is-list"></a><h4> <span class="mw-headline">4.11.3.1 <tt>pred:is-list</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?object; pred:is-list(?object))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?object: unrestricted<br />
</p>
</li>
<li>
<em>Mapping:</em>
<p>
<i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?object; pred:is-list (&nbsp;?object ) )(s) = <b>t</b> if and only if there exists some (t<sub>0</sub>, ... , t<sub>n</sub>) such that either <i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>n</sub>) = s or <i><b>I</b></i><sub>tail</sub>(t<sub>0</sub>, ... , t<sub>n</sub>) = s, and <b>f</b> otherwise.</p>
<p>Note, that since the syntactic forms of open and closed lists using the <tt>List</tt> operator refer to <i><b>I</b></i><sub>list</sub><sup>-1</sup> and <i><b>I</b></i><sub>tail</sub><sup>-1</sup>, respectively, <tt>pred:is-list</tt> is always true on these syntactic forms. Further note that per definition <i><b>I</b></i><sub>list</sub>(D<sub>ind</sub>) is disjoint from the value spaces of all data types in <i><b>DTS</b></i>, and consequently <tt>pred:is-list</tt> is always false on constants belonging to a datatype supported by the RIF dialect at hand. this is illustrated by the following examples.</p>
</li>
<li>
<em>Examples</em>
<ul>
<li><tt>External(pred:is-list(List(0 1 2 3)))</tt> will evaluate to <b>t</b> in any interpretation.
</li><li><tt>External(pred:is-list(1))</tt> will evaluate to <b>f</b> in any interpretation.
</li><li><tt>External(pred:is-list(List(0 1 2 List(3 4))))</tt> will evaluate to <b>t</b> in any interpretation.
</li><li><tt>External(pred:is-list(List(0 1 2 | List(3 4))))</tt> will evaluate to <b>t</b> in any interpretation.
</li><li><tt>External(pred:is-list(List(1 | 2)))</tt> will evaluate to <b>t</b> in any interpretation.
</li></ul>
</li>
</ul>
<a id="pred:list-contains" name="pred:list-contains"></a><h4> <span class="mw-headline">4.11.3.2 <tt>pred:list-contains</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?item; pred:list-contains(?list&nbsp;?item))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?item: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>
<p><i><b>I</b></i><sub>truth</sub><tt> &omicron; </tt><i><b>I</b></i><sub>external</sub>(&nbsp;?list&nbsp;?item; pred:list-contains (&nbsp;?list&nbsp;?item ) )(l s) = <b>t</b> if and only if I<sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) such that t<sub>i</sub> = s for some i between 0 and n, and <b>f</b> otherwise.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>
<ul>
<li><tt>External(pred:list-contains(List(0 1 2 3 4) 2)</tt> will evaluate to <b>t</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(0 1 2 3 4 5 2 2) 2)</tt> will evaluate to <b>t</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(2 2 3 4 5 2 2) 1)</tt> will evaluate to <b>f</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List() 1)</tt> will evaluate to <b>f</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(0 1 2 3 List(7 8)) List(7 8))</tt> will evaluate to <b>t</b> in any interpretation.</li>
<li><tt>External(pred:list-contains(List(0 1 2 3 List(7 8)) List(7 7))</tt> will evaluate to <b>f</b> in any interpretation.</li></ul>
</li>
</ul>
<a id="Functions_on_RIF_Lists" name="Functions_on_RIF_Lists"></a><h3> <span class="mw-headline">4.11.4 Functions on RIF Lists </span></h3>
<a id="func:make-list" name="func:make-list"></a><h4> <span class="mw-headline">4.11.4.1 <tt>func:make-list</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>; func:make-list(?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?item0: unrestricted<br />
...<br />
&nbsp;?item<i>n</i>: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list of the arguments&nbsp;?item<sub>1</sub>, ...&nbsp;?item<sub>n</sub>, in the same order they appear as arguments. That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>; func:make-list(&nbsp;?item<sub>1</sub> ...&nbsp;?item<sub>n</sub> ) )(s<sub>1</sub> ... s<sub>n</sub>) = <i><b>I</b></i><sub>list</sub>(s<sub>1</sub> ... s<sub>n</sub>)</p>
</li>
<li>
<em>Note</em>:
<p>This function is useful in RIF Core because the List construction operator is syntactically prohibited from being used with variables.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:make-list(0 1 2) ) = List(0 1 2)
External( func:make-list() ) = List()
External( func:make-list(0) ) = List(0)
External( func:make-list(0 1 List(20 21))) = List(0 1 List(20 21))
External( func:make-list(List(0 1))) = List(List(0 1))</pre>
</li>
</ul>
<a id="func:count_.28adapted_from_fn:count.29" name="func:count_.28adapted_from_fn:count.29"></a><h4> <span class="mw-headline">4.11.4.2 <tt>func:count</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-count" title="http://www.w3.org/TR/xpath-functions/#func-count">fn:count</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list; func:count(?list))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns the number of entries in the list (the length of the list). That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?list; func:count(&nbsp;?list ) )(l) = n if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n-1</sub>) is an element of <i><b>D</b></i><sub>ind</sub><sup>n</sup>.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>
External(func:count(List(0 1 2 3 4))) = 5
External(func:count(List(0))) = 1
External(func:count(List(0 0 0))) = 3
External(func:count(List())) = 0</pre>
</li>
</ul>
<a id="func:get" name="func:get"></a><h4> <span class="mw-headline">4.11.4.3 <tt>func:get</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?position; func:get(?list&nbsp;?position))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?position: value space of xs:int<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns the item at the given position in the list. That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?list&nbsp;?position; func:get(?list&nbsp;?position) )(l i) = t<sub>i</sub> if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) and i corresponds to a position between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>.</p>
<p>If an argument value is outside of its domain or i does not correspond to a position between 0 and n as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:get(List(0 1 2 3 4) 0) ) = 0
External( func:get(List(0 1 2 3 4) 1) ) = 1
External( func:get(List(0 1 2 3 4) 4) ) = 4
External( func:get(List(0 1 2 3 4) -1) ) = 4
External( func:get(List(0 1 2 3 4) -5) ) = 0
External( func:get(List(0 1 2 3 4) -10) ) = (unspecified)
External( func:get(List(0 1 2 3 4) 5) ) = (unspecified)</pre>
</li>
</ul>
<a id="func:sublist_.28adapted_from_fn:subsequence.29" name="func:sublist_.28adapted_from_fn:subsequence.29"></a><h4> <span class="mw-headline">4.11.4.4 <tt>func:sublist</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subsequence" title="http://www.w3.org/TR/xpath-functions/#func-subsequence">fn:subsequence</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?start&nbsp;?stop; func:sublist(?list&nbsp;?start&nbsp;?stop))</tt></p>
<p><tt>(?list&nbsp;?start; func:sublist(?list&nbsp;?start))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?start: value space of xs:int<br />
&nbsp;?stop: value space of xs:int<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list, containing (in order) the items starting at position '?start' and continuing up to, but not including, the '?stop' position, if '?start' is before '?stop'. The '?stop' position may be omitted, in which case it defaults to the length of the list.
That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?list&nbsp;?start&nbsp;?stop; func:sublist(?list&nbsp;?start&nbsp;?stop) )(l i j) = <i><b>I</b></i><sub>list</sub>(t<sub>i</sub> ... t<sub>j</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) such that i and j correspond to positions between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>. In case i is omitted it defaults to n.</p>
<p>If an argument value is outside of its domain or, respectively, i and j do not correspond to positions between 0 and n such that the corresponding position of i is smaller than the corresponding position of j, as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Note</em>:
<p>This differs from XPath's <a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-subsequence" title="http://www.w3.org/TR/xpath-functions/#func-subsequence">fn:subsequence</a> function in using a 'stop' position parameter instead of a 'length' parameter (in addition to the name change, the zero-based indexing, and allowing negative indexes).</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:sublist(List(0 1 2 3 4) 0 0) ) = List()
External( func:sublist(List(0 1 2 3 4) 0 1) ) = List(0)
External( func:sublist(List(0 1 2 3 4) 0 4) ) = List(0 1 2 3)
External( func:sublist(List(0 1 2 3 4) 0 5) ) = List(0 1 2 3 4)
External( func:sublist(List(0 1 2 3 4) 0 10) ) = List(0 1 2 3 4)
External( func:sublist(List(0 1 2 3 4) 0 -2) ) = List(0 1 2)
External( func:sublist(List(0 1 2 3 4) 2 4) ) = List(2 3)
External( func:sublist(List(0 1 2 3 4) 2 -2) ) = List(2)
External( func:sublist(List(0 1 2 3 4) 0) ) = List(0 1 2 3 4)
External( func:sublist(List(0 1 2 3 4) 3) ) = List(3 4)
External( func:sublist(List(0 1 2 3 4) -2) ) = List(3 4)</pre>
</li>
</ul>
<a id="func:append" name="func:append"></a><h4> <span class="mw-headline">4.11.4.5 <tt>func:append</tt> </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>; func:append(?list&nbsp;?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?item<sub>1</sub>: unrestricted<br />
...<br />
&nbsp;?item<sub>n</sub>: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list consisting of all the items in&nbsp;?list, followed by&nbsp;?item<sub>i</sub>, for each i, 1 &lt;= i &lt;= n.
That is, <i><b>I</b></i><sub>external</sub>(&nbsp;?list&nbsp;?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>; func:append(?list&nbsp;?item<sub>1</sub> ...&nbsp;?item<sub>n</sub>) )(l s<sub>1</sub> ... s<sub>n</sub>) = <i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>k</sub> s<sub>1</sub> ... s<sub>n</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>k</sub>).</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:append(List(0 1 2) 3) )= List(0 1 2 3)
External( func:append(List(0 1 2) 3 4) ) = List(0 1 2 3 4)
External( func:append(List(1 1) List(1) List(1) List(List(1))) ) = List(1 1 List(1) List(1) List(List(1)))
External( func:append(List() 1) ) = List(1)</pre>
</li>
</ul>
<a id="func:concatenate_.28adapted_from_fn:concatenate.29" name="func:concatenate_.28adapted_from_fn:concatenate.29"></a><h4> <span class="mw-headline">4.11.4.6 <tt>func:concatenate</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-concatenate" title="http://www.w3.org/TR/xpath-functions/#func-concatenate">fn:concatenate</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>; func:concatenate(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list<sub>1</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
...<br />
&nbsp;?list<sub>n</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list consisting of all the items in list<sub>1</sub>, followed by all the items in list<sub>i</sub>, for each i &lt;= n. That is, <i><b>I</b></i><sub>external</sub>(&nbsp;?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>; func:concatenate(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>) )(l<sub>1</sub> ... l<sub>n</sub>) = <i><b>I</b></i><sub>list</sub>(t<sub>1,0</sub> ... t<sub>1,k<sub>1</sub></sub> ... t<sub>n,0</sub> ... t<sub>n,k<sub>n</sub></sub>) if, for each i between 1 and n, <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l<sub>i</sub>) = (t<sub>i,0</sub> ... t<sub>i,k<sub>i</sub></sub>).</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:concatenate(List(0 1 2) List(3 4 5)) ) = List(0 1 2 3 4 5)
External( func:concatenate(List(1 1) List(1) List(1)) ) = List(1 1 1 1)
External( func:concatenate(List())) = List()
External( func:concatenate(List() List(1) List() List(2)) ) = List(1 2)</pre>
</li>
</ul>
<a id="func:insert-before_.28adapted_from_fn:insert-before.29" name="func:insert-before_.28adapted_from_fn:insert-before.29"></a><h4> <span class="mw-headline">4.11.4.7 <tt>func:insert-before</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-insert-before" title="http://www.w3.org/TR/xpath-functions/#func-insert-before">fn:insert-before</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?position&nbsp;?newItem; func:insert-before(?list&nbsp;?position&nbsp;?newItem))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?position: value space of xs:int<br />
&nbsp;?newItem: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Return a list which is&nbsp;?list, except that
&nbsp;?newItem is inserted at the given&nbsp;?position, with the item (if
any) that was at that position, and all following items, shifted
down one position. That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?list&nbsp;?position&nbsp;?newItem;
func:insert-before(?list&nbsp;?position&nbsp;?newItem) )(l i s) =
<i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>i-1</sub> s
t<sub>i</sub> ... t<sub>n</sub>) if
<i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) and i corresponds to a position between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>.</p>
<p>If an argument value is outside of its domain or i does not correspond to a position between 0 and n as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:insert-before(List(0 1 2 3 4) 0 99) ) = List(99 0 1 2 3 4)
External( func:insert-before(List(0 1 2 3 4) 1 99) ) = List(0 99 1 2 3 4)
External( func:insert-before(List(0 1 2 3 4) 5 99) ) = (unspecified)
External( func:insert-before(List(0 1 2 3 4) -1 99) ) = List(0 1 2 3 99 4)
External( func:insert-before(List(0 1 2 3 4) -5 99) ) = List(99 0 1 2 3 4)
External( func:insert-before(List(0 1 2 3 4) -10 99) ) = (unspecified)</pre>
</li>
</ul>
<p><br />
</p>
<a id="func:remove_.28adapted_from_fn:remove.29" name="func:remove_.28adapted_from_fn:remove.29"></a><h4> <span class="mw-headline">4.11.4.8 <tt>func:remove</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-remove" title="http://www.w3.org/TR/xpath-functions/#func-remove">fn:remove</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?position; func:remove(?list&nbsp;?position))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?position: value space of xs:int<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns a list which is&nbsp;?list except that the item at the
given&nbsp;?position has been removed. That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?list&nbsp;?position;
func:remove(?list&nbsp;?position) )(l i) =
<i><b>I</b></i><sub>list</sub>(t<sub>0</sub> ... t<sub>i-1</sub>
t<sub>i+1</sub> ... t<sub>n</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) and i corresponds to a position between 0 and n, as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>.</p>
<p>If an argument value is outside of its domain or i does not correspond to a position between 0 and n as described in Section <a href="#Position_Numbering" title="">Position Numbering</a> the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:remove(List(0 1 2 3 4) 0) ) = List(1 2 3 4)
External( func:remove(List(0 1 2 3 4) 1) ) = List(0 2 3 4)
External( func:remove(List(0 1 2 3 4) 4) ) = List(0 1 2 3)
External( func:remove(List(0 1 2 3 4) 5) ) = (unspecified)
External( func:remove(List(0 1 2 3 4) 6) ) = (unspecified)
External( func:remove(List(0 1 2 3 4) -1) ) = List(0 1 2 3)
External( func:remove(List(0 1 2 3 4) -5) ) = List(1 2 3 4)
External( func:remove(List(0 1 2 3 4) -6) ) = (unspecified)</pre>
</li>
</ul>
<p><br />
</p><p><br />
</p>
<a id="func:reverse_.28adapted_from_fn:reverse.29" name="func:reverse_.28adapted_from_fn:reverse.29"></a><h4> <span class="mw-headline">4.11.4.9 <tt>func:reverse</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-reverse" title="http://www.w3.org/TR/xpath-functions/#func-reverse">fn:reverse</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list; func:reverse(?list))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Return a list with all the items in&nbsp;?list, but in
reverse order. That is,
<i><b>I</b></i><sub>external</sub>(&nbsp;?list;
func:reverse(?list) )(l) =
<i><b>I</b></i><sub>list</sub>(t<sub>n</sub> ... t<sub>0</sub>) if <i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>).</p>
<p>If the argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:reverse(List(0 1 2 3 4)) ) = List(4 3 2 1 0)
External( func:reverse(List(1)) ) = List(1)
External( func:reverse(List()) ) = List()</pre>
</li>
</ul>
<p><br />
</p><p><br />
</p>
<a id="func:index-of_.28adapted_from_fn:index-of.29" name="func:index-of_.28adapted_from_fn:index-of.29"></a><h4> <span class="mw-headline">4.11.4.10 <tt>func:index-of</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-index-of" title="http://www.w3.org/TR/xpath-functions/#func-index-of">fn:index-of</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list&nbsp;?matchValue; func:index-of(?list&nbsp;?matchValue))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?matchValue: unrestricted<br />
</p>
</li>
<li>
<em>Mapping</em>:
<p>Returns the ascending list of all integers, i&gt;=0, such that
External( func:get(?list,i) ) =&nbsp;?matchValue. That is,
<i><b>I</b></i><sub>external</sub>(?list&nbsp;?matchValue; func:index-of(?list&nbsp;?matchValue))(l v) =
<i><b>I</b></i><sub>list</sub>(i<sub>1</sub> ... i<sub>k</sub>) if
<i><b>I</b></i><sub>list</sub><sup>-1</sup>(l) = (t<sub>0</sub> ... t<sub>n</sub>) such that (i<sub>1</sub> ... i<sub>k</sub>) is
the ordered list of positions (as defined in Section <a href="#Position_Numbering" title="">Position Numbering</a>) between 0 and n with
t<sub>i<sub>1</sub></sub> = ... = t<sub>i<sub>k</sub></sub> = v.
</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:index-of(List(0 1 2 3 4) 2) ) = List(2)
External( func:index-of(List(0 1 2 3 4 5 2 2) 2) ) = List(2 6 7)
External( func:index-of(List(2 2 3 4 5 2 2) 2) ) = List(0 1 5 6)
External( func:index-of(List(2 2 3 4 5 2 2) 1) ) = List()</pre>
</li>
</ul>
<p><br />
</p>
<a id="func:union_.28inspired_by_fn:union.29" name="func:union_.28inspired_by_fn:union.29"></a><h4> <span class="mw-headline">4.11.4.11 <tt>func:union</tt> (inspired by <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-union" title="http://www.w3.org/TR/xpath-functions/#func-union">fn:union</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>; func:union(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list-1: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
...<br />
&nbsp;?list-n: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list containing all the items in&nbsp;?list<sub>1</sub>, ...,&nbsp;?list<sub>n</sub>, in the same order, but with all duplicates removed.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Note</em>:
<p> <tt>External( func:union(list<sub>1</sub> ... list<sub>n</sub>) )</tt> is equivalent to <tt>External( func:distinct_values(External( func:concatenate(list<sub>1</sub> ... list<sub>n</sub>) ) ) )</tt>.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:union(List(0 1 2 4) List(3 4 5 6)) ) = List(0 1 2 4 3 5 6)
External( func:union(List(0 1 2 3) List(4)) ) = List(0 1 2 3 4)
External( func:union(List(0 1 2 3) List(3)) ) = List(0 1 2 3)</pre>
External( func:union(List(0 2 1 0)) ) = List( 0 2 1 ) </li>
</ul>
<a id="func:distinct-values_.28adapted_from_fn:distinct-values.29" name="func:distinct-values_.28adapted_from_fn:distinct-values.29"></a><h4> <span class="mw-headline">4.11.4.12 <tt>func:distinct-values</tt> (adapted from <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-distinct-values" title="http://www.w3.org/TR/xpath-functions/#func-distinct-values">fn:distinct-values</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list; func:distinct-values(?list))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list which contains exactly those items which are in&nbsp;?list, in the order of first appearance, except that all except the first occurance of any item are deleted.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:distinct-values(List(0 1 2 3 4)) ) = List(0 1 2 3 4)
External( func:distinct-values(List(0 1 2 3 4 0 4)) ) = List(0 1 2 3 4)
External( func:distinct-values(List(3 3 3)) ) = List(3)</pre>
</li>
</ul>
<a id="func:intersect_.28inspired_by_fn:intersect.29" name="func:intersect_.28inspired_by_fn:intersect.29"></a><h4> <span class="mw-headline">4.11.4.13 <tt>func:intersect</tt> (inspired by <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-intersect" title="http://www.w3.org/TR/xpath-functions/#func-intersect">fn:intersect</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>; func:intersect(?list<sub>1</sub> ...&nbsp;?list<sub>n</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list<sub>1</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
...<br />
&nbsp;?list<sub>n</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list which contains exactly those items which are common to all argument lists. The order of the items in the returned list is the same as the order in&nbsp;?list<sub>1</sub>.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:intersect(List(0 1 2 3 4) List(1 3)) ) = List(1 3)
External( func:intersect(List(0 1 2 3 4) List(3 1)) ) = List(1 3)
External( func:intersect(List(0 1 2 3 4) List()) ) = List()
External( func:intersect(List(0 1 2 3 4) List(0 1 2 3 4 5 6)) ) = List(0 1 2 3 4)</pre>
</li>
</ul>
<p><br />
</p>
<a id="func:except_.28inspired_by_fn:except.29" name="func:except_.28inspired_by_fn:except.29"></a><h4> <span class="mw-headline">4.11.4.14 <tt>func:except</tt> (inspired by <tt><a class="external text" href="http://www.w3.org/TR/xpath-functions/#func-except" title="http://www.w3.org/TR/xpath-functions/#func-except">fn:except</a></tt>) </span></h4>
<ul>
<li>
<em>Schema</em>:
<p><tt>(?list<sub>1</sub>&nbsp;?list<sub>2</sub>; func:except(?list<sub>1</sub>&nbsp;?list<sub>2</sub>))</tt></p>
</li>
<li>
<em>Domains</em>:
<p>
&nbsp;?list<sub>1</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
&nbsp;?list<sub>2</sub>: <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#def-Dlist" title="BLD"><i><b>D</b></i><sub>list</sub></a><br />
</p>
</li>
<li>
<em>Informal Mapping</em>:
<p>Returns a list which contains exactly those items which are in&nbsp;?list<sub>1</sub> and not in&nbsp;?list<sub>2</sub>.
The order of the items is the same as in&nbsp;?list<sub>1</sub>.</p>
<p>If an argument value is outside of its domain, the value of the function is left unspecified.</p>
</li>
<li>
<em>Examples</em>:
<pre>External( func:except(List(0 1 2 3 4) List(1 3)) ) = List(0 2 4)
External( func:except(List(0 1 2 3 4) List()) ) = List(0 1 2 3 4)
External( func:except(List(0 1 2 3 4) List(0 1 2 3 4)) ) = List()</pre>
</li>
</ul>
<a id="References" name="References"></a><h1> <span class="mw-headline">5 References </span></h1>
<p><span class="anchor" id="ref-bcp-47"></span>
</p>
<dl><dt> [BCP-47]
</dt><dd> <i>BCP 47 - Tags for the Identification of Languages</i>, A. Phillips, M. Davis, IETF, Sep 2006, <a class="external free" href="http://tools.ietf.org/html/bcp47" title="http://tools.ietf.org/html/bcp47">http://tools.ietf.org/html/bcp47</a>.
</dd></dl>
<p><span class="anchor" id="ref-curie"></span>
</p>
<dl><dt> [CURIE]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/2009/CR-curie-20090116/" title="http://www.w3.org/TR/2009/CR-curie-20090116/">CURIE Syntax 1.0</a></i>, M. Birbeck, S. McCarron, W3C Candidate Recommendation, 16 January 2009, <a class="external free" href="http://www.w3.org/TR/2009/CR-curie-20090116/" title="http://www.w3.org/TR/2009/CR-curie-20090116/">http://www.w3.org/TR/2009/CR-curie-20090116/</a>. <a class="external text" href="http://www.w3.org/TR/curie/" title="http://www.w3.org/TR/curie/">Latest version</a> available at <a class="external free" href="http://www.w3.org/TR/curie/" title="http://www.w3.org/TR/curie/">http://www.w3.org/TR/curie/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-concepts"></span>
</p>
<dl><dt> [RDF-CONCEPTS]
</dt><dd> <i>Resource Description Framework (RDF): Concepts and Abstract Syntax</i>, G. Klyne, J. Carroll (Editors), W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-concepts/" title="http://www.w3.org/TR/rdf-concepts/">http://www.w3.org/TR/rdf-concepts/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-semantics"></span>
</p>
<dl><dt> [RDF-SEMANTICS]
</dt><dd> <i>RDF Semantics</i>, P. Hayes, Editor, W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/">http://www.w3.org/TR/2004/REC-rdf-mt-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-mt/" title="http://www.w3.org/TR/rdf-mt/">http://www.w3.org/TR/rdf-mt/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-schema"></span>
</p>
<dl><dt> [RDF-SCHEMA]
</dt><dd> <i>RDF Vocabulary Description Language 1.0: RDF Schema</i>, B. McBride, Editor, W3C Recommendation 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-schema-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-schema-20040210/">http://www.w3.org/TR/2004/REC-rdf-schema-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-schema/" title="http://www.w3.org/TR/rdf-schema/">http://www.w3.org/TR/rdf-schema/</a>.
</dd></dl>
<dl><dt> <span id="ref-rdf-PlainLiteral">[RDF-PLAINLITERAL]</span>
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/rdf-plain-literal/" title="http://www.w3.org/TR/rdf-plain-literal/"><tt>rdf:PlainLiteral</tt>: A Datatype for RDF Plain Literals</a></i>, J. Bao, S. Hawke, B. Motik, P.F. Patel-Schneider, A. Polleres (Editors), W3C Candidate Recommendation, 11 June 2009, http://www.w3.org/TR/2009/CR-rdf-plain-literal-20090611/. Latest version available at http://www.w3.org/TR/rdf-plain-literal/.
</dd></dl>
<p><span class="anchor" id="ref-rfc-3986"></span>
</p>
<dl><dt> [RFC-3986]
</dt><dd> <i><a class="external" href="http://tools.ietf.org/html/rfc3986" title="http://tools.ietf.org/html/rfc3986">RFC 3986</a> - Uniform Resource Identifier (URI): Generic Syntax</i>, T. Berners-Lee, R. Fielding, L. Masinter, IETF, January 2005, <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-rfc-3987"></span>
</p>
<dl><dt> [RFC-3987]
</dt><dd> <i><a class="external" href="http://tools.ietf.org/html/rfc3987" title="http://tools.ietf.org/html/rfc3987">RFC 3987</a> - Internationalized Resource Identifiers (IRIs)</i>, M. Duerst and M. Suignard, IETF, January 2005, <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-rif-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-rif-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-rif-fld"></span>
</p>
<dl><dt> [RIF-FLD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/"><span>RIF Framework for Logic Dialects</span></a></cite> Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/">http://www.w3.org/TR/2010/REC-rif-fld-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-fld/">http://www.w3.org/TR/rif-fld/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-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-sparql"></span>
</p>
<dl><dt> [SPARQL]
</dt><dd> <i>SPARQL Query Language for RDF</i>, E. Prud'hommeaux, A. Seaborne (Editors), W3C Recommendation, World Wide Web Consortium, 12 January 2008, <a class="external free" href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/" title="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/">http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-sparql-query/" title="http://www.w3.org/TR/rdf-sparql-query/">http://www.w3.org/TR/rdf-sparql-query/</a>.
</dd></dl>
<p><span class="anchor" id="ref-swrl"></span>
</p>
<dl><dt> [SWRL]
</dt><dd> <i><a class="external text" href="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/" title="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/">SWRL: A Semantic Web Rule Language Combining OWL and RuleML</a></i>, I. Horrocks, P. F. Patel-Schneider, H. Boley, S. Tabet, B., M. Dean, W3C Member Submission, 21 May 2004, <a class="external free" href="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/" title="http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/">http://www.w3.org/Submission/2004/SUBM-SWRL-20040521/</a>. <a class="external text" href="http://www.w3.org/Submission/SWRL/" title="http://www.w3.org/Submission/SWRL/">Latest version</a> available at <a class="external free" href="http://www.w3.org/Submission/SWRL/" title="http://www.w3.org/Submission/SWRL/">http://www.w3.org/Submission/SWRL/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xdm"></span>
</p>
<dl><dt> [XDM]
</dt><dd> <i>XQuery 1.0 and XPath 2.0 Data Model (XDM)</i>, M. Fern&aacute;ndez, A. Malhotra, J. Marsh, M. Nagy, N. Walsh (Editors), W3C Recommendation, World Wide Web Consortium, 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>. Latest version 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-ns"></span>
</p>
<dl><dt> [XML-NS]
</dt><dd> <i>Namespaces in XML 1.1 (Second Edition)</i>, T. Bray, D. Hollander, A. Layman, R. Tobin (Editors), W3C Recommendation, World Wide Web Consortium, 16 August 2006, <a class="external free" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/">http://www.w3.org/TR/2006/REC-xml-names11-20060816/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/xml-names11/" title="http://www.w3.org/TR/xml-names11/">http://www.w3.org/TR/xml-names11/</a>.
</dd></dl>
<dl><dt> <span id="ref-xml-schema2">[XML Schema Datatypes]</span>
</dt><dd> <cite><a class="external text" href="http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/" title="http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/">W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</a></cite>. David Peterson, Shudi Gao, Ashok Malhotra, C. M. Sperberg-McQueen, and Henry S. Thompson, eds. W3C Candidate Recommendation, 30 April 2009, http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/. Latest version available as http://www.w3.org/TR/xmlschema11-2/.
</dd></dl>
<p><span class="anchor" id="ref-xpath"></span>
</p>
<dl><dt> [XPath]
</dt><dd> <i>XML Path Language (XPath) 2.0</i>, A. Berglund, S. Boag, D. Chamberlin, M. F. Fern&aacute;ndez, M, Kay, J. Robie, J. Sim&eacute;on (Editors), W3C Recommendation, World Wide Web Consortium, 23 January 2007, <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>. Latest version 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-xpath-functions"></span>
</p>
<dl><dt> [XPath-Functions]
</dt><dd> <i>XQuery 1.0 and XPath 2.0 Functions and Operators</i>, A. Malhotra, J. Melton, N. Walsh (Editors), W3C Recommendation, World Wide Web Consortium, 23 January 2007, <a class="external free" href="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/" title="http://www.w3.org/TR/2007/REC-xpath-functions-20070123/">http://www.w3.org/TR/2007/REC-xpath-functions-20070123/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/xpath-functions/" title="http://www.w3.org/TR/xpath-functions/">http://www.w3.org/TR/xpath-functions/</a>.
</dd></dl>
<p><span class="anchor" id="app-external-schema"></span>
</p>
<a id="Appendix:_Schemas_for_Externally_Defined_Terms" name="Appendix:_Schemas_for_Externally_Defined_Terms"></a><h1> <span class="mw-headline">6 Appendix: Schemas for Externally Defined Terms </span></h1>
<p>The <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF Framework for Logic Dialects</a> introduces a general notion of externally defined terms and their schemes. However, <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a> and the present document use only restricted kinds of external terms. To make this document self-contained, this appendix provides a complete description of these restricted notions.
</p><p>In <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a>, an external term is an expression of the form <tt>External(id &tau;)</tt>, where <tt>id</tt> is a term that identifies the source that defines the term <tt>&tau;</tt> and <tt>&tau;</tt> itself can be a constant, a positional or named-arguments term, a frame, an equality, or a classification term. In <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">RIF-BLD</a>, only positional and named-argument terms are allowed as <tt>&tau;</tt>, and RIF-DTB builtins can only be positional terms. So, only a <i><b>restricted kind of external terms</b></i> is used: <tt>External(&tau;)</tt>, where <tt>&tau;</tt> has one of the aforementioned forms. If <tt>&tau;</tt> is a term of the form <tt>p(...)</tt> then <tt>External(&tau;)</tt> is treated as a shorthand for <tt>External(p &tau;)</tt>, but this extended 2-argument form of <tt>External</tt> itself is not allowed in RIF-BLD.
</p><p><i>External schemas</i> serve as templates for externally defined terms. These schemas determine which externally defined terms are acceptable in a RIF dialect. Externally defined terms include RIF built-ins, but are more general. They are designed to also accommodate the ideas of procedural attachments and querying of external data sources.
</p><p><span class="anchor" id="def-external-schema"></span>
<b>Definition (Schema for external term).</b>
An <i><b> external schema</b></i> is a statement of the form <tt>(?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>;&nbsp;&tau;)</tt> where
</p>
<ul>
<li>
<tt>&tau;</tt> is a positional or a named-argument term.
</li>
<li>
<tt>?X<sub>1</sub> ...&nbsp;?X<sub>n</sub></tt> is a list of all distinct variables that occur in <tt>&tau;</tt>
</li>
</ul>
<p>The names of the variables in an external schema are immaterial, but their order is important. For instance, <tt>(?X&nbsp;?Y;&nbsp;&nbsp;?X[foo-&gt;?Y])</tt> and <tt>(?V&nbsp;?W;&nbsp;&nbsp;?V[foo-&gt;?W])</tt> are considered to be indistinguishable, but <tt>(?X&nbsp;?Y;&nbsp;&nbsp;?X[foo-&gt;?Y])</tt> and <tt>(?Y&nbsp;?X;&nbsp;&nbsp;?X[foo-&gt;?Y])</tt> are viewed as different schemas.
</p><p>Note that <a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" title="FLD">RIF-FLD</a> defines external schemas as triples <tt>(id;&nbsp;?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>;&nbsp;&tau;)</tt>, where <tt>id</tt> is the identifying term for the schema's source. However, since RIF-BLD uses a simplified version of externally defined terms in which <tt>id</tt> is determined by the predicate/function name in <tt>&tau;</tt>, the <tt>id</tt>-part is omitted in the above simplified version of external schemas.
</p><p>A term <tt>t</tt> is an <i><b>instantiation</b></i> of an external schema <tt>(?X<sub>1</sub> ...&nbsp;?X<sub>n</sub>;&nbsp;&tau;)</tt> iff <tt>t</tt> can be obtained from <tt>&tau;</tt> by a simultaneous substitution <tt>?X<sub>1</sub>/s<sub>1</sub> ...&nbsp;?X<sub>n</sub>/s<sub>n</sub></tt> of the variables <tt>?X<sub>1</sub> ...&nbsp;?X<sub>n</sub></tt> with terms <tt>s<sub>1</sub> ... s<sub>n</sub></tt>, respectively. Some of the terms <tt>s<sub>i</sub></tt> can be variables themselves. For example, <tt>?Z[foo-&gt;f(a&nbsp;?P)]</tt> is an instantiation of <tt>(?X&nbsp;?Y;&nbsp;?X[foo-&gt;?Y])</tt> by the substitution <tt>?X/?Z&nbsp;&nbsp;?Y/f(a&nbsp;?P)</tt>. &nbsp;&nbsp;
</p><p>Observe that a variable cannot be an instantiation of an external schema, since <tt>&tau;</tt> in the above definition cannot be a variable. It will be seen later that this implies that a term of the form <tt>External(?X)</tt> is not well-formed in RIF.
</p><p>The intuition behind the notion of an external schema, such as <tt>(?X&nbsp;?Y;&nbsp;&nbsp;?X["foo"^^xs:string-&gt;?Y])</tt> or <tt>(?V;&nbsp; "pred:isTime"^^rif:iri(?V))</tt>, is that <tt>?X["foo"^^xs:string-&gt;?Y]</tt> or <tt>"pred:isTime"^^rif:iri(?V)</tt> are invocation patterns for querying external sources, and instantiations of those schemas correspond to concrete invocations. Thus, <tt>External("http://foo.bar.com"^^rif:iri["foo"^^xs:string-&gt;"123"^^xs:integer])</tt> and <tt>External("pred:isTime"^^rif:iri("22:33:44"^^xs:time)</tt> are examples of invocations of external terms -- one querying an external source and another invoking a built-in.
</p><p><br />
<span class="anchor" id="def-external-schema-set"></span>
<b>Definition (Coherent set of external schemas).</b>
A set of external schemas is <i><b>coherent</b></i> if there is no term, <tt>t</tt>, that is an instantiation of two distinct schemas in the set. &nbsp;&nbsp;
</p><p>The intuition behind this notion is to ensure that any use of an external term is associated with at most one external schema. This assumption is relied upon in the definition of the semantics of externally defined terms. Note that the coherence condition is easy to verify syntactically and that it implies that schemas like <tt>(?X&nbsp;?Y;&nbsp;&nbsp;?X[foo-&gt;?Y])</tt> and <tt>(?Y&nbsp;?X;&nbsp;&nbsp;?X[foo-&gt;?Y])</tt>, which differ only in the order of their variables, cannot be in the same coherent set.
</p><p>It is important to keep in mind that external schemas are <i>not</i> part of the language in RIF, since they do not appear anywhere in RIF statements. Instead, they are best thought of as part of the grammar of the language.
</p><p><br />
<span class="anchor" id="sec-changelog"></span>
</p>
<div id="changelog">
<a id="Appendix:_Changes_from_Candidate_Recommendation_Version_of_October_1.2C_2010" name="Appendix:_Changes_from_Candidate_Recommendation_Version_of_October_1.2C_2010"></a><h1> <span class="mw-headline">7 Appendix: Changes from Candidate Recommendation Version of October 1, 2010 </span></h1>
<ul><li> AT RISK notes were removed.
</li><li> Misnamed references were fixed [XML-SCHEMA2] -&gt; [XML Schema Datatypes]
</li><li> Added new section <a href="#XML_Schema_Datatypes" title="">2.3.1 XML Schema Datatypes</a> to clarify the status of references to XSD 1.1. This is analogous to the treatment of references to XSD1.1 in <a class="external text" href="http://www.w3.org/TR/2009/REC-owl2-conformance-20091027/#XML_Schema_Datatypes" title="http://www.w3.org/TR/2009/REC-owl2-conformance-20091027/#XML_Schema_Datatypes">OWL2</a>
</li></ul>
</div>
</body>
</html>