Previous topic  Top  Next topic  Print this Topic
 

Internal Model and Round-Tripping

 

Inside OntoBroker RDF all statements are stored in a predicate-based, optimized structure. Depending on the RDF predicate of a statement, different "tables" are used. By activating one of the names ground options, this diversification will be even more sophisticated. Adapting the RDF graph model to the internal predicate-based model imposes some restrictions on data types. During reasoning and query answering, performance is of outmost importance. One of the limiting factors, e.g. for join operations, is the efficient comparison of RDF terms regarding equality. This particularly affects RDF literals. For example, comparing two numeric literals "42"^^xsd:short with "42"^^xsd:integer is more expensive compared to a simply object identity check due to necessary type conversions, assuming that the same objects share their identity, which is the case in OntoBroker RDF. On the decision between efficient reasoning and data type preservation we favored performance. As a result, some of the numeric XML Schema data types are irreversibly mapped to a unified internal representation. The table below shows those conversions.

Original data type

Mapped data type

xsd:double

xsd:float

xsd:double

xsd:int

xsd:long

xsd:integer

xsd:byte

xsd:short

xsd:decimal

xsd:negativeInteger

xsd:positiveInteger

xsd:nonNegativeInteger

xsd:nonPositiveInteger

xsd:unsignedByte

xsd:unsigendInt

xsd:unsignedLong

xsd:unsigendShort

xsd:int

xsd:long

xsd:integer

xsd:decimal

xsd:double and xsd:float are mapped to xsd:double. The differentiation between xsd:int/.../xsd:decimal is based on the value of the literal. For a uniform mapping every numeric literal is cast to the data type with the minimal value range containing the value. Therefore "32"^^xsd:integer and "32"^^xsd:long are both internally represented by "32"^^xsd:int. This conversion also affects the round-tripping behavior for RDF ontologies. Any other RDF terms like literals with user-defined data types are preserved. Blank nodes are also supported. The blank node identifiers are adapted during import in order to ensure uniqueness even in the case of graph merging. However, this will not affect the proper semantics of blank nodes.