OntopDatatypes - ConstantB/ontop-spatial GitHub Wiki

Types in Ontop

OWL2QL Datatypes

  • rdfs:Literal Every literal in RDF is an instance of rdfs:Literal, every XML Schema data is also an instance of rdfs:Literal.

  • xsd:decimal It represents a subset of the real numbers, which can be represented by decimal numerals. Precision is not reflected in this value space.

  • xsd:integer It is derived from decimal by fixing the value of fractionDigits to be 0 and disallowing the trailing decimal point.

  • xsd:nonNegativeInteger It is derived from integer by setting the value of maxInclusive to be 0.

  • xsd:string The string datatype represents character strings in XML.

  • xsd:dateTime This datatype describes instances identified by the combination of a date and a time in the format:

    [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]
    
  • xsd:dateTimeStamp a specific date and time in the format. Its only difference from dateTime is that the time zone expression is required at the end of the value:

     [-]CCYY-MM-DDThh:mm:ssZ | [-]CCYY-MM-DDThh:mm:ss(+|-)hh:mm 
    

Not supported yet:

  • rdf:PlainLiteral An rdf:PlainLiteral lexical form is a string of the form "abc@langTag" where "abc" is an arbitrary (possibly empty) string, and "langTag" is either the empty string or a (not necessarily lowercase) language tag. If no information is specified for a string, we refer to rdfs:PlainLiteral

  • rdf:XMLLiteral The class rdf:XMLLiteral is a subclass of rdfs:Literal and a class of all XML Schema data, which includes xsd:string and xsd:decimal and so on.

  • owl:real The value space of owl:real is the set of all real numbers.

  • owl:rational It is a subset of owl:real and contains xsd:decimal. It contains all rational numbers.

  • xsd:normalizedString It represents white space normalized strings. It is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The basic type is string.

  • xsd:token It represents tokenized strings. It is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The basic type is normalizedString

  • xsd:Name Name represents XML Names, which can be used as an element-type name or attribute name, among other things. The basic type is token.

  • xsd:NCName NCName represents XML "non-colonized" Names, a name that does not contain colons.

  • xsd:NMTOKEN The type xsd:NMTOKEN represents a single string token.

  • xsd:hexBinary It represents arbitrary hex-encoded binary data. It has a sequence of binary octets. It uses hexadecimal encoding, where each binary octet is a two-character hexadecimal number.

  • xsd:base64Binary It represents arbitrary Base64-encoded binary data. as a sequence of binary octets. It uses base64 encoding, as described in RFC 3548.

  • xsd:anyURI It represents a Uniform Resource Identifier (URI) reference. His type should be used when the value fulfills the role of an IRI or its successor.

Supported datatypes not in OWL2QL Standard:

  • xsd:double It represents an IEEE double-precision 64-bit floating-point number. Subset of real numbers.

  • xsd:float It represents an IEEE single-precision 32-bit floating-point number.

  • xsd:nonPositiveInteger It is derived from integer by setting the value of maxInclusive to be 0.

  • xsd:positiveInteger It is derived from integer by setting the value of minInclusive to be 1.

  • xsd:negativeInteger It is derived from integer by setting the value of maxInclusive to be 1. Derived by nonPositiveInteger.

  • xsd:long It is derived from integer by setting the value of maxInclusive to be 9223372036854775807 and minInclusive to be -9223372036854775808. The basic type is integer.

  • xsd:int It is derived by setting the value of maxInclusive to be 2147483647 and minInclusive to be -2147483648. The basic type is long.

  • xsd:unsignedInt It is derived from unsignedLong by setting the value of maxInclusive to be 4294967295. unsignedLong is a subset of nonNegativeInteger.

  • xsd:boolean It represents the values of two-valued logic, logical yes/no values. The valid values for xsd:boolean are true, false, 0, and 1.

Other supported datatypes outside OWL standard:

  • xsd:gYear gYear represents Gregorian calendar years. Month, day and time has to be absent. Timezone is optional.

  • xsd:time time represents instants of time that recur at the same point in each calendar day. Date is required to be absent.

  • xsd:date It represents top-open intervals of exactly one day in length on the timelines of dateTime. The time has to be absent, while the timezone is optional.

Ontop datatypes (Predicate COL_TYPE)

  • UNSUPPORTED (-1)
  • NULL (0)
  • OBJECT (1)
  • BNODE (2)
  • LITERAL (3)
  • LITERAL_LANG (-3)
  • INTEGER (4)
  • DECIMAL (5)
  • DOUBLE (6)
  • STRING (7)
  • DATETIME (8)
  • BOOLEAN (9)
  • DATE (10)
  • TIME (11)
  • YEAR (12)
  • LONG (13)
  • FLOAT (14)
  • NEGATIVE_INTEGER (15)
  • NON_NEGATIVE_INTEGER (16)
  • POSITIVE_INTEGER (17)
  • NON_POSITIVE_INTEGER (18)
  • INT (19)
  • UNSIGNED_INT (20)

