Abstract

The Allotrope Data Format (ADF) [ADF] consists of several APIs, taxonomies and ontologies. This document describes the Allotrope Data Format Data Cube to HDF5 Mapping Ontology (ADF-DCO-HDF). While the ADF Data Cube Ontology [ADF-DCO] provides the business description of n-dimensional data cubes, ADF-DCO-HDF provides the vocabulary and structure for mapping these data cubes to HDF data sets [HDF5]. The ADF-DCO itself is based on the RDF Data Cube Vocabulary [QB]. However, while in QB and correspondingly ADF-DCO, data is expressed in form of triples, ADF in general allows data to be stored also natively in HDF5 file format which is more efficient, when dealing with large volumes of numerical data. The main entity in ADF-DCO-HDF is the HDF Mapping which consists of an index structure definition, one or more scale mappings and one mapping structure definition.

Disclaimer

THESE MATERIALS ARE PROVIDED "AS IS" AND ALLOTROPE EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF NON-INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current Allotrope publications and the latest revision of this technical report can be found in the Allotrope technical reports index at http://purl.allotrope.org/TR/.

This document is part of a set of specifications on the Allotrope Data Format (ADF)[ADF].

This document was published by the Allotrope Foundation as a First Public Working Draft. This document is intended to become an Allotrope Recommendation. If you wish to make comments regarding this document, please send them to more.info@allotrope.org. All comments are welcome.

Publication as a First Public Working Draft does not imply endorsement by the Allotrope Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Table of Contents


1. Introduction

The Allotrope Data Format (ADF) [ADF] defines an interface for storing scientific observations from analytical chemistry. It is intended for long-term stability of archived analytical data and fast real-time access to it. The ADF Data Cube API (ADF-DC) defines an interface for storing raw analytical data. The meta data of data cubes is specified in terms of ADF Data Cube Ontology (ADF-DCO) [ADF-DCO] which is based on the RDF Data Cube Vocabulary [QB]. ADF-DCO-HDF provides classes and properties to define the mapping between the abstract data cubes defined by the terms of the data cube ontology to their concrete HDF5 representations in the ADF file. The structure and metadata of HDF5 objects are described by a HDF5 ontology, which is based on the HDF5 specifications [HDF5].

This document is structured as follows: First, the role of the ADF Data Cube API within the high-level structure of ADF [ADF] API stack is presented. Then, the requirements for the ADF Data Cube to HDF5 Mapping Ontology are described, and an overview of the structure of ADF-DCO-HDF and the relations to ADF-DCO and the HDF5 are summarized.

ADF-DCO-HDF will be published under http://purl.allotrope.org/ontologies/datacube-hdf-map

1.1 Document Conventions

1.1.1 Naming Conventions

The IRI of an entity has two parts: the namespace and the local identifier. Within one RDF document the namespace might be associated by a shorter prefix. For instance the namespace IRI http://www.w3.org/2002/07/owl# is commonly associated with the prefix owl: and one can write owl:Class instead of the full IRI http://www.w3.org/2002/07/owl#Class.

Within the biomedical domain the local identifier is often an alphanumeric ID which is not human readable. The Allotrope Foundation Taxonomies follow this approach, e.g. a process is represented as af-p:AFP_0001617. To enhance readability within this document, the preferred label from the ontology or taxonomy is used for the corresponding entity. I.e., instead of af-p:AFP_0001617 the corresponding entity is named as af-p:process. If the namespace is clear by the context the prefix MAY be omitted and the entity is named simply process. If the label contains spaces, the entity MAY be surrounded by Guillemets to avoid ambiguities, e.g. «af-p:experimental method».

1.1.2 Number Formatting

Within this document, decimal numbers will use a dot "." as the decimal mark.

1.1.3 Namespaces

Within this specification, the following namespace prefix bindings are used:

