Warning:
This wiki has been archived and is now read-only.
DatatypeRescue
Contents
XML Schema Datatype Definitions
The OWL 2 language reuses the basic framework of the XML Schema simple datatype system as well as a number of its predefined datatypes. OWL 2 was designed in light of the work on XML Schema 1.1 and earlier versions of the specification normatively referenced XML Schema 1.1. Unfortunately, OWL 2 advanced toward Recommendation much more quickly than XML Schema 1.1 and thus OWL 2 could not normatively reference it. This section extracts (and slightly massages) the definitions for the various built-in types and facets from the XML Scheam 1.1 specification to provide an acceptable reference target. It is intended that the definitions align exactly with those of http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/ and the eventual recommendation itself. We expect this section to be "edited out" at the appropriate time.
Decimals, Integers, and Floats
The following XSD datatypes are required. xsd:decimal is the base type from which all others are derived, both in their lexical space and their value space. In the OWL 2 dataty
- xsd:decimal
- xsd:integer
- xsd:nonNegativeInteger
- xsd:nonPositiveInteger
- xsd:positiveInteger
- xsd:negativeInteger
- xsd:long
- xsd:int
- xsd:short
- xsd:byte
- xsd:unsignedLong
- xsd:unsignedInt
- xsd:unsignedShort
- xsd:unsignedByte
- xsd:float
- xsd:double
The lexical spaces of all XSD numeric types are defined in terms of the following productions:
e
' | 'E
') noDecimalPtNumeral
xsd:decimal
Value Space | The ·value space· of decimal is the set of numbers that can be obtained by dividing an integer by a non-negative power of ten, i.e., expressible as i / 10n where i and n are integers and n ≥ 0. Precision is not reflected in this value space; the number 2.0 is not distinct from the number 2.00. The order relation on decimal is the order relation on real numbers, restricted to this subset. The value space of xsd:decimal is a subset of the value space of owl:rational. |
Lexical Space |
xsd:integer
Value Space | The ·value space· of integer is the infinite set {...,-2,-1,0,1,2,...}. The ·base type· of integer is xsd:decimal. |
Lexical Space | xsd:integer has a lexical representation consisting of a finite-length sequence of one or more decimal digits (#x30-#x39) with an optional leading sign. If the sign is omitted, "+" is assumed. It is a subset of the lexicals pace of xsd:decimal. |
xsd:nonNegativeInteger
Value Space | The ·value space· of nonNegativeInteger is the infinite set {0,1,2,...}. The ·base type· of nonNegativeInteger is integer. |
Lexical Space | nonNegativeInteger has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, the positive sign ('+') is assumed. If the sign is present, it must be "+" except for lexical forms denoting zero, which may be preceded by a positive ('+') or a negative ('-') sign. It is a subset of the lexicals space of xsd:decimal. |
xsd: nonPositiveInteger
Value Space | The ·value space· of nonPositiveInteger is the infinite set {...,-2,-1,0}. The ·base type· of nonPositiveInteger is integer. |
Lexical Space | xsd:nonPositiveInteger has a lexical representation consisting of an optional preceding sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39). The sign may be "+" or may be omitted only for lexical forms denoting zero; in all other lexical forms, the negative sign ('-') must be present. It is a subset of the lexical space of xsd:decimal. |
xsd: positiveInteger
Value Space | The ·value space· of positiveInteger is the infinite set {1,2,...}. The ·base type· of positiveInteger is nonNegativeInteger. |
Lexical Space | xsd:positiveInteger has a lexical representation consisting of an optional positive sign ('+') followed by a non-empty finite-length sequence of decimal digits (#x30-#x39). For example: 1, 12678967543233, +100000. It is a subset of the lexical space of xsd:decimal. |
xsd: negativeInteger
Value Space | The ·value space· of negativeInteger is the infinite set {...,-2,-1}. The ·base type· of negativeInteger is nonPositiveInteger. |
Lexical Space | xsd:negativeInteger has a lexical representation consisting of a negative sign ('-') followed by a non-empty finite-length sequence of decimal digits (#x30-#x39). It is a subset of the lexical space of xsd:decimal. |
xsd:
Value Space | |
Lexical Space | xsd: |
xsd:
Value Space | |
Lexical Space | xsd: |
Floating-Point Numbers
xsd:float
Value Space | The ·value space· of float contains a copy distinct from owl:real and xsd:double of the non-zero numbers m × 2e , where m is an integer whose absolute value is less than 224, and e is an integer between −149 and 104, inclusive. In addition to these values, the ·value space· of float also contains the following ·special values·: positiveZero, negativeZero, positiveInfinity, negativeInfinity, and notANumber. |
Lexical Space |
floatRep ::= noDecimalPtNumeral | decimalPtNumeral |
scientificNotationNumeral | numericalSpecialRep
|
Lexical Space to Value Space Mappings
d | : | matches digit |
-
0 when d = '
0
' , -
1 when d = '
1
' , -
2 when d = '
2
' , -
etc.
S | : | a finite sequence of ·literals·, each term matching digit. |
S | : | a finite sequence of ·literals·, each term matching digit. |
N | : | matches fracFrag |
N | : | matches unsignedNoDecimalPtNumeral |
N | : | matches noDecimalPtNumeral |
+
' or '-
') and then
a ·literal· U that matches unsignedNoDecimalPtNumeral.-
−1 × ·unsignedNoDecimalMap·(U) when '
-
' is present, and -
·unsignedNoDecimalMap·(U) otherwise.
D | : | matches unsignedDecimalPtNumeral |
-
·unsignedNoDecimalMap·(N) when F is not present,
-
·fractionFragValue·(F) when N is not present, and
-
·unsignedNoDecimalMap·(N) + ·fractionFragValue·(F) otherwise.
N | : | matches decimalPtNumeral |
+
' or '-
') and then
an instance U of unsignedDecimalPtNumeral.-
−·unsignedDecimalPtMap·(U) when '
-
' is present, and -
·unsignedDecimalPtMap·(U) otherwise.
N | : | matches scientificNotationNumeral |
e
' or an 'E
', and then an instance E of noDecimalPtNumeral.-
·noDecimalMap·(C) − 10 ^ ·unsignedDecimalPtMap·(E) otherwise.
Facet Spaces.
Each pair of the form... | ...is mapped to... |
---|---|
( xsd:minInclusive , v ) where v is from the value space of owl:real |
the set of all numbers x from the value space of DT such that x = v or x > v |
( xsd:maxInclusive , v ) where v is from the value space of owl:real |
the set of all numbers x from the value space of DT such that x = v or x < v |
( xsd:minExclusive , v ) where v is from the value space of owl:real |
the set of all numbers x from the value space of DT such that x > v |
( xsd:maxExclusive , v ) where v is from the value space of owl:real |
the set of all numbers x from the value space of DT such that x < v |
Note. DT is either owl:real or owl:rational. |
Strings
The OWL 2 datatype map provides the rdf:PlainLiteral datatype for the representation of strings in a particular language. The definitions of the value space, the lexical space, the facet space, and the necessary mappings are given in [RDF:PLAINLITERAL]. The normative constraining facets for rdf:PlainLiteral are xsd:length, xsd:minLength, xsd:maxLength, xsd:pattern, and rdf:langRange; furthermore, only basic language ranges [BCP 47] are normative in the rdf:langRange constraining facet.
In addition, OWL 2 supports the following datatypes defined in XML Schema [XML Schema Datatypes]:
- xsd:string
- xsd:normalizedString
- xsd:token
- xsd:language
- xsd:Name
- xsd:NCName
- xsd:NMTOKEN
As explained in [RDF:PLAINLITERAL], the value spaces of all of these datatypes are contained in the value space of rdf:PlainLiteral. Furthermore, for each datatype from the above list, the normative constraining facets are xsd:length, xsd:minLength, xsd:maxLength, and xsd:pattern.
Boolean Values
The OWL 2 datatype map provides the xsd:boolean XML Schema datatype [XML Schema Datatypes] for the representation of Boolean values. No constraining facet is normative for this datatype.
Binary Data
The OWL 2 datatype map provides the following XML Schema datatypes [XML Schema Datatypes] for the representation of binary data:
- xsd:hexBinary
- xsd:base64Binary
As specified in XML Schema [XML Schema Datatypes], the value spaces of these two datatypes are disjoint. For each datatype from the above list, the normative constraining facets are xsd:minLength, xsd:maxLength, and xsd:length.
The first axiom states that all values of the a:personID property must be in the value space of xsd:base64Binary, but the second axiom provides a value for a:personID that is in the value space of xsd:hexBinary. Since the value spaces of xsd:hexBinary and xsd:base64Binary are disjoint, the above ontology is inconsistent.
IRIs
The OWL 2 datatype map provides the xsd:anyURI XML Schema datatype [XML Schema Datatypes] for the representation of IRIs. As specified in XML Schema [XML Schema Datatypes], the value spaces of xsd:anyURI and xsd:string are disjoint. The normative constraining facets are xsd:minLength, xsd:maxLength, xsd:length, and xsd:pattern.
According to XML Schema, the value space of xsd:anyURI is the set of all IRIs. Although each IRI has a string representation, IRIs are not strings. The value space of xsd:anyURI can therefore be seen as an "isomorphic copy" of a subset of the value space of xsd:string.
The lexical forms of xsd:anyURI include relative IRIs. If an OWL 2 syntax employs rules for the resolution of relative IRIs (e.g., the OWL 2 XML Syntax [OWL 2 XML Serialization] uses xml:base for that purpose), such rules do not apply to xsd:anyURI lexical forms that represent relative IRIs; that is, the lexical forms representing relative IRIs MUST be parsed as they are.
Time Instants
The OWL 2 datatype map provides the following XML Schema datatypes [XML Schema Datatypes] for the representation of time instants with and without time zone offsets:
- xsd:dateTime
- xsd:dateTimeStamp
For each datatype from the above list, the normative constraining facets are xsd:minInclusive, xsd:maxInclusive, xsd:minExclusive, and xsd:maxExclusive. An OWL 2 implementation MAY support all lexical forms of these datatypes; however, it MUST support at least the lexical forms listed in Section 5.4 of XML Schema Datatypes [XML Schema Datatypes].