Please refer to the errata for this document, which may include some normative corrections.
This document is also available in these non-normative formats: PDF version.
See also translations.
Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is being published as one of a set of 11 documents:
RIF is defined to use datatypes defined in the XML Schema Definition Language (XSD). As of this writing, the latest W3C Recommendation for XSD is version 1.0, with version 1.1 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 optional, as detailed in Datatypes and Builtins, section 2.3. Upon the publication of XSD 1.1 as a W3C Recommendation, those elements will cease to be optional and are to be considered required as otherwise specified.
We suggest that for now developers and users follow the XSD 1.1 Last Call Working Draft. Based on discussions between the Schema, RIF and OWL Working Groups, we do not expect any implementation changes will be necessary as XSD 1.1 advances to Recommendation.
There have been no changes to the body of this document since the previous version. For details on earlier changes, see the change log.
Please send any comments to public-rif-comments@w3.org (public archive). Although work on this document by the Rule Interchange Format (RIF) Working Group is complete, comments may be addressed in the errata or in future revisions. Open discussion among developers is welcome at public-rif-dev@w3.org (public archive).
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.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent.
This specification develops RIF-DTB (Datatypes and Built-Ins of the Rule Interchange Format). It lists the datatypes, built-in functions and built-in predicates expected to be supported by RIF dialects such as the RIF Core Dialect, the RIF Basic Logic Dialect, and the RIF Production Rules Dialect.
Some of the datatypes are adapted from [XML Schema Datatypes]. A large part of the definitions of the listed functions and operators are adapted from [XPath-Functions]. The rdf:PlainLiteral datatype as well as functions and operators associated with that datatype are adopted from [RDF-PLAINLITERAL]. Unlike the earlier SWRL built-ins [SWRL], which write n-ary functions as (1+n)-ary relations, functional RIF-DTB built-ins remain functions.
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.
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:
"literal"^^<symbolSpaceIri>
where literal is called the lexical part of the symbol, and symbolSpaceIri is the (absolute or relative) IRI identifying the symbol space. Here literal is a Unicode string that must be an element in the lexical space of the symbol space identified by the IRI symbolSpaceIri.
Since IRIs typically require long strings of characters, many Web languages have special provisions for abbreviating these strings. One well-known technique is called compact URI [CURIE], and RIF uses a similar technique by allowing RIF documents to have the directives Base and Prefix.
The Base directive defines a syntactic shortcut for expanding relative IRIs into full IRIs.
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.
The precise way in which these directives work is explained in Section Shortcuts for Constants in RIF's Presentation Syntax.
To avoid writing down long IRIs, this document will assume that the following Prefix directives have been specified in all the RIF documents under consideration:
Using these prefixes and the shorthand mechanism defined in Section Shortcuts for Constants in RIF's Presentation Syntax, we can, for example, abbreviate a constant such as "http://www.example.org"^^<http://www.w3.org/2007/rif#iri> into "http://www.example.org"^^rif:iri.
Formally, we define symbol spaces as follows.
Definition (Symbol space). A symbol space is a named subset of the set of all constants, Const in RIF. Each symbol in Const belongs to exactly one symbol space.
Each symbol space has an associated lexical space, a unique IRI identifying it and a short name. More precisely,
The identifiers of symbol spaces are not themselves constant symbols in RIF.
For convenience we will often use symbol space identifiers to refer to the actual symbol spaces (for instance, we may use "symbol space xs:string" instead of "symbol space identified by xs:string").
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.
In the following list we introduce short names for some of the symbol spaces. Short names are NCNames, typically the character sequence after the last '/' or '#' in the symbol space IRI (similar to the XML local name part of a QName). Short names are used for the predicates in Sections Guard Predicates for Datatypes and Negative Guard Predicates for Datatypes below.
The lexical spaces of the above symbol spaces are defined in the document [XML Schema Datatypes].
These two symbol spaces represent two subtypes of the XML Schema datatype xs:duration. The lexical spaces of the above symbol spaces are defined in the document [XDM].
The rdf:PlainLiteral symbol space represents text strings with a language tag attached. The lexical space of rdf:PlainLiteral is defined in the document [RDF-PLAINLITERAL].
The rdf:XMLLiteral symbol space represents XML content. The lexical space of rdf:XMLLiteral is defined in the document [RDF-CONCEPTS].
Constants in the rif:iri symbol space are intended to be used in a way similar to RDF resources [RDF-SCHEMA]. The lexical space consists of all absolute IRIs as specified in [RFC-3987]; it is unrelated to the XML primitive type xs:anyURI.
Constants in the rif:local symbol space are local to the RIF documents in which they occur. This means that occurrences of the same rif:local constant in different documents are viewed as unrelated distinct constants, but occurrences of the same rif:local constant in the same document must refer to the same object. The lexical space of rif:local is the same as the lexical space of xs:string.
Note that, by the associated lexical space, not all Unicode strings are syntactically valid lexical parts for all symbol spaces. That is, for instance, "1.2"^^xs:decimal and "1"^^xs:integer are syntactically valid constant because 1.2 and 1 are members of the lexical space of symbol spaces xs:decimal and xs:integer, respectively. On the other hand, "a+2"^^xs:decimal is not a syntactically valid constant, since a+2 is not part of the lexical space of xs:decimal.
We will often refer to constant symbols that come from a particular symbol space, X, as X constants, where X is the (short) name of the respective symbol space. For instance, the constants in the symbol space rif:iri will be referred to as IRI constants or rif:iri constants and the constants found in the symbol space rif:local as local constants or rif:local constants.
Besides the basic notion
"literal"^^<identifier>
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.
ANGLEBRACKIRI ::= IRI_REF SYMSPACE ::= ANGLEBRACKIRI | CURIE CURIE ::= PNAME_LN | PNAME_NS Const ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT CONSTSHORT ::= ANGLEBRACKIRI // shortcut for "..."^^rif:iri | CURIE // shortcut for "..."^^rif:iri | '"' UNICODESTRING '"' // shortcut for "..."^^xs:string | NumericLiteral // shortcut for "..."^^xs:integer,xs:decimal,xs:double | '_' NCName // shortcut for "..."^^rif:local | '"' UNICODESTRING '"' '@' langtag // shortcut for "...@..."^^rdf:PlainLiteral
The EBNF grammar relies on reuse of nonterminals defined in the following grammar productions from other documents:
In this grammar, CURIE stands for compact IRIs [CURIE], which are used to abbreviate symbol space IRIs. For instance, one can write "http://www.example.org"^^rif:iri instead of "http://www.example.org"^^<http://www.w3.org/2007/rif#iri>, where rif is a prefix defined in Section Base and Prefix Directives.
Apart from compact IRIs, there exist convenient shortcut notations for constants in specific symbol spaces, namely for constants in the symbol spaces rif:iri, xs:string, xs:integer, xs:decimal, xs:double, and rif:local:
Constants in the the symbol space rif:iri 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, <http://www.example.org/xyz> is a valid abbreviation for "http://www.example.org/xyz"^^rif:iri, and ex:xyz is a valid abbreviation for this constant, if the directive
Prefix(ex <http://www.example.org/> )
is present in the RIF document in question.
Relative IRIs in RIF documents are resolved with respect to the base IRI. Relative IRIs are combined with base IRIs as per Uniform Resource Identifier (URI): Generic Syntax [RFC-3986] 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 Internationalized Resource Identifiers (IRIs) [RFC-3987].
Base IRIs are specified using the Base directive described in Section Base and Prefix Directives. At most one base directive per document is allowed. In the XML syntax, base IRIs are specified using the attribute xml:base.
For instance, the constant <./xyz> or "./xyz"^^rif:iri are both valid abbreviations in RIF for the constant http://www.example.org/xyz"^^rif:iri, if the following directive is present in the document:
Base(<http://www.example.org>)
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.
Definition (Datatype). A datatype is a symbol space that has
Semantic structures are always defined with respect to a particular set of datatypes, denoted by DTS. In a concrete dialect, DTS always includes the datatypes supported by that dialect. RIF dialects are expected to support the following datatypes. However, RIF dialects may include additional datatypes. Subitems in the following lists indicate derived datatypes.
Their value spaces and the lexical-to-value-space mappings are defined as follows:
As of the publication of this document, XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes [XML Schema Datatypes] 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:
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.
A RIF built-in function or predicate is a special case of externally defined terms, which are defined in RIF Framework for Logic Dialects and also reproduced in the direct definition of RIF Basic Logic Dialect (RIF-BLD).
In RIF's presentation syntax built-in predicates and functions are syntactically represented as external terms of the form:
'External' '(' Expr ')'
where Expr is a positional term as defined in RIF Framework for Logic Dialects (see also in RIF Basic Logic Dialect). For RIF's normative syntax, see the XML Serialization Framework in RIF-FLD, or, specifically for RIF-BLD, see XML Serialization Syntax for RIF-BLD.
RIF-FLD introduces the notion of an external schema 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 f that takes n arguments has the schema
( ?X1 ... ?Xn; f(?X1 ... ?Xn) )
Here f(?X1 ... ?Xn) is the actual positional term that is used to refer to the built-in (in expressions of the form External(f(?X1 ... ?Xn))) and ?X1 ... ?Xn is the list of all variables in that term.
Note that RIF-BLD allows additional forms of built-ins, which includes named-argument terms.
RIF-FLD defines a very general notion of external terms and schemas, but RIF-BLD and the present document use more restricted notions. For convenience, we present a complete definition of these restricted notions in Appendix: Schemas for Externally Defined Terms.
The semantics of external terms is defined using two mappings: Iexternal and Itruth ο Iexternal.
If σ represents a built-in function, Iexternal(σ) must be that function.
For each built-in function with external schema σ, the present document specifies the mapping Iexternal(σ).
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 t or f only.
For a built-in predicate with schema σ, RIF-FLD and RIF-BLD require that the truth-valued mapping Itruth ο Iexternal(σ) must agree with the specification of the corresponding built-in predicate.
For each RIF built-in predicate with schema σ, the present document specifies Itruth ο Iexternal(σ).
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:
As explained in Section Semantics of Built-ins, this corresponds to the mapping Iexternal(σ) in the formal semantics of RIF-FLD and RIF-BLD, where σ is the external schema of the built-in.
As explained in Section Semantics of Built-ins, this corresponds to the mapping Itruth ο Iexternal(σ) in the formal semantics of RIF-FLD and RIF-BLD, where σ is the external schema of the built-in.
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 unspecified in such cases. This means that if one or more of the arguments is not in its domain, the value of Iexternal(σ)(a1 ... an) is unspecified. In particular, this means it can vary from one implementation to another. Similarly, Itruth ο Iexternal(σ)(a1 ... an) is unspecified when an argument is not in its domain.
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 datatype guards.
Many built-in functions and predicates described below are adapted from [XPath-Functions] and, when appropriate, we will refer to the definitions in that specification in order to avoid copying them. The differences from the original [XPath-Functions] include the handling of errors, the differentiation between predicates and functions, and a few specific differences noted in the definitions below.
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.
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.
( ?arg1 ?arg2; pred:literal-not-identical( ?arg1 ?arg2 ) )
This predicate does not depend on a specific domain.
Itruth ο Iexternal( ?arg1 ?arg2; pred:literal-not-identical( ?arg1 ?arg2 ) )(s1 s2) = t if and only if s1 and s2 are both in the value spaces of some datatypes in DTS and s1 ≠ s2. This includes the case where s1 and s2 are of disjoint types.
Itruth ο Iexternal( ?arg1 ?arg2; pred:literal-not-identical( ?arg1 ?arg2 ) )(s1 s2) = f otherwise. This includes the case where s1 or s2 are not in the value spaces of datatypes in DTS.
RIF defines guard predicates for all datatypes in Section Datatypes.
( ?arg1; pred:is-literal-DATATYPE ( ?arg1 ) )
Here, DATATYPE is the short name for a datatype. For instance, we use pred:is-literal-string for the guard predicate for xs:string, pred:is-literal-PlainLiteral for the guard predicate for rdf:PlainLiteral, or pred:is-literal-XMLLiteral for the guard predicate forrdf:XMLLiteral. 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 pred: namespace for such guard predicates.
Guard predicates do not depend on a specific domain.
Itruth ο Iexternal( ?arg1; pred:is-literal-DATATYPE ( ?arg1 ) )(s1) = t if and only if s1 is in the value space of DATATYPE and f otherwise.
Accordingly, the following schemas are defined.
Future dialects may extend this list of guards to other datatypes, but RIF does not require guards for all datatypes.
Likewise, RIF defines negative guard predicates for all datatypes in Section Datatypes.
( ?arg1; pred:is-literal-not-DATATYPE ( ?arg1 ) )
Here, DATATYPE is the short name for one of the datatypes mentioned in this document. For instance, we use pred:is-literal-not-String for the negative guard predicate for xs:string, pred:is-literal-not-PlainLiteral for the negative guard predicate for rdf:PlainLiteral, or pred:is-literal-not-XMLLiteral for the negative guard predicate for rdf:XMLLiteral. 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 pred: namespace for such negative guard predicates.
Negative guard predicates do not depend on a specific domain.
Itruth ο Iexternal( ?arg1; pred:is-literal-not-DATATYPE ( ?arg1 ) )(s1) = t if and only if s1 is in the value space of one of the datatypes in DTS but not in the value space of the datatype with shortname DATATYPE, and f otherwise.
Accordingly, the following schemas are defined.
Future dialects may extend this list of negative guards to other datatypes, but RIF does not require negative guards for all datatypes.
Note: The semantics of negative guards may be surprising. The is-literal-not-String guard essentially asks, "Is this a literal, and (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] ?". 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.
In the following, we adapt several cast functions according to the conversions defined in Section 17.1 of [XPath-Functions]. Note that some of these conversions are only partially defined, which affects the domains of these cast functions.
Likewise we define a conversion predicate useful for converting between rif:iri constants and strings, as well as a predicate to check the datatype of a constant.
The casting functions in Section 17.1 of [XPath-Functions] define mappings from source values SV, which are data values, annotated with source types ST, to target values TV, annotated with target types TT. The data values V we consider are not necessarily explicitly annotated with types. However, one can view the datatypes D1,...,Dn whose value spaces include a data value V as the types of V. We assume in the following that any of the data types D1,...,Dn is used as the annotation of the source value SV; the conversions in [XPath-Functions] are defined equivalently for all such datatypes.
( ?arg; DATATYPE-IRI ( ?arg ) )
Here, DATATYPE-IRI is the IRI identifying a datatype. For instance, we use xs:string(?V) for casting to xs:string. 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.
The domain for casting functions to XML schema datatypes depends on where the casting is defined according to Section 17.1 of [XPath-Functions]: for all the casting functions to XML schema datatypes the domain of ?arg is at most the set of all data values in the value spaces of XML schema datatypes such that the conversion to DATATYPE-IRI does not raise a type error or an invalid value for cast/constructor error [err:FORG0001] or an invalid lexical value error [err:FOCA0002] according to Section 17.1 of [XPath-Functions]. We will mention additional constraints on the domain for casts to specific datatypes below separately.
Iexternal( ?arg; DATATYPE-IRI ( ?arg ) )(SV) = TV, which is a value the value space of the datatype with IRI DATATYPE-IRI in derived from a type of SV, as defined in Section 17.1 of [XPath-Functions].
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.
Accordingly, the following schemas are defined:
Additional restriction on the Domain: Note that unlike [XPath-Functions] the extent to which an implementation validates the lexical form of xs:anyURI is not implementation dependent, but RIF requires all lexical forms of xs:anyURI appearing as constants in the xs:string symbol space to be castable to xs:anyURI.
Additional restriction on the Domain: 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 xs:date does not result in a value from the xs:date value space outside what [http://www.w3.org/TR/xmlschema11-2/#dt-minimally-conforming minimal conformance] as defined in Section 5.4 of [XML Schema Datatypes] requires for xs:date.
Additional restriction on the Domain: 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 xs:date does not result in a value from the xs:dateTime value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for xs:dateTime.
Additional restriction on the Domain: Since xs:dateTimeStamp is a derived type of dateTime the domain if this function is the same as for casting to xs:dateTime with the additional restriction that casting to xs:dateTimeStamp is only defined for values such that the conversion to xs:dateTime has a non-empty timezone component.
Additional restriction on the Domain: 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 xs:decimal does not result in a value from the xs:decimal value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for xs:decimal.
Additional restriction on the Domain: 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 xs:integer does not result in a value from the xs:integer value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for xs:integer.
Additional restrictions on the Domain:
Additional remark on the mapping:
If SV is a value in the value space of rdf:XMLLiteral, then
Iexternal( ?arg; xs:string( ?arg ) )(SV) = TV such that
TV is the string in the lexical space of rdf:XMLLiteral correspoding to SV (cf. [RDF-CONCEPTS]).
( ?arg; rdf:XMLLiteral ( ?arg ) )
The intersection of the value space of xs:string with the lexical space of rdf:XMLLiteral, i.e. an xs:string can be cast to rdf:XMLLiteral if and only if its value is in the lexical space of rdf:XMLLiteral as defined in Resource Description Framework (RDF): Concepts and Abstract Syntax
Iexternal( ?arg; xs:XMLLiteral ( ?arg ) )(s) = s' such that s' is the XMLLiteral corresponding to the given string s.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg; rdf:PlainLiteral ( ?arg ) )
The union of the value spaces of XML schema datatypes.
Since the value space of xs:string is included in the value space of rdf:PlainLiteral, the mapping is defined in precisely the same way as for casts to xs:string.
Conversions from rif:iri to xs:string and vice versa cannot be defined by the casting functions as above since rif:iri is not a datatype with a well-defined value space.
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.
( ?arg1 ?arg2; pred:iri-string ( ?arg1, ?arg2 ) )
The first argument is not restricted by a specific domain, the second argument is the value space of xs:string.
Iexternal( ?arg1 ?arg2; pred:iri-string ( ?arg1 ?arg2 ) )(iri1 str1) = t if and only if str1 is a string in the lexical space of rif:iri and iri1 is an element of the domain such that I( "str1"^^rif:iri ) = iri1 holds in the current interpretation.
Note that this definition restricts allowed RIF interpretations in such a way that the interpretation of pred:iri-string always needs to comply with respect to the symbols in the rif:iri symbol space for the first argument and elements of the xs:string value space for the second argument. The truth value of the predicate is left unspecified for other elements of the domain.
This predicate could be usable, for instance, to map telephone numbers between an RDF Format for vCard (http://www.w3.org/TR/vcard-rdf) and FOAF (http://xmlns.com/foaf/0.1/). 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 tel: 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:
... Prefix( VCard <http://www.w3.org/TR/vcard-rdf#> ) Prefix( foaf <http://xmlns.com/foaf/0.1/> ) ... Forall ?X ?foafTelIri ?foafTelString ( ?X[ VCard:tel -> External( func:substring( ?foafTelString 4 ) ] :- And ( ?X[ foaf:phone -> ?foafTelIri ] External( pred:iri-string( ?foafTelIri ?foafTelString ) ) )
The following functions and predicates are adapted from the respective numeric functions and operators in [XPath-Functions].
The following numeric binary built-in functions func:numeric-add, func:numeric-subtract, func:numeric-multiply, func:numeric-divide, func:numeric-integer-divide, and func:numeric-mod are defined in accordance with their corresponding operators in [XPath-Functions].
The schemas for these functions have the general form
(?arg1 ?arg2; func:numeric-BINOP(?arg1 ?arg2))
The domain of these functions is made up of pairs of values from value spaces of xs:integer, xs:double, xs:float, or xs:decimal for both arguments such that op:numeric-BINOP as defined in [XPath-Functions] after type promotion does not result in a numeric operation overflow/underflow error err:FOAR0002, division by zero error err:FOAR0001, or a value from the xs:decimal value spaces expressible with sixteen total digits, i.e., RIF requires minimal conformance as defined in Section 5.4 of [XML Schema Datatypes].
Iexternal( ?arg1 ?arg2; func:numeric-BINOP(?arg1 ?arg2) )(a1 a2) = res such that res is the result of op:numeric-BINOP(a1', a2') as defined in [XPath-Functions], in case both a1 and a2 belong to their domains. Here, a1' and a2' are obtained from a1 and a2 as follows:
If an argument value is outside of its domain, the value of the function is left unspecified.
Accordingly, the following schemas are defined:
(?arg1 ?arg2; pred:numeric-equal(?arg1 ?arg2))
The value spaces of xs:integer, xs:double, xs:float, or xs:decimal for both arguments.
When both a1 and a2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:numeric-equal(?arg1 ?arg2) )(a1 a2) = t if and only if op:numeric-equal(a1, a2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
(?arg1 ?arg2; pred:numeric-less-than( ?arg1 ?arg2) )
The value spaces of xs:integer, xs:double, xs:float, or xs:decimal for both arguments.
When both a1 and a2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:numeric-less-than(?arg1 ?arg2) )(a1 a2) = t if and only if op:numeric-less-than(a1, a2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
(?arg1 ?arg2; pred:numeric-greater-than( ?arg1 ?arg2) )
The value spaces of xs:integer, xs:double, xs:float, or xs:decimal for both arguments.
When both a1 and a2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:numeric-greater-than(?arg1 ?arg2) )(a1 a2) = t if and only if op:numeric-greater-than(a1, a2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
(?arg1 ?arg2; pred:numeric-not-equal( ?arg1 ?arg2) )
The predicate pred:numeric-not-equal has the same domains as pred:numeric-equal and is true whenever pred:numeric-equal is false and false otherwise.
(?arg1 ?arg2; pred:numeric-less-than-or-equal( ?arg1 ?arg2) )
The predicate pred:numeric-less-than-or-equal has the same domains as pred:numeric-equal and is true whenever pred:numeric-equal is true or pred:numeric-less-than is true and false otherwise.
(?arg1 ?arg2; pred:numeric-greater-than-or-equal( ?arg1 ?arg2) )
The predicate pred:numeric-greater-than-or-equal has the same domains as pred:numeric-equal and is true whenever pred:numeric-equal is true or pred:numeric-greater-than is true and false otherwise.
The following functions and predicates are adapted from the respective functions and operators on boolean values in [XPath-Functions].
(?arg ; func:not( ?arg ) )
The value space of xs:boolean for ?arg.
Iexternal( ?arg ; func:numeric-mod(?arg) )(a1) = res such that res is the result of fn:not(a1) as defined in [XPath-Functions], in case a1 belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
(?arg1 ?arg2; pred:boolean-equal(?arg1 ?arg2))
The value space of xs:boolean for both arguments.
When both a1 and a2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:boolean-equal(?arg1 ?arg2) )(a1 a2) = t if and only if op:boolean-equal(a1, a2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
The following built-in predicates pred:boolean-less-than and pred:boolean-greater-than are defined analogously with respect to their corresponding operators in [XPath-Functions].
(?arg1 ?arg2; pred:boolean-less-than( ?arg1 ?arg2) )
The value space of xs:boolean for both arguments.
When both a1 and a2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:boolean-less-than(?arg1 ?arg2) )(a1 a2) = t if and only if op:boolean-less-than(a1, a2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
(?arg1 ?arg2; pred:boolean-greater-than( ?arg1 ?arg2) )
The value space of xs:boolean for both arguments.
When both a1 and a2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:boolean-greater-than(?arg1 ?arg2) )(a1 a2) = t if and only if op:boolean-greater-than(a1, a2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
The following functions and predicates are adapted from the respective functions and operators on strings in [XPath-Functions].
( ?comparand1 ?comparand2; func:compare(?comparand1 ?comparand2) )
( ?comparand1 ?comparand2 ?collation; func:compare(?comparand1 ?comparand2 ?collation) )
The value space of xs:string for ?comparand1 and ?comparand2; the domain of ?collation is empty.
Iexternal( ?comparand1 ?comparand2; func:compare(?comparand1 ?comparand2) )(s1 s2) = res such that res = -1, 0, or 1 (from the value space of xs:integer), depending on whether the value of the s1 is respectively less than, equal to, or greater than the value of s2 according to the default codepoint collation as defined in Section 7.3.1 of [XPath-Functions]. I.e., this function computes the result of fn:compare(s1, s2) as defined in [XPath-Functions], in case all arguments belong to their domains, where the default behavior in RIF is the codepoint collation.
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 ?collation argument is empty in RIF. That means RIF does not prescribe any specific collation apart from the default codepoint collation and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
( ?arg1 ?arg2; func:concat(?arg1 ?arg2 ) )
...
( ?arg1 ?arg2 ... ?argn; func:concat(?arg1 ?arg2 ... ?argn ) )
Following the definition of fn:concat this function casts its arguments to xs:string. Thus, the domain for all arguments is the union of all values castable to xs:string as defined in Section Datatype Conversion and Casting above.
Iexternal( ?arg1 ... ?argn; func:concat(?arg1 ... ?argn) )(s1 ... sn) = res such that res is the result of fn:concat(s1 ... sn) as defined in [XPath-Functions], in case all arguments belong to their domains.
If an argument value is outside of its domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:string-join(?arg1 ?arg2 ) )
( ?arg1 ?arg2 ?arg3; func:string-join(?arg1 ?arg2 ?arg3 ) )
...
( ?arg1 ?arg2 ... ?argn-1 ?argn; func:string-join(?arg1 ?arg2 ... ?argn-1 ?argn ) )
The value space of xs:string for all arguments.
Iexternal( ?arg1 ... ?argn-1 ?argn; func:string-join(?arg1 ... ?argn-1 ?argn) )(s1 ... sn-1 sn) = res such that res is the result of fn:string-join((s1 ... sn-1 ) sn) as defined in [XPath-Functions], in case all arguments belong to their domains.
If an argument value is outside of its domain, the value of the function is left unspecified.
( ?sourceString ?startingLoc; func:substring( ?sourceString ?startingLoc) )
( ?sourceString ?startingLoc ?length ; func:substring( ?sourceString ?startingLoc ?length) )
The value space of xs:string for ?sourceString and the union of the value spaces of xs:integer, xs:double, xs:float and xs:decimal for the remaining two arguments.
Iexternal( ?sourceString ?startingLoc ?length; func:substring( ?sourceString ?startingLoc ?length ) )(src loc len) = res such that res is the result of fn:substring(src loc len) as defined in [XPath-Functions], in case all arguments belong to their domains.
If an argument value is outside of its domain, the value of the function is left unspecified.
Note that, as in XPath-Functions, the first character of a string is located at position 1, not position 0.
( ?arg ; func:string-length( ?arg ) )
The value space of xs:string for ?arg.
Iexternal( ?arg; func:string-length( ?arg ) )(s) = res such that res is the result of fn:string-length(s) as defined in [XPath-Functions], in case the argument belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:upper-case( ?arg ) )
The value space of xs:string for ?arg.
Iexternal( ?arg; func:upper-case( ?arg ) )(s) = res such that res is the result of fn:upper-case(s) as defined in [XPath-Functions], in case the argument belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:lower-case( ?arg ) )
The value space of xs:string for ?arg.
Iexternal( ?arg; func:lower-case( ?arg ) )(s) = res such that res is the result of fn:lower-case(s) as defined in [XPath-Functions], in case the argument belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:encode-for-uri( ?arg ) )
The value space of xs:string for ?arg.
Iexternal( ?arg; func:encode-for-uri( ?arg ) )(s) = res such that res is the result of fn:encode-for-uri(s) as defined in [XPath-Functions], in case the argument belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?iri ; func:iri-to-uri ( ?arg ) )
The value space of xs:string for ?arg.
Iexternal( ?arg; func:iri-to-uri( ?arg ) )(s) = res such that res is the result of fn:iri-to-uri(s) as defined in [XPath-Functions], in case the argument belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?uri ;func:escape-html-uri( ?arg ) )
The value space of xs:string for ?arg.
Iexternal( ?arg; func:escape-html-uri( ?arg ) )(s) = res such that res is the result of fn:escape-html-uri(s) as defined in [XPath-Functions], in case the argument belongs to its domain.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:substring-before( ?arg1 ?arg2 ) )
( ?arg1 ?arg2 ?collation; func:substring-before( ?arg1 ?arg2 ?collation ) )
The value space of xs:string for ?arg1 and ?arg2; the domain of ?collation is empty.
Iexternal( ?arg1 ?arg2; func:substring-before(?arg1 ?arg2) )(s1 s2) = res, such that res is the substring of s1 that precedes in the value of s1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of s2 according to the default codepoint collation as defined in Section 7.3.1 of [XPath-Functions].
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 ?collation argument is empty in RIF. That means RIF does not prescribe any specific collation apart from the default codepoint collation and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
( ?arg1 ?arg2; func:substring-after( ?arg1 ?arg2 ) )
( ?arg1 ?arg2 ?collation; func:substring-after( ?arg1 ?arg2 ?collation ) )
The value space of xs:string for ?arg1 and ?arg2; the domain of ?collation is empty.
Iexternal( ?arg1 ?arg2; func:substring-after(?arg1 ?arg2) )(s1 s2) = res, such that res is the substring of s1 that follows in the value of ?s1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of s2 according to the default codepoint collation as defined in Section 7.3.1 of [XPath-Functions].
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 ?collation argument is empty in RIF. That means RIF does not prescribe any specific collation apart from the default codepoint collation and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
( ?input ?pattern ?replacement; func:replace( ?input ?pattern ?replacement ) )
( ?input ?pattern ?replacement ?flags; func:replace( ?input ?pattern ?replacement ?flags ) )
The value space of xs:string for the first three arguments and all values in the value space of xs:string that are valid flags following Section 7.6.1.1 of [XPath-Functions] for ?flags.
Iexternal ( ?input ?pattern ?replacement ?flags; func:replace( ?input ?pattern ?replacement ?flags ) ) (i p r f ) = res, such that res is the result of fn:replace(i p r f) as defined in [XPath-Functions], in case the arguments belongs to their domains.
If any argument value is outside of its domain, the value of the function is left unspecified.
( ?arg1 ?arg2; pred:contains( ?arg1 ?arg2 ) )
( ?arg1 ?arg2 ?collation ; pred:contains( ?arg1 ?arg2 ?collation ) )
The value space of xs:string for ?arg1 and ?a2; the domain of ?collation is empty.
When all arguments belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:contains(?arg1 ?arg2) )(s1 s2) = t if and only if fn:contains(s1, s2) returns true, as defined in [XPath-Functions], f otherwise. I.e., this function returns true or false indicating whether or not ?s1 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 ?s2, according to the default codepoint collation as defined in Section 7.3.1 of [XPath-Functions].
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 ?collation argument is empty in RIF. That means RIF does not prescribe any specific collation apart from the default codepoint collation and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
( ?arg1 ?arg2; pred:starts-with( ?arg1 ?arg2 )
( ?arg1 ?arg2 ?collation; pred:starts-with( ?arg1 ?arg2 ?collation)
The value space of xs:string for ?arg1 and ?a2; the domain of ?collation is empty.
When all arguments belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:starts-with(?arg1 ?arg2) )(s1 s2) = t if and only if fn:starts-with(s1, s2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the value of the function is left unspecified.
(?arg1 ?arg2; fn:ends-with( ?arg1 ?arg2 ) )
(?arg1 ?arg2 ?collation; fn:ends-with( ?arg1 ?arg2 ?collation) )
The value space of xs:string for ?arg1 and ?a2; the domain of ?collation is empty.
When all arguments belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:ends-with(?arg1 ?arg2) )(s1 s2) = t if and only if fn:ends-with(s1, s2) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the value of the function is left unspecified.
( ?input ?pattern; pred:matches( ?input ?pattern) )
( ?input ?pattern ?flags; pred:matches( ?input ?pattern ?flags ) )
The value space of xs:string for the first two arguments and all values in the value space of xs:string that are valid flags following Section 7.6.1.1 of [XPath-Functions] for ?flags.
When all arguments belong to their domains, Itruth ο Iexternal( ?input ?pattern ?flags; pred:matches(?input ?pattern ?flags) )(i p f) = t if and only if pred:matches( i p f ) returns true, as defined in [XPath-Functions], f otherwise.
If an argument value is outside of its domain, the value of the function is left unspecified.
If not stated otherwise, in the following we define schemas for functions and operators defined on the date, time and duration datatypes in [XPath-Functions].
As defined in Section 3.3.2 Dates and Times, xs:dateTime, xs:date, xs:time, xs:gYearMonth, xs:gYear, xs:gMonthDay, xs:gMonth, xs:gDay 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 xs:integers. The value of the second component is an xs:decimal and the value of the timezone component is an xs:dayTimeDuration. 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 xs:dateTime values, this local value must be translated or normalized to UTC.
( ?arg ; func:year-from-dateTime( ?arg ) )
The value space of xs:dateTime for ?arg.
Iexternal( ?arg ; func:year-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:year-from-dateTime(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
Note that we we slightly deviate here from the original definition of fn:year-from-dateTime which says: "If ?arg is the empty sequence, returns the empty sequence." The RIF version of func:year-from-dateTime does not support "empty sequences".
( ?arg ; func:month-from-dateTime( ?arg ) )
The value space of xs:dateTime for ?arg.
Iexternal( ?arg ; func:month-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:month-from-dateTime(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:day-from-dateTime( ?arg ) )
The value space of xs:dateTime for ?arg.
Iexternal( ?arg ; func:day-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:day-from-dateTime(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:hours-from-dateTime( ?arg ) )
The value space of xs:dateTime for ?arg.
Iexternal( ?arg ; func:hours-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:hours-from-dateTime(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:minutes-from-dateTime( ?arg ) )
The value space of xs:dateTime for ?arg.
Iexternal( ?arg ; func:minutes-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:minutes-from-dateTime(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:seconds-from-dateTime( ?arg ) )
The value space of xs:dateTime for ?arg.
Iexternal( ?arg ; func:seconds-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:seconds-from-dateTime(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:year-from-date( ?arg ) )
The value space of xs:date for ?arg.
Iexternal( ?arg ; func:year-from-date( ?arg ) )(s) = res
such that res is the result of fn:year-from-date(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:month-from-date( ?arg ) )
The value space of xs:date for ?arg.
Iexternal( ?arg ; func:month-from-date( ?arg ) )(s) = res
such that res is the result of fn:month-from-date(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:day-from-date( ?arg ) )
The value space of xs:date for ?arg.
Iexternal( ?arg ; func:day-from-date( ?arg ) )(s) = res
such that res is the result of fn:day-from-date(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:hours-from-time( ?arg ) )
The value space of xs:time for ?arg.
Iexternal( ?arg ; func:hours-from-time( ?arg ) )(s) = res
such that res is the result of fn:hours-from-time(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:minutes-from-time( ?arg ) )
Iexternal( ?arg ; func:minutes-from-time( ?arg ) )(s) = res
such that res is the result of fn:minutes-from-time(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:seconds-from-time( ?arg ) )
The value space of xs:time for ?arg.
Iexternal( ?arg ; func:seconds-from-time( ?arg ) )(s) = res
such that res is the result of fn:seconds-from-time(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:years-from-duration( ?arg ) )
The value space of xs:yearMonthDuration for ?arg.
Iexternal( ?arg ; func:years-from-duration( ?arg ) )(s) = res
such that res is the result of fn:years-from-duration(s) as defined in [XPath-Functions].
( ?arg ; func:months-from-duration( ?arg ) )
The value space of xs:yearMonthDuration for ?arg.
Iexternal( ?arg ; func:months-from-duration( ?arg ) )(s) = res
such that res is the result of fn:months-from-duration(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:days-from-duration( ?arg ) )
The value space of xs:dayTimeDuration for ?arg.
Iexternal( ?arg ; func:days-from-duration( ?arg ) )(s) = res
such that res is the result of fn:days-from-duration(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:hours-from-duration( ?arg ) )
The value space of xs:dayTimeDuration for ?arg.
Iexternal( ?arg ; func:hours-from-duration( ?arg ) )(s) = res
such that res is the result of fn:hours-from-duration(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:minutes-from-duration( ?arg ) )
The value space of xs:dayTimeDuration for ?arg.
Iexternal( ?arg ; func:minutes-from-duration( ?arg ) )(s) = res
such that res is the result of fn:minutes-from-duration(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:seconds-from-duration( ?arg ) )
The value space of xs:dayTimeDuration for ?arg.
Iexternal( ?arg ; func:seconds-from-duration( ?arg ) )(s) = res
such that res is the result of fn:seconds-from-duration(s) as defined in [XPath-Functions].
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?arg ; func:timezone-from-dateTime( ?arg ) )
The value space of xs:dateTimeStamp.
Iexternal( ?arg ; func:timezone-from-dateTime( ?arg ) )(s) = res
such that res is the result of fn:timezone-from-dateTime(s) as defined in [XPath-Functions].
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 xs:dateTimeStamp instead of xs:dateTime, i.e. RIF leaves the return value for xs:dateTime values without a timezone unspecified.
The following two functions are defined analogously for domains xs:date and xs:time
( ?arg ; func:timezone-from-date( ?arg ) )
The values of value space xs:date with a timezone component.
Iexternal( ?arg ; func:timezone-from-date( ?arg ) )(s) = res
such that res is the result of fn:timezone-from-date(s) as defined in [XPath-Functions].
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 xs:date values with a timezone component, i.e. RIF leaves the return value for xs:date values without a timezone unspecified.
( ?arg ; func:timezone-from-time( ?arg ) )
The values of value space xs:time with a timezone component.
Iexternal( ?arg ; func:timezone-from-time( ?arg ) )(s) = res
such that res is the result of fn:timezone-from-time(s) as defined in [XPath-Functions].
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 xs:time values with a timezone component, i.e. RIF leaves the return value for xs:time values without a timezone unspecified.
( ?arg1 ?arg2; func:subtract-dateTimes( ?arg1 ?arg2 ) )
The value space of xs:dateTimeStamp for both arguments.
Iexternal( ?arg1 ?arg2; func:subtract-dateTimes( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-dateTimes(s1 s2) as defined in [XPath-Functions].
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 xs:dateTimeStamps instead of xs:dateTime, i.e. RIF leaves the return value for xs:dateTime arguments values without a timezone unspecified.
( ?arg1 ?arg2; func:subtract-dates( ?arg1 ?arg2 ) )
The value space of xs:date with given timezone for both arguments.
Iexternal( ?arg1 ?arg2; func:subtract-dates( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-dates(s1 s2) as defined in [XPath-Functions].
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 xs:dates with explicit timezone, i.e. RIF leaves the return value for xs:date arguments values without a timezone unspecified.
( ?arg1 ?arg2; func:subtract-times( ?arg1 ?arg2 ) )
The value space of xs:time with given timezone for both arguments.
Iexternal( ?arg1 ?arg2; func:subtract-times( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-times(s1 s2) as defined in [XPath-Functions].
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 xs:times with explicit timezone, i.e. RIF leaves the return value for xs:date arguments values without a timezone unspecified.
( ?arg1 ?arg2; func:add-yearMonthDurations( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:yearMonthDuration for both ?arg1 and ?arg2 such that fn:add-yearMonthDurations does not result in a duration operation overflow/underflow error err:FODT0002 or in a value from the xs:yearMonthDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-yearMonthDurations( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-yearMonthDurations(s1 s2) as defined in [XPath-Functions].
If any argument value is outside of its domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:subtract-yearMonthDurations( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:yearMonthDuration for both ?arg1 and ?arg2 such that fn:subtract-yearMonthDurations does not result in a duration operation overflow/underflow error err:FODT0002 or in a value from the xs:yearMonthDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-yearMonthDurations( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-yearMonthDurations(s1 s2) as defined in [XPath-Functions].
If any argument value is outside of its domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:multiply-yearMonthDuration( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:yearMonthDuration for ?arg1 and xs:integer, xs:double, xs:float, or xs:decimal for ?arg2 such that fn:multiply-yearMonthDuration does not result in a duration operation overflow/underflow error err:FODT0002, NaN supplied as double value error err:FOCA0005, or in a value from the xs:yearMonthDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:multiply-yearMonthDuration( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:multiply-yearMonthDuration(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:divide-yearMonthDuration( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:yearMonthDuration for ?arg1 and xs:integer, xs:double, xs:float, or xs:decimal for ?arg2 such that fn:divide-yearMonthDuration does not result in a duration operation overflow/underflow error err:FODT0002, NaN supplied as double value error err:FOCA0005, or in a value from the xs:yearMonthDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:divide-yearMonthDuration( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:divide-yearMonthDuration(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:divide-yearMonthDuration-by-yearMonthDuration( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:yearMonthDuration for both ?arg1 and ?arg2 such that fn:divide-yearMonthDuration-by-yearMonthDuration does not result in a duration operation overflow/underflow error err:FODT0002 or in a value from the xs:yearMonthDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:divide-yearMonthDuration-by-yearMonthDuration( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:divide-yearMonthDuration-by-yearMonthDuration(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:add-dayTimeDurations( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value space of xs:dayTimeDuration for ?arg1 and ?arg2 such that fn:add-dayTimeDurations does not result in a duration operation overflow/underflow error err:FODT0002 or in a value from the xs:dayTimeDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-dayTimeDurations( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-dayTimeDurations(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:subtract-dayTimeDurations( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value space of xs:dayTimeDuration for ?arg1 and ?arg2 such that fn:subtract-dayTimeDurations does not result in a duration operation overflow/underflow error err:FODT0002 or in a value from the xs:dayTimeDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-dayTimeDurations( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-dayTimeDurations(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:multiply-dayTimeDuration( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dayTimeDuration for ?arg1 and xs:integer, xs:double, xs:float, or xs:decimal for ?arg2 such that fn:multiply-dayTimeDuration does not result in a duration operation overflow/underflow error err:FODT0002, NaN supplied as double value error err:FOCA0005, or in a value from the xs:dayTimeDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:multiply-dayTimeDuration( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:multiply-dayTimeDuration(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:divide-dayTimeDuration( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dayTimeDuration for ?arg1 and xs:integer, xs:double, xs:float, or xs:decimal for ?arg2 such that fn:divide-dayTimeDuration does not result in a duration operation overflow/underflow error err:FODT0002, NaN supplied as double value error err:FOCA0005, or in a value from the xs:dayTimeDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:divide-dayTimeDuration( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:divide-dayTimeDuration(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2; func:divide-dayTimeDuration-by-dayTimeDuration( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dayTimeDuration for both ?arg1 and ?arg2 such that fn:divide-dayTimeDuration-by-dayTimeDuration does not result in a duration operation overflow/underflow error err:FODT0002 or in a value from the xs:dayTimeDuration value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:divide-dayTimeDuration-by-dayTimeDuration( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:divide-dayTimeDuration-by-dayTimeDuration(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:add-yearMonthDuration-to-dateTime( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dateTime for ?arg1 and xs:yearMonthDuration for ?arg2 such that fn:add-yearMonthDuration-to-dateTime does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:dateTime value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-yearMonthDuration-to-dateTime( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-yearMonthDuration-to-dateTime(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:add-yearMonthDuration-to-date( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:date for ?arg1 and xs:yearMonthDuration for ?arg2 such that fn:add-yearMonthDuration-to-date does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:date value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-yearMonthDuration-to-date( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-yearMonthDuration-to-date(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:add-dayTimeDuration-to-dateTime( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dateTime for ?arg1 and xs:dayTimeDuration for ?arg2 such that fn:add-dayTimehDuration-to-dateTime does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:dateTime value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-dayTimeDuration-to-dateTime( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-dayTimeDuration-to-dateTime(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:add-dayTimeDuration-to-date( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:date for ?arg1 and xs:dayTimeDuration for ?arg2 such that fn:add-dayTimehDuration-to-date does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:date value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-dayTimeDuration-to-date( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-dayTimeDuration-to-date(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:add-dayTimeDuration-to-time( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:time for ?arg1 and xs:dayTimeDuration for ?arg2 such that fn:add-dayTimehDuration-to-time does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:time value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:add-dayTimeDuration-to-time( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:add-dayTimeDuration-to-time(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:subtract-yearMonthDuration-from-dateTime( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dateTime for ?arg1 and xs:yearMonthDuration for ?arg2 such that fn:subtract-yearMonthDuration-from-dateTime does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:dateTime value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-yearMonthDuration-from-dateTime( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-yearMonthDuration-from-dateTime(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:subtract-yearMonthDuration-from-date( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:date for ?arg1 and xs:yearMonthDuration for ?arg2 such that fn:subtract-yearMonthDuration-from-date does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:date value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-yearMonthDuration-from-date( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-yearMonthDuration-from-date(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:subtract-dayTimeDuration-from-dateTime( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:dateTime for ?arg1 and xs:dayTimeDuration for ?arg2 such that fn:subtract-dayTimehDuration-from-dateTime does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:dateTime value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-dayTimeDuration-from-dateTime( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-dayTimeDuration-from-dateTime(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:subtract-dayTimeDuration-from-date( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:date for ?arg1 and xs:dayTimeDuration for ?arg2 such that fn:subtract-dayTimehDuration-from-date does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:date value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-dayTimeDuration-from-date( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-dayTimeDuration-from-date(s1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2 ; func:subtract-dayTimeDuration-from-time( ?arg1 ?arg2 ) )
The domain of this functions is made up of pairs of values from value spaces of xs:time for ?arg1 and xs:dayTimeDuration for ?arg2 such that fn:subtract-dayTimehDuration-from-time does not result in a date/time operation overflow/underflow error err:FODT0001 or in a value from the xs:time value space outside what minimal conformance as defined in Section 5.4 of [XML Schema Datatypes] requires for durations.
Iexternal( ?arg1 ?arg2; func:subtract-dayTimeDuration-from-time( ?arg1 ?arg2 ) )(s1 s2) = res
such that res is the result of fn:subtract-dayTimeDuration-from-Time1 s2) as defined in [XPath-Functions].
If the arguments are outside of the domain, the value of the function is left unspecified.
( ?arg1 ?arg2; pred:dateTime-equal( ?arg1 ?arg2) )
The value space of xs:dateTime for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:dateTime-equal( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:dateTime-equal(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:dateTime-less-than(?arg1 ?arg2 ) )
The value space of xs:dateTime for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:dateTime-less-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:dateTime-less-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:dateTime-greater-than(?arg1 ?arg2 ) )
The value space of xs:dateTime for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:dateTime-greater-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:dateTime-greater-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:date-equal( ?arg1 ?arg2) )
The value space of xs:date for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:date-equal( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:date-equal(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:date-less-than(?arg1 ?arg2 ) )
The value space of xs:date for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:date-less-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:date-less-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:date-greater-than(?arg1 ?arg2 ) )
The value space of xs:date for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:date-greater-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:date-greater-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:time-equal( ?arg1 ?arg2) )
The value space of xs:time for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:time-equal( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:time-equal(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:time-less-than(?arg1 ?arg2 ) )
The value space of xs:time for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:time-less-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:time-less-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:time-greater-than(?arg1 ?arg2 ) )
The value space of xs:time for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:time-greater-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:time-greater-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:duration-equal( ?arg1 ?arg2) )
The union of the value spaces of xs:dayTimeDuration and xs:yearMonthDuration for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:duration-equal( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:duration-equal(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:dayTimeDuration-less-than(?arg1 ?arg2 ) )
The value space of xs:dayTimeDuration for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:dayTimeDuration-less-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:dayTimeDuration-less-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:dayTimeDuration-greater-than(?arg1 ?arg2 ) )
The value space of xs:dayTimeDuration for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:dayTimeDuration-greater-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:dayTimeDuration-greater-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:yearMonthDuration-less-than(?arg1 ?arg2 ) )
The value space of xs:yearMonthDuration for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:yearMonthDuration-less-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:yearMonthDuration-less-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
( ?arg1 ?arg2; pred:yearMonthDuration-greater-than(?arg1 ?arg2 ) )
The value space of xs:yearMonthDuration for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:yearMonthDuration-greater-than( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if op:yearMonthDuration-greater-than(s1, s2) returns true, as defined in [XPath-Functions], f in case false is returned.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
(?arg1 ?arg2; pred:dateTime-not-equal( ?arg1 ?arg2) )
The predicate pred:dateTime-not-equal has the same domains as pred:dateTime-equal and is true whenever pred:dateTime-equal is false.
(?arg1 ?arg2; pred:dateTime-less-than-or-equal( ?arg1 ?arg2) )
The predicate pred:dateTime-less-than-or-equal has the same domains as pred:dateTime-equal and is true whenever pred:dateTime-equal is true or pred:dateTime-less-than is true.
(?arg1 ?arg2; pred:dateTime-greater-than-or-equal( ?arg1 ?arg2) )
The predicate pred:dateTime-greater-than-or-equal has the same domains as pred:dateTime-equal and is true whenever pred:dateTime-equal is true or pred:dateTime-greater-than is true.
(?arg1 ?arg2; pred:date-not-equal( ?arg1 ?arg2) )
The predicate pred:date-not-equal has the same domains as pred:date-equal and is true whenever pred:date-equal is false.
(?arg1 ?arg2; pred:date-less-than-or-equal( ?arg1 ?arg2) )
The predicate pred:date-less-than-or-equal has the same domains as pred:date-equal and is true whenever pred:date-equal is true or pred:date-less-than is true.
(?arg1 ?arg2; pred:date-greater-than-or-equal( ?arg1 ?arg2) )
The predicate pred:date-greater-than-or-equal has the same domains as pred:date-equal and is true whenever pred:date-equal is true or pred:date-greater-than is true.
(?arg1 ?arg2; pred:time-not-equal( ?arg1 ?arg2) )
The predicate pred:time-not-equal has the same domains as pred:time-equal and is true whenever pred:time-equal is false.
(?arg1 ?arg2; pred:time-less-than-or-equal( ?arg1 ?arg2) )
The predicate pred:time-less-than-or-equal has the same domains as pred:time-equal and is true whenever pred:time-equal is true or pred:time-less-than is true.
(?arg1 ?arg2; pred:time-greater-than-or-equal( ?arg1 ?arg2) )
The predicate pred:time-greater-than-or-equal has the same domains as pred:time-equal and is true whenever pred:time-equal is true or pred:time-greater-than is true.
(?arg1 ?arg2; pred:duration-not-equal( ?arg1 ?arg2) )
The predicate pred:duration-equal has the same domains as pred:duration-equal and is true whenever pred:duration-equal is false.
(?arg1 ?arg2; pred:dayTimeDuration-less-than-or-equal( ?arg1 ?arg2) )
The predicate pred:dayTimeDuration-less-than-or-equal has the same domains as pred:dayTimeDuration-less-than and is true whenever pred:duration-equal is true or pred:dayTimeDuration-less-than is true.
(?arg1 ?arg2; pred:dayTimeDuration-greater-than( ?arg1 ?arg2) )
The predicate pred:dayTimeDuration-greater-than-or-equal has the same domains as pred:dayTimeDuration-greater-than and is true whenever pred:duration-equal is true or pred:dayTimeDuration-greater-than is true.
(?arg1 ?arg2; pred:yearMonthDuration-less-than-or-equal( ?arg1 ?arg2) )
The predicate pred:yearMonthDuration-less-than-or-equal has the same domains as pred:yearMonthDuration-less-than and is true whenever pred:duration-equal is true or pred:yearMonthDuration-less-than is true.
(?arg1 ?arg2; pred:yearMonthDuration--greater-than( ?arg1 ?arg2) )
The predicate pred:yearMonthDuration-greater-than-or-equal has the same domains as pred:yearMonthDuration-greater-than and is true whenever pred:duration-equal is true or pred:yearMonthDuration-greater-than is true.
( ?arg1 ?arg2; pred:XMLLiteral-equal( ?arg1 ?arg2) )
The value space of rdf:XMLLiteral for both arguments.
When both s1 and s2 belong to their domains, Itruth ο Iexternal( ?arg1 ?arg2; pred:XMLLiteral-equal( ?arg1 ?arg2 ) )(s1 s2) = t
if and only if s1 = s2, f otherwise.
If an argument value is outside of its domain, the truth value of the function is left unspecified.
(?arg1 ?arg2; pred:XMLLiteral-not-equal( ?arg1 ?arg2) )
The predicate pred:time-not-equal has the same domains as pred:XMLLiteral-equal and is true whenever pred:XMLLiteral-equal is false.
The following functions and predicates are adapted from the respective functions and operators in [RDF-PLAINLITERAL].
(?arg1 ?arg2 ; func:PlainLiteral-from-string-lang( ?arg1 ?arg2 ) )
The value space of xs:string for ?arg1 and the intersection of the elements of the value space of xs:string which represent valid language tags according to [BCP-47] for ?arg2.
Iexternal((?arg1 ?arg2 ; func:PlainLiteral-from-string-lang( ?arg1 ?arg2 ) )(s l) = res such that res is the pair < s, l > in the value space of rdf:PlainLiteral.
If any argument value is outside of its domain, the value of the function is left unspecified.
(?arg ; func:string-from-PlainLiteral( ?arg ) )
The value space of rdf:PlainLiteral for ?arg.
Iexternal(?arg ; func:string-from-PlainLiteral( ?arg ) )(t) = res such that res is the string part s of t if t is a pair < s, l > or res = t if t is a string value.
If the argument value is outside of its domain, the value of the function is left unspecified.
(?arg ; func:lang-from-PlainLiteral( ?arg ) )
The value space of rdf:PlainLiteral for ?arg.
Iexternal(?arg ; func:lang-from-PlainLiteral( ?arg ) )(t) = l such that l is the language tag string of t if t is a pair < s, l > and ""^^xs:string if t is a string value.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?comparand1 ?comparand2; func:PlainLiteral-compare(?comparand1 ?comparand2) )
( ?comparand1 ?comparand2 ?collation; func:PlainLiteral-compare(?comparand1 ?comparand2 ?collation) )
The value space of rdf:PlainLiteral for ?comparand1 and $comparand2, and the empty set for ?collation.
Iexternal( ?comparand1 ?comparand2; func:PlainLiteral-compare(?comparand1 ?comparand2) )(t1 t2) = res such that, whenever t1=( s1, l ) and t2=( s2, l ) are two pairs with the same language tag l in the value space ofrdf:PlainLiteral, or two string values t1=s1 and t2=s2, respectively, then res = -1, 0, or 1 (from the value space of xs:integer), depending on whether the value of s1 is respectively less than, equal to, or greater than the value of s2 according to the default codepoint collation as defined in Section 7.3.1 of [XPath-Functions].
In case an argument value is outside of its domain, or if the language tags of the values for ?comparand1 and $comparand2 differ, the function value is left unspecified. That means RIF does not prescribe any specific collation apart from the default codepoint collation and - consequently - the result of this function with a given collation argument is not defined by RIF and may vary between implementations.
( ?arg ; func:PlainLiteral-length( ?arg ) )
The value space of rdf:PlainLiteral for ?arg.
Iexternal( ?arg ; func:PlainLiteral-length( ?arg ) )(s) = res such that res is a value in the value space of xs:integer equal to the length in characters of the string part s of the argument if it is a pair ( s,l ), or the argument is a string value s, respectively.
If the argument value is outside of its domain, the value of the function is left unspecified.
( ?input ?range; pred:matches-language-range( ?input ?range) )
The value space of rdf:PlainLiteral for ?input and the values of value space xs:string that correspond to valid language tags according to [BCP-47] for ?range.
Whenever both arguments are within their domains, <p>Iexternal ( ?input ?range; pred:matches-language-range( ?input ?range) )(i r) = t if and only if plfn:matches-language-range(i r) as specified in [RDF-PLAINLITERAL] returns true, f otherwise.
If an argument value is outside of its domain, the truth value of the predicate is left unspecified.
RIF Lists are similar to list and array types in many systems, as well as XPath/XQuery Sequences [XPath-Functions]. They differ from XPath as follows:
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.
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).
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 External(func:index-of( List(ex:foo ex:bar) ex:foo) ) == List(0), because the empty ruleset provides no indication whether eg:foo = eg:bar.
(?object; pred:is-list(?object))
?object: unrestricted
Itruth ο Iexternal( ?object; pred:is-list ( ?object ) )(s) = t if and only if there exists some (t0, ... , tn) such that either Ilist(t0 ... tn) = s or Itail(t0, ... , tn) = s, and f otherwise.
Note, that since the syntactic forms of open and closed lists using the List operator refer to Ilist-1 and Itail-1, respectively, pred:is-list is always true on these syntactic forms. Further note that per definition Ilist(Dind) is disjoint from the value spaces of all data types in DTS, and consequently pred:is-list is always false on constants belonging to a datatype supported by the RIF dialect at hand. this is illustrated by the following examples.
(?list ?item; pred:list-contains(?list ?item))
?list: Dlist
?item: unrestricted
Itruth ο Iexternal( ?list ?item; pred:list-contains ( ?list ?item ) )(l s) = t if and only if Ilist-1(l) = (t0 ... tn) such that ti = s for some i between 0 and n, and f otherwise.
If an argument value is outside of its domain, the value of the function is left unspecified.
(?item1 ... ?itemn; func:make-list(?item1 ... ?itemn))
?item0: unrestricted
...
?itemn: unrestricted
Returns a list of the arguments ?item1, ... ?itemn, in the same order they appear as arguments. That is, Iexternal( ?item1 ... ?itemn; func:make-list( ?item1 ... ?itemn ) )(s1 ... sn) = Ilist(s1 ... sn)
This function is useful in RIF Core because the List construction operator is syntactically prohibited from being used with variables.
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))
(?list; func:count(?list))
?list: Dlist
Returns the number of entries in the list (the length of the list). That is, Iexternal( ?list; func:count( ?list ) )(l) = n if Ilist-1(l) = (t0 ... tn-1) is an element of Dindn.
If an argument value is outside of its domain, the value of the function is left unspecified.
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
(?list ?position; func:get(?list ?position))
?list: Dlist
?position: value space of xs:int
Returns the item at the given position in the list. That is, Iexternal( ?list ?position; func:get(?list ?position) )(l i) = ti if Ilist-1(l) = (t0 ... tn) and i corresponds to a position between 0 and n, as defined in Section Position Numbering.
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 Position Numbering the value of the function is left unspecified.
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)
(?list ?start ?stop; func:sublist(?list ?start ?stop))
(?list ?start; func:sublist(?list ?start))
?list: Dlist
?start: value space of xs:int
?stop: value space of xs:int
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, Iexternal( ?list ?start ?stop; func:sublist(?list ?start ?stop) )(l i j) = Ilist(ti ... tj) if Ilist-1(l) = (t0 ... tn) such that i and j correspond to positions between 0 and n, as defined in Section Position Numbering. In case i is omitted it defaults to n.
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 Position Numbering the value of the function is left unspecified.
This differs from XPath's fn:subsequence 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).
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)
(?list ?item1 ... ?itemn; func:append(?list ?item1 ... ?itemn))
?list: Dlist
?item1: unrestricted
...
?itemn: unrestricted
Returns a list consisting of all the items in ?list, followed by ?itemi, for each i, 1 <= i <= n. That is, Iexternal( ?list ?item1 ... ?itemn; func:append(?list ?item1 ... ?itemn) )(l s1 ... sn) = Ilist(t0 ... tk s1 ... sn) if Ilist-1(l) = (t0 ... tk).
If an argument value is outside of its domain, the value of the function is left unspecified.
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)
(?list1 ... ?listn; func:concatenate(?list1 ... ?listn))
Returns a list consisting of all the items in list1, followed by all the items in listi, for each i <= n. That is, Iexternal( ?list1 ... ?listn; func:concatenate(?list1 ... ?listn) )(l1 ... ln) = Ilist(t1,0 ... t1,k1 ... tn,0 ... tn,kn) if, for each i between 1 and n, Ilist-1(li) = (ti,0 ... ti,ki).
If an argument value is outside of its domain, the value of the function is left unspecified.
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)
(?list ?position ?newItem; func:insert-before(?list ?position ?newItem))
?list: Dlist
?position: value space of xs:int
?newItem: unrestricted
Return a list which is ?list, except that ?newItem is inserted at the given ?position, with the item (if any) that was at that position, and all following items, shifted down one position. That is, Iexternal( ?list ?position ?newItem; func:insert-before(?list ?position ?newItem) )(l i s) = Ilist(t0 ... ti-1 s ti ... tn) if Ilist-1(l) = (t0 ... tn) and i corresponds to a position between 0 and n, as defined in Section Position Numbering.
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 Position Numbering the value of the function is left unspecified.
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)
(?list ?position; func:remove(?list ?position))
?list: Dlist
?position: value space of xs:int
Returns a list which is ?list except that the item at the given ?position has been removed. That is, Iexternal( ?list ?position; func:remove(?list ?position) )(l i) = Ilist(t0 ... ti-1 ti+1 ... tn) if Ilist-1(l) = (t0 ... tn) and i corresponds to a position between 0 and n, as defined in Section Position Numbering.
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 Position Numbering the value of the function is left unspecified.
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)
(?list; func:reverse(?list))
?list: Dlist
Return a list with all the items in ?list, but in reverse order. That is, Iexternal( ?list; func:reverse(?list) )(l) = Ilist(tn ... t0) if Ilist-1(l) = (t0 ... tn).
If the argument value is outside of its domain, the value of the function is left unspecified.
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()
(?list ?matchValue; func:index-of(?list ?matchValue))
?list: Dlist
?matchValue: unrestricted
Returns the ascending list of all integers, i>=0, such that External( func:get(?list,i) ) = ?matchValue. That is, Iexternal(?list ?matchValue; func:index-of(?list ?matchValue))(l v) = Ilist(i1 ... ik) if Ilist-1(l) = (t0 ... tn) such that (i1 ... ik) is the ordered list of positions (as defined in Section Position Numbering) between 0 and n with ti1 = ... = tik = v.
If an argument value is outside of its domain, the value of the function is left unspecified.
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()
(?list1 ... ?listn; func:union(?list1 ... ?listn))
Returns a list containing all the items in ?list1, ..., ?listn, in the same order, but with all duplicates removed.
If an argument value is outside of its domain, the value of the function is left unspecified.
External( func:union(list1 ... listn) ) is equivalent to External( func:distinct_values(External( func:concatenate(list1 ... listn) ) ) ).
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)External( func:union(List(0 2 1 0)) ) = List( 0 2 1 )
(?list; func:distinct-values(?list))
?list: Dlist
Returns a list which contains exactly those items which are in ?list, in the order of first appearance, except that all except the first occurance of any item are deleted.
If an argument value is outside of its domain, the value of the function is left unspecified.
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)
(?list1 ... ?listn; func:intersect(?list1 ... ?listn))
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 ?list1.
If an argument value is outside of its domain, the value of the function is left unspecified.
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)
(?list1 ?list2; func:except(?list1 ?list2))
Returns a list which contains exactly those items which are in ?list1 and not in ?list2. The order of the items is the same as in ?list1.
If an argument value is outside of its domain, the value of the function is left unspecified.
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()
The RIF Framework for Logic Dialects introduces a general notion of externally defined terms and their schemes. However, RIF-BLD 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.
In RIF-FLD, an external term is an expression of the form External(id τ), where id is a term that identifies the source that defines the term τ and τ itself can be a constant, a positional or named-arguments term, a frame, an equality, or a classification term. In RIF-BLD, only positional and named-argument terms are allowed as τ, and RIF-DTB builtins can only be positional terms. So, only a restricted kind of external terms is used: External(τ), where τ has one of the aforementioned forms. If τ is a term of the form p(...) then External(τ) is treated as a shorthand for External(p τ), but this extended 2-argument form of External itself is not allowed in RIF-BLD.
External schemas 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.
Definition (Schema for external term). An external schema is a statement of the form (?X1 ... ?Xn; τ) where
The names of the variables in an external schema are immaterial, but their order is important. For instance, (?X ?Y; ?X[foo->?Y]) and (?V ?W; ?V[foo->?W]) are considered to be indistinguishable, but (?X ?Y; ?X[foo->?Y]) and (?Y ?X; ?X[foo->?Y]) are viewed as different schemas.
Note that RIF-FLD defines external schemas as triples (id; ?X1 ... ?Xn; τ), where id is the identifying term for the schema's source. However, since RIF-BLD uses a simplified version of externally defined terms in which id is determined by the predicate/function name in τ, the id-part is omitted in the above simplified version of external schemas.
A term t is an instantiation of an external schema (?X1 ... ?Xn; τ) iff t can be obtained from τ by a simultaneous substitution ?X1/s1 ... ?Xn/sn of the variables ?X1 ... ?Xn with terms s1 ... sn, respectively. Some of the terms si can be variables themselves. For example, ?Z[foo->f(a ?P)] is an instantiation of (?X ?Y; ?X[foo->?Y]) by the substitution ?X/?Z ?Y/f(a ?P). ☐
Observe that a variable cannot be an instantiation of an external schema, since τ in the above definition cannot be a variable. It will be seen later that this implies that a term of the form External(?X) is not well-formed in RIF.
The intuition behind the notion of an external schema, such as (?X ?Y; ?X["foo"^^xs:string->?Y]) or (?V; "pred:isTime"^^rif:iri(?V)), is that ?X["foo"^^xs:string->?Y] or "pred:isTime"^^rif:iri(?V) are invocation patterns for querying external sources, and instantiations of those schemas correspond to concrete invocations. Thus, External("http://foo.bar.com"^^rif:iri["foo"^^xs:string->"123"^^xs:integer]) and External("pred:isTime"^^rif:iri("22:33:44"^^xs:time) are examples of invocations of external terms -- one querying an external source and another invoking a built-in.
Definition (Coherent set of external schemas).
A set of external schemas is coherent if there is no term, t, that is an instantiation of two distinct schemas in the set. ☐
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 (?X ?Y; ?X[foo->?Y]) and (?Y ?X; ?X[foo->?Y]), which differ only in the order of their variables, cannot be in the same coherent set.
It is important to keep in mind that external schemas are not 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.