Prefix Namespace
owl:http://www.w3.org/2002/07/owl#
rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs:http://www.w3.org/2000/01/rdf-schema#
xsd:http://www.w3.org/2001/XMLSchema#
skos:http://www.w3.org/2004/02/skos/core#
dct:http://purl.org/dc/terms/
qudt:http://qudt.org/schema/qudt#
qudt-unit:http://qudt.org/vocab/unit#
qudt-quantity:http://qudt.org/vocab/quantity#
qb:http://purl.org/linked-data/cube#
af-c:http://purl.allotrope.org/ontologies/common#
af-m:http://purl.allotrope.org/ontologies/material#
af-e:http://purl.allotrope.org/ontologies/equipment#
af-p:http://purl.allotrope.org/ontologies/process#
af-r:http://purl.allotrope.org/ontologies/result#
af-x:http://purl.allotrope.org/ontologies/property#
adf-dp:http://purl.allotrope.org/ontologies/datapackage#
adf-dc:http://purl.allotrope.org/ontologies/datacube#
adf-dc-hdf:http://purl.allotrope.org/ontologies/datacube-to-hdf5-map#
hdf:http://purl.allotrope.org/ontologies/hdf5/1.8#
afs-qudt:http://purl.allotrope.org/shapes/qudt#
afs-dc:http://purl.allotrope.org/shapes/datacube#
afs-dc-hdf:http://purl.allotrope.org/shapes/hdf-dc#
afs-hdf:http://purl.allotrope.org/shapes/hdf#
ex:http://example.com/ns#

1.1.4 Indication of Requirement Levels

Within this document the definitions of MUST, SHOULD and MAY are used as defined in [rfc2119].

2. ADF High-Level Structure

The following figure illustrates the high-level structure of the Allotrope Data Format (ADF) API stack:

Fig. 1 The high-level structure of the Allotrope Data Format (ADF) API stack.

This document focuses on the ADF Data Cube to HDF5 Mapping Ontology, which is used by the ADF Data Cube API [ADF-DC] highlighted in the figure above. The mapping ontology provides the bridge between the Data Cube API and the physical storage in HDF5.

3. Requirements

The ADF Data Cube to HDF5 Mapping Ontology (ADF-DCO-HDF) provides a data model for the mapping of data cubes to HDF5 data sets. Thus, the key requirements regarding of the ADF Data Cube Ontology are the following: ADF-DCO-HDF MUST provide data structures for

The following aspects MUST be considered when designing the mapping ontology to ensure usability, storage efficiency and performance:

4. ADF Data Cube to HDF5 Mapping Ontology High-Level Structure

The following figure illustrates the high-level structure of the ADF Data Cube (ADF-DC) API with the ADF Data Cube Ontology and its components.

Fig. 2 ADF Data Cube to HDF Mapping Ontology is the bridge between ADF DCO and HDF5.

ADF-DCO-HDF imports the ADF Data Cube Ontology (ADF-DCO) and the HDF5 ontology and thus defines a mapping between the business perspective and the physical representation of n-dimensional data in HDF5.

4.1 The ADF Data Cube Ontology

The ADF Data Cube ontology (ADF-DCO) extends the RDF Data Cube Vocabulary (QB) by scales, data selections, order functions and complex data types. Details on ADF-DCO can be found in the corresponding specification. The most important classes and relations are illustrated in the figure below. Details can be found in [ADF-DCO].

4.2 The HDF5 Ontology

The HDF5 ontology is based on the HDF5 specification. Sources for development were the DDL file and the HDF5 User's Guide. The role of the HDF5 ontology is to provide the structure and vocabulary for description of the physical representation of data stored in HDF5.

4.3 High-Level Class Relations

The following figure illustrates the relation between high-level classes of the mapping ontology with classes from the ADF Data Cube Ontology and the most important ones of the HDF5 Ontology.

Fig. 3 High-level relations between classes of the ADF Data Cube Ontology (ADF-DCO), classes of the RDF Data Cube Vocabulary (QB), the Mapping ADF-DCO-HDF mapping ontology and the HDF5 ontology.

ADF-DCO extends QB, HDF5 ontology provides the vocabulary to describe HDF5 data representations. ADF-DCO-HDF provides a bridge between the business view (expressed in QB and ADF-DCO terms) and the physical representation in HDF5 data sets. The QB classes qb:DataSet, qb:DataStructureDefinition and qb:ComponentSpecification remain central in ADF-DCO. Extension for selections and the mappings are defined in a parallel structure. A HDF mapping consists of an IndexStructureDefinition, one or more ScaleMappings and one MappingStructureDefinition, which in turn defines ComponentMappings. The details of the mapping are described in the next section.

5. ADF Data Cube to HDF5 Mapping Ontology - Concept Details

