This document should help producers of RDF Data Cube in deciding about how to model multi-dimensional data in RDF. It is written and maintained by people producing RDF Data Cubes.
- Linked Data Cubes Best Practices : Outcome of an EU H2020 project called OpenGovIntelligence. The document did not get any updates for a while, one should check if this could be integrated here or vice versa.
A common pattern in the real world is that there is an observation with a measurement that cannot be properly represented as a number. We have seen that multiple times, for example:
- There is more than one measurement for a particular observation and it cannot be told which one is/was correct.
- There was a measurement but the result is lost.
- There was a measurement but for whatever reason it cannot be represented as a number.
In all those cases the data owner cannot give a proper number for the measurement. The question is how to handle that in RDF. Not providing a measure or providing more than one measure would violate the RDF Data Cube model, providing a string instead of a number would make validation and handling of the data very complex.
Fortunately there is a proper way to handle this using NaN
as measure, which is a valid value for xsd:double, xsd:float but not for xsd:decimal:
BASE <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
<observation> <measure> "NaN"^^xsd:double .
This should pass as proper RDF in validators like riot
.
In case the original value should still be part of an observation one can model it as a qb:AttributeProperty. All qb:AttributeProperty
are optional in an observation.