Java SQL types

  • VARCHAR
  • CHAR
  • LONGNVARCHAR
  • LONGVARCHAR
  • NVARCHAR
  • NCHAR
  • INTEGER
  • BIGINT
  • SMALLINT
  • TINYINT
  • NUMERIC
  • DECIMAL
  • FLOAT
  • DOUBLE
  • REAL
  • DATE
  • TIME
  • TIMESTAMP
  • BOOLEAN
  • BIT
  • CLOB
  • OTHER

OWL2 ontology datatypes

  • XSD_DECIMAL
  • XSD_STRING
  • XSD_INTEGER
  • XSD_NON_NEGATIVE_INTEGER
  • XSD_DATE_TIME
  • XSD_INT
  • XSD_POSITIVE_INTEGER
  • XSD_NEGATIVE_INTEGER
  • XSD_NON_POSITIVE_INTEGER
  • XSD_UNSIGNED_INT
  • XSD_DOUBLE
  • XSD_FLOAT
  • XSD_LONG
  • XSD_BOOLEAN
  • RDF_PLAIN_LITERAL
  • RDFS_LITERAL
  • XSD_DATE_TIME_STAMP

Database related types

See ObdalibQuestDataTypes for cross compatibility.

Translations inside Ontop

From Java JDBC SQL to Ontop types (JDBCTypeMapper)

  • VARCHAR <-> LITERAL
  • CHAR -> LITERAL
  • LONGNVARCHAR -> LITERAL
  • LONGVARCHAR -> LITERAL
  • NVARCHAR -> LITERAL
  • NCHAR -> LITERAL
  • INTEGER -> INTEGER (INT?)
  • BIGINT <-> INTEGER
  • SMALLINT -> INTEGER
  • TINYINT -> INTEGER
  • NUMERIC -> DECIMAL
  • DECIMAL <-> DECIMAL
  • FLOAT -> DOUBLE (FLOAT?)
  • DOUBLE <-> DOUBLE
  • REAL -> DOUBLE
  • DATE <-> DATE
  • TIME <-> TIME
  • TIMESTAMP <-> DATETIME
  • BOOLEAN <-> BOOLEAN
  • BIT -> BOOLEAN
  • CLOB -> LITERAL
  • OTHER -> LITERAL

From XSD to Ontop type (DatatypeFactoryImpl)

  • RDFS.LITERAL <-> LITERAL
  • XSD_INTEGER <-> INTEGER
  • XSD_DECIMAL <-> DECIMAL
  • XSD_DOUBLE <-> DOUBLE
  • XSD_STRING <-> COL_TYPE.STRING
  • XSD_DATETIME <-> DATETIME
  • XSD_BOOLEAN <-> BOOLEAN
  • XSD_DATE <-> DATE
  • XSD_TIME <-> TIME
  • XSD_YEAR <-> YEAR
  • XSD_LONG <-> LONG
  • XSD_FLOAT <-> FLOAT
  • XSD_NEGATIVE_INTEGER<-> NEGATIVE_INTEGER
  • XSD_NON_NEGATIVE_INTEGER <-> NON_NEGATIVE_INTEGER
  • XSD_POSITIVE_INTEGER<-> POSITIVE_INTEGER
  • XSD_NON_POSITIVE_INTEGER <-> NON_POSITIVE_INTEGER
  • XSD_INT <-> INT
  • XSD_UNSIGNED_INT<-> UNSIGNED_INT
  • RDFS_LITERAL_LANG <- LITERAL_LANG ?

From OWL2 datatype to Ontop type (OWLTypeMapper)

  • XSD_DECIMAL <-> DECIMAL
  • XSD_STRING <-> STRING
  • XSD_INTEGER <-> INTEGER
  • XSD_NON_NEGATIVE_INTEGER <-> NON_NEGATIVE_INTEGER
  • XSD_DATE_TIME <-> DATETIME

Non in OWL2QL:

  • XSD_INT <-> INT
  • XSD_POSITIVE_INTEGER <-> POSITIVE_INTEGER
  • XSD_NEGATIVE_INTEGER <-> NEGATIVE_INTEGER
  • XSD_NON_POSITIVE_INTEGER <-> NON_POSITIVE_INTEGER
  • XSD_UNSIGNED_INT <-> UNSIGNED_INT
  • XSD_DOUBLE <-> DOUBLE
  • XSD_LONG <-> LONG
  • XSD_BOOLEAN <-> BOOLEAN
  • XSD_FLOAT <-> DOUBLE (FLOAT?)
  • RDF_PLAIN_LITERAL <-> LITERAL
  • RDFS_LITERAL -> LITERAL
  • XSD_DATE_TIME_STAMP <-> DATETIME

Types not supported in OWL:

  • DATE -> RDF_PLAIN_LITERAL
  • TIME -> RDF_PLAIN_LITERAL
  • YEAR -> RDF_PLAIN_LITERAL

From Java JDBC type to Database SQL (DialectAdapter classes)