A mapping defines the mapping between the data structure definition of an RDF data cube and corresponding HDF5 data sets which contain the actual observations (or data points). A mapping consists of three essential parts:

The three parts of the HDF mapping are explained in detail in the following sections.

Fig. 4 A HDF mapping consists of an index structure definition, scale mappings and a mapping structure definition.

5.1 Index Structure Definition

In ADF-DCO, measures are components which are dependent of dimension components. Thus, the dimension components are used to specify an index for measurements (or measurement items). The index structure definition (ISD) is part of a HDF mapping and defines a set of indexes for the different dimension components of a data structure definition.

Fig. 5 Index structure definition with index and dimension component.

5.1.1 Index

An index is part of index structure definition and related to at least one dimension component of a data structure definition. All indexes of the ISD form a partition of the set of dimension components of the data structure definition. The values of the different dimension components are indexed according to their order number. The exact definition of the index MUST be specified by the framework. The order number of the index itself MAY be used by the framework to define the overall index structure on storage level.

If a data set has multiple dimension components, there are different ways to realize an ISD. The indexes of the ISD MUST define a partition of the set of dimension components. That is, for each dimension component there is exactly one index defined, but one index can cover multiple dimension components. Thus, there are two main strategies:

The next example illustrates the usage of an ISD for a cube with three dimensions - all with separate indices.

Example 1
ex:ISD a adf-dc-hdf:IndexStructureDefinition ;
adf-dc-hdf:index [
    a adf-dc-hdf:Index ;
    adf-dc-hdf:indexOn ex:dimension1 ;
    adf-dc:order "1" ;
] ;
adf-dc-hdf:index [
    a adf-dc-hdf:Index ;
    adf-dc-hdf:indexOn ex:dimension2 ;
    adf-dc:order "2" ;
] ;
adf-dc-hdf:index [
    a adf-dc-hdf:Index ;
    adf-dc-hdf:indexOn ex:dimension3 ;
    adf-dc:order "3" ;
] .
Note
The instance of an adf-dc-hdf:Index defines which dimensions are indexed together. The actual representation of the index MUST be implemented by the framework. For instance a cross product indexing MAY be defined for indexing multiple dimensions.

5.2 Scale Mapping

A scale mapping is part of a mapping and maps exactly one scale of a corresponding data structure definition from technical indices to scale values.

Fig. 6 A scale mapping defines the mapping of technical index for scale values.

5.2.1 Identity Scale Mapping

An identity scale mapping is a scale mapping where the scale value and the technical index are identical.

5.2.2 Explicit Scale Mapping

An explicit scale mapping is a scale mapping which maps a scale by specifying a dimension mapping which provides an explicit representation of the mapping through some HDF data set.

5.2.3 Function Scale Mapping

A function scale mapping is a scale mapping which is realized by an index function. Function scale mappings allow efficient access to scale values and also save storage space. Index functions work on numbers. The consequence is that the dimension's adf-dc:componentDatatype MUST be either a numeric datatype or if it is a complex datatype (shape), it MUST have an identifying property path stated by adf-dc:propertyPath, that points to a numeric datatype. In all other cases an explicit scale mapping MUST be used.

Example 2
ex:DurationDimension a adf-dc:Dimension, adf-dc:IntervalScale;
   qb:dimension «af-x:time» ;
   adf-dc:componentDatatype ex:DurationType ;
   .
ex:DurationType a sh:Shape;
   sh:property [
      sh:predicate qudt:numericValue;
      sh:datatype xsd:double;
      sh:minCount 1;
      sh:maxCount 1;
   ] , [
      sh:predicate qudt:unit;
      sh:minCount 1;
      sh:maxCount 1;
      sh:hasValue qudt-unit:SecondTime; # units are constant!
   ];
   .
ex:DurationDimensionScaleMapping a adf-dc-hdf:FunctionScaleMapping;
   adf-dc:propertyPath "qudt:numericValue"; # property path to the number of seconds, a primitive value
   adf-dc-hdf:indexFunction [
      a adf-dc-hdf:LinearFunction; # f(i) = 0.1 × i.
      adf-dc-hdf:parameter1 0E0;
      adf-dc-hdf:parameter2 1E-1;
   ];
   .
Note

A later version will allow the use of quantity values for indexing. The quantity is then equivalent to the value based on a normalized unit using the conversion factors and offsets defined for the unit. For this to work, the implementation MUST have access to the unit ontology. Currently this function is not implemented, so function scales work for quantity values, only if the shape states that the unit is constant.

The framework MUST provide at least the functions described in the next subsection:

5.2.3.1 Index Functions

An index function is a injective map from natural numbers to real numbers. ADF-DCO defines the following four index functions: LinearFunction, BinaryLogarithm, CommonLogarithm and NaturalLogarithm. All of these functions can be specified by its parameters as shown in the next figure. The framework MUST support all four index functions.

Fig. 7 The four different index functions which MAY be used to define function scale mappings.

The functions are defined as follows:

LinearFunction
A linear scale with the formula f(i) = p1 + p2 × i
BinaryLogarithm
A binary logarithm scale with the formula f(i) = p1 × 2 p2×i
CommonLogarithm
A common logarithm scale with the formula f(i) = p1 × 10 p2×i
NaturalLogarithm
A natural logarithm scale with the formula f(i) = p1 × e p2×i
with
i: the index - an integer starting from 0
p1: the first function parameter adf-dc-hdf:parameter1
p2: the second function parameter adf-dc-hdf:parameter2

5.3 Mapping Structure Definition

A mapping structure definition (MSD) describes how data types and data set structures defined in RDF with ADF-DCO are mapped to HDF5 data types and data sets. It consists of component mappings which define primitive or property mappings and refer to HDF5 data type mappings.

A component mapping is part of a mapping structure definition and maps a component specification (dimension or measure) to one or more HDF5 data sets. A component mapping has two subclasses DimensionMapping and MeasureMapping which are used to map dimension and measure components respectively as shown in the next figure:

Fig. 8 A component mapping is part of a mapping structure definition and defines primitive or property mappings, referring to HDF5 data type mappings.
The property adf-dc-hdf:mapsComponent is used for reference of the component specification at component mapping level. Depending on the associated component data type, different mappings are used: RDF data types include XSD data types such as xsd:integer or xsd:double, rdf:Resource etc. and also complex data types defined by shapes (which are possibly nested). The property adf-dc-hdf:representedBy is used for reference of the HDF5 data set for primitive or property mappings. In the following subsections component mappings are described in detail and illustrated by examples.

5.3.1 RDF to HDF Mapping

A RDF to HDF Mapping is part of a Component mapping and describes a mapping from an RDF type to a HDF type for a component data type or an attribute thereof. It is realized either by a adf-dc-hdf:PrimitiveMapping or a adf-dc-hdf:PropertyMapping.

5.3.2 HDF Data Type Mapping

The basic element of a primitive or property mapping is the adf-dc-hdf:HDFDataTypeMapping, which defines the low level mapping of RDF data types such as xsd:integer or xsd:double to HDF5 data types (e.g. H5T_IEEE_F64BE). An example of an HDF5 data type mapping is given in the following:

Example 3
# primitive data type mapping for xsd:double
ex:primitiveTypeMapDouble a adf-dc-hdf:HDFDataTypeMapping;
    adf-dc-hdf:rdfType xsd:double;
    adf-dc-hdf:hdfType hdf:H5T_IEEE_F64BE .

These adf-dc-hdf:HDFDataTypeMappings MAY be used in more complex settings as shown in the examples below.

5.3.3 Dictionaries

HDF5 is specifically designed to store numerical data. It is however not efficient to store strings in HDF5 data sets. ADF-DCO allows strings or IRIs to be used for component data types. These values are stored in a dictionary.

The dictionary functionality MUST be supported by the framework.

5.3.4 Primitive Mapping

A primitive mapping (adf-dc-hdf:PrimitiveMapping) is part of a component mapping and defines a HDF5 data type mapping for a primitive RDF data type and a HDF5 data set. The following example describes a result set of simple temperature measurements and a corresponding mapping to HDF5 data sets.

Example 4
# example observation
ex:obs01
    a qb:Observation;
    qb:dataSet ex:TempatureMeasurementResult;
    «af-x:index» 1;
    «af-x:temperature» 34.8 .      # primitive value

# The data set with data structure definition
ex:TempatureMeasurementResult
    a qb:DataSet;
    rdfs:label "temperature measurement result 123" ;
    qb:structure ex:TempResultStructure .
    
ex:TempResultStructure
    a qb:DataStructureDefinition;
    qb:component ex:IndexDimension;
    qb:component ex:PrimitiveTemperatureMeasure .

ex:IndexDimension
    a qb:ComponentSpecification;
    qb:dimension «af-x:index»;
    qb:order 1;
    af-dc:hasComponentDataType xsd:integer .
    
ex:PrimitiveTemperatureMeasure
    a qb:ComponentSpecification;
    qb:measure «af-x:temperature»;
    af-dc:hasComponentDataType xsd:double . # a primitive component data type
The corresponding HDF5 data sets are specified as follows:
Example 5
ex:HDFDataSpace
    a hdf:DataSpace ;
    hdf:dimension ex:HDFIndexDimension .

ex:HDFIndexDimension
    a hdf:DataSpaceDimension ;
    hdf:index "0"^^xsd:int ;
    hdf:currentSize "5"^^xsd:long ;
    hdf:maximumSize "5"^^xsd:long .

ex:HDFPrimitiveMeasure
    a hdf:Dataset ;
    hdf:datatype hdf:H5T_STD_I16BE ;
    hdf:fillValueStatus hdf:H5D_FILL_VALUE_DEFAULT ;
    hdf:dataspace ex:HDFDataSpace .
The mapping structure definition has two parts: One component mapping for the index dimension and one for the temperature measure.
Example 6
ex:MappingStructureDefinition a adf-dc-hdf:MappingStructureDefinition ;
# first part: mapping of the index dimension
adf-dc-hdf:componentMapping [
    a adf-dc-hdf:DimensionMapping;
    adf-dc-hdf:mapsComponent ex:IndexDimension ;
    adf-dc-hdf:dataSpaceDimension ex:HDFIndexDimension ;
    adf-dc-hdf:rdfMapping [
        a adf-dc-hdf:PrimitiveMapping ;
        adf-dc-hdf:hdfDataTypeMapping [
            adf-dc-hdf:rdfType xsd:integer;
            adf-dc-hdf:hdfType hdf:H5T_STD_U32BE ;
        ] ;
    ] ;
];
# second part: mapping of the temperature measure
adf-dc-hdf:componentMapping [
    a adf-dc-hdf:MeasureMapping;
    adf-dc-hdf:mapsComponent ex:PrimitiveTemperatureMeasure ;
    adf-dc-hdf:rdfMapping [
        a adf-dc-hdf:PrimitiveMapping ;
        adf-dc-hdf:hdfDataTypeMapping [
            a adf-dc-hdf:HDFDataTypeMapping ;
            adf-dc-hdf:rdfType xsd:double;
            adf-dc-hdf:hdfType hdf:H5T_IEEE_F64BE;
        ] ;
    ] ;
].

5.3.5 Property Mappings for Complex Data Types

Measures (and also dimensions) MAY have complex component data types. In this case the component mapping MUST define HDF5 data type mappings for all primitive values of the complex data type. This is shown in the following example where the measure component represents a weight measurement which consists of a numeric value, a standard uncertainty and a unit.

Example 7
# example observation
ex:obs01 a qb:Observation;
qb:dataSet ex:WeighingResult;
«af-x:index» 1;
«af-x:net weight» [          # complex value
 qudt:numericValue "100.0"^^xsd:double;
 qudt:standardUncertainty "0.3"^^xsd:double;
 qudt:unit qudt-unit:Gram
] .

# The data set with data structure definition 
ex:WeighingResult   a qb:DataSet;
                    rdfs:label "weighing result 123" ;
                    qb:structure ex:MassResultStructure .
                    ex:MassResultStructure a qb:DataStructureDefinition;
                    qb:component ex:IndexDimension;
                    qb:component ex:ComplexMassMeasure .
ex:IndexDimension   a   adf-dc:Dimension ,
                    adf-dc:OrdinalScale ;
                    qb:dimension «af-x:index»;
                    qb:order 1;
                    af-dc:hasComponentDataType xsd:integer .
ex:ComplexMassMeasure a adf-dc:Measure;
                    qb:measure «af-x:net weight»;
                    af-dc:hasComponentDataType ex:MassDataType . # references a complex data type
The complex data type for the mass measurement is represented by a shape:
Example 8
ex:MassDataType a sh:Shape ;
sh:property [
  sh:predicate qudt:numericValue;
  sh:minCount 1;
  sh:maxCount 1;
  sh:nodeKind sh:Literal ;
  sh:datatype xsd:double ;
];
sh:property [
  sh:predicate qudt:standardUncertainty;
  sh:minCount 1;
  sh:maxCount 1;
  sh:nodeKind sh:Literal ;
  sh:datatype xsd:double ;
];
sh:property [
  sh:predicate qudt:unit;
  sh:minCount 1;
  sh:maxCount 1;
  sh:nodeKind sh:IRI;
  sh:class qudt:Unit;
];
.
For each primitive data type of the complex data type a separate HDF5 data set is defined.
Example 9
ex:HDFDataSpace a hdf:DataSpace ;
hdf:dimension ex:HDFIndexDimension .

ex:HDFIndexDimension a hdf:DataSpaceDimension ;
hdf:index "0"^^xsd:int ;
hdf:currentSize "50"^^xsd:long ;
hdf:maximumSize "50"^^xsd:long .

ex:HDFComplexMeasureNumericValue a hdf:Dataset ;
hdf:datatype hdf:H5T_IEEE_F64BE ;
hdf:fillValueStatus hdf:H5D_FILL_VALUE_DEFAULT ;
hdf:dataspace ex:HDFDataSpace .

ex:HDFComplexMeasureStandardUncertainty a hdf:Dataset ;
hdf:datatype hdf:H5T_IEEE_F64BE ;
hdf:fillValueStatus hdf:H5D_FILL_VALUE_DEFAULT ;
hdf:dataspace ex:HDFDataSpace .

ex:HDFComplexMeasureUnit a hdf:Dataset ;
hdf:datatype hdf:H5T_STD_I64BE ;            # URIs are represented as integers
hdf:fillValueStatus hdf:H5D_FILL_VALUE_DEFAULT ;
hdf:dataspace ex:HDFDataSpace .
The mappings of the different primitive data types are defined as follows. Firstly, a default mapping for xsd:double values is defined:
Example 10
ex:DefaultDoubleMapping a adf-dc-hdf:HDFDataTypeMapping ;
adf-dc-hdf:rdfType xsd:double; 				    
adf-dc-hdf:hdfType hdf:H5T_IEEE_F64BE . 		    # HDF type is a predefined or custom HDF5 data type
Here, the RDF type is either one of the standard rdf data types, rdf:Resource (any IRI) or sh:Shape. Then the primitive data types are mapped (shown for measure components):
Example 11
ex:MappingStructureDefinition a adf-dc-hdf:MappingStructureDefinition ;
adf-dc-hdf:componentMapping [
    a adf-dc-hdf:MeasureMapping;
    adf-dc-hdf:mapsComponent ex:ComplexMassMeasure ;
    adf-dc-hdf:rdfMapping [
        a adf-dc-hdf:PropertyMapping ;
        adf-dc-hdf:hdfDataTypeMapping ex:DefaultDoubleMapping ;
        adf-dc:propertyPath "<http://qudt.org/schema/qudt#numericValue>" ;
        adf-dc-hdf:hdfDataset ex:HDFComplexMeasureNumericValue ;
    ] ;
    adf-dc-hdf:rdfMapping [
        a adf-dc-hdf:PropertyMapping ;
        adf-dc-hdf:hdfDataTypeMapping ex:DefaultDoubleMapping ;
        adf-dc:propertyPath "<http://qudt.org/schema/qudt#standardUncertainty>" ;
        adf-dc-hdf:hdfDataset ex:HDFComplexMeasureStandardUncertainty ;
    ] ;
    adf-dc-hdf:rdfMapping [
        a adf-dc-hdf:PropertyMapping ;
        adf-dc-hdf:hdfDataTypeMapping [             
            a adf-dc-hdf:HDFDataTypeMapping ;
            adf-dc-hdf:rdfType rdf:Resource ;
            adf-dc-hdf:hdfType hdf:H5T_STD_I64BE ;
            adf-dc-hdf:usingDictionary ex:dict123 ; # strings and URIs are mapped to integers in HDF5 using a dictionary
        ]
        adf-dc:propertyPath "<http://qudt.org/vocab/unit#unit>" ;
        adf-dc-hdf:hdfDataset ex:HDFComplexMeasureUnit ;
    ] ;
].
ex:dict123 a hdf-ext:Dictionary .

5.3.6 Standard HDF Data Type Mappings for RDF Data Types

To ease the definition of mappings, ADF-DCO has the following standard mappings for all RDF data types such as xsd:integer:

RECOMMENDED standard HDF data type mappings for RDF data types.
RDFHDFHDFDataTypeMapping
xsd:doublehdf:H5T_IEEE_F64BEadf-dc-hdf:standardDoubleMapping
xsd:floathdf:H5T_IEEE_F32BEadf-dc-hdf:standardFloatMapping
xsd:integerhdf:H5T_STD_I64BEadf-dc-hdf:standardIntegerMapping
xsd:negativeIntegerhdf:H5T_STD_I64BEadf-dc-hdf:standardIntegerMapping
xsd:positiveIntegerhdf:H5T_STD_I64BEadf-dc-hdf:standardIntegerMapping
xsd:nonNegativeIntegerhdf:H5T_STD_I64BEadf-dc-hdf:standardIntegerMapping
xsd:nonPositiveIntegerhdf:H5T_STD_I64BEadf-dc-hdf:standardIntegerMapping
xsd:longhdf:H5T_STD_I64BEadf-dc-hdf:standardLongMapping
xsd:unsignedLonghdf:H5T_STD_I64BEadf-dc-hdf:standardUnsignedLongMapping
xsd:inthdf:H5T_STD_I32BEadf-dc-hdf:standardIntMapping
xsd:unsignedInthdf:H5T_STD_U32BEadf-dc-hdf:standardUnsignedIntMapping
xsd:shorthdf:H5T_STD_I16BEadf-dc-hdf:standardShortMapping
xsd:unsignedShorthdf:H5T_STD_U16BEadf-dc-hdf:standardUnsignedShortMapping
xsd:bytehdf:H5T_STD_I8BEadf-dc-hdf:standardByteMapping
xsd:unsignedBytehdf:H5T_STD_U8BEadf-dc-hdf:standardByteMapping
xsd:stringhdf:H5T_STD_I32BEadf-dc-hdf:standardStringMapping
xsd:anyURIhdf:H5T_STD_I32BEadf-dc-hdf:standardStringMapping
rdf:Resourcehdf:H5T_STD_I32BEadf-dc-hdf:standardResourceMapping

The data types xsd:string (IRIs) and rdf:Resource are stored as 32bit integers that are keys into dictionaries.

Note
  • xsd:decimal has no mapping.
  • xsd:boolean has no mapping.
  • xsd:duration has no mapping.
  • xsd:date and xsd:dateTime have no mappings and are treated as time integers (ms since 1.1.1970)
  • xsd:integer, xsd:negativeInteger, xsd:positiveInteger, xsd:nonNegativeInteger, xsd:nonPositiveInteger and xsd:unsignedLong are only supported in the range of signed long 64bit integers.
  • 5.3.7 Mapping Multiple Measures to HDF

    A data cube contains one or many adf-dc:Measures which need to be mapped to HDF5 data sets. In case of multiple measures there are three approaches to map them to HDF5 data sets:

    • One HDF5 data set per measure.
    • One HDF5 compound data set with one member per measure.
    • One HDF5 data set that has an artificial dimension with a nominal scale having as scale values the names of the measures. This approach is only applicable if all measures have the same data type.
    Note
    The use of of HDF5 compound data sets is discouraged, because search becomes less efficient.
    If the measure component data type is complex, by default, multiple HDF5 data sets will be used for their representation. The following example illustrates how multiple measures MAY be mapped to one HDF5 data set. The example observation has a tare weight and a net weight with value and error. All values are of type xsd:double:

    Example 12
    ex:obs01 a qb:Observation;
       qb:dataSet ex:WeighingResult;
       «af-x:index» 1;
       «af-x:tare weight» '120.912'^^xsd:double     # primitive value
       «af-x:net weight» [                          # complex value
         qudt:numericValue '100.014'^^xsd:double ;
         qudt:standardUncertainty '0.326'^^xsd:double ;
      ] .

    When multiple measures are mapped to the same HDF5 data set, a HDF5 field index and dimension index (both of type xsd:long) MUST be specified. The mapping for the measures looks as follows.

    Example 13
    ex:MappingStructureDefinition a adf-dc-hdf:MappingStructureDefinition ;
        adf-dc-hdf:componentMapping [
            a adf-dc-hdf:MeasureMapping;
            adf-dc-hdf:mapsComponent ex:SimpleTareWeightMeasure ;
            adf-dc-hdf:rdfType xsd:double ;
            adf-dc-hdf:rdfMapping [
                a adf-dc-hdf:PrimitiveMapping ;
                adf-dc-hdf:hdfDataTypeMapping ex:DefaultDoubleMapping ; 
                adf-dc-hdf:hdfFieldIndex "0"^^xsd:long ;             # simple tare weight -> field dimension = 0   
                adf-dc-hdf:hdfDimensionIndex "0"^^xsd:long           # from dimension «af-x:index»
                adf-dc-hdf:hdfDataset ex:HDFMultiMeasureDataSet ;    # multi measure data set
            ] ;
        adf-dc-hdf:componentMapping [
            a adf-dc-hdf:MeasureMapping;
            adf-dc-hdf:mapsComponent ex:ComplexNetWeightMassMeasure ;
            adf-dc-hdf:rdfMapping [
                a adf-dc-hdf:PropertyMapping ;
                adf-dc-hdf:hdfDataTypeMapping ex:DefaultDoubleMapping ;
                adf-dc:propertyPath "qudt:numericValue";
                adf-dc-hdf:hdfFieldIndex "1"^^xsd:long ;             # complex net weight.numeric value -> field dimension = 1
                adf-dc-hdf:hdfDimensionIndex "0"^^xsd:long           # the same dimension index          
                adf-dc-hdf:hdfDataset ex:HDFMultiMeasureDataSet ;    # multi measure data set
            ] ;
            adf-dc-hdf:rdfMapping [
                a adf-dc-hdf:PropertyMapping ;
                adf-dc-hdf:hdfDataTypeMapping ex:DefaultDoubleMapping ;
                adf-dc:propertyPath "qudt:standardUncertainty";
                adf-dc-hdf:hdfFieldIndex "2"^^xsd:long ;             # complex net weight.standard uncertainty -> field dimension = 2
                adf-dc-hdf:hdfDimensionIndex "0"^^xsd:long           # the same dimension index
                adf-dc-hdf:hdfDataset ex:HDFMultiMeasureDataSet ;    # multi measure data set
            ] ;
        ].
    Note
    Mapping of all values/properties of the shape is mandatory.

    6. Change History

    Version Release Date Remarks
    0.4.0 2015-06-18 Initial Working Draft version
    1.0.0 RC 2015-09-17 Complete Revision after split of ADF Data Cube ontology and ADF Data Cube to HDF5 Mapping Ontology
    1.0.0 2015-09-29
    • Incorporated feedback of reviews
    • Updated versions, dates and document status
    1.1.0 RC 2016-03-11
    • updated versions, dates and document status
    • added section on number formatting to document conventions
    • updated Fig. 1 and Fig. 3, resized Fig. 8
    1.1.0 RF 2016-03-31
    • updated versions, dates and document status
    1.1.5 2016-05-13
    • updated versions and dates
    1.2.0 Preview 2016-09-23
    • updated versions and dates
    1.2.0 RC 2016-12-07
    • updated versions and dates
    1.3.0 Preview 2017-03-31
    • updated versions and dates
    1.3.0 RF 2017-06-30
    • updated versions and dates
    • adaptations to new business model
    • updated section 5.3.6
    • minor edits

    A. References

    A.1 Normative references

    [ADF]
    Allotrope. Allotrope Data Format Overview. URL: http://purl.allotrope.org/TR/adf/
    [ADF-DCO]
    Allotrope. ADF Data Cube Ontology. URL: http://purl.allotrope.org/TR/adf-dco/
    [HDF5]
    The HDF Group. HDF5 File Format Specification 2.0. URL: http://www.hdfgroup.org/HDF5/doc/H5.format.html
    [QB]
    W3C. The RDF Data Cube Vocabulary. URL: http://www.w3.org/TR/vocab-data-cube/
    [rfc2119]
    S. Bradner. IETF. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119

    A.2 Informative references

    [ADF-DC]
    Allotrope. ADF Data Cube API. URL: http://purl.allotrope.org/TR/adf-dc/