---
# System prepended metadata

title: RDF Cube Schema

---

# RDF Cube Schema

The text moved [here](https://github.com/zazuko/rdf-cube-schema) meanwhile, only the unfinished parts stay here.

## TODO

* ex:interval "TODO" ; # should be possible to model time intervals, other scales might be interesting but less priority -> maybe like units?
* sh:order 1 ; # TODO 


A `View` can be used to combine data from multiple `Cube`s. This is work-in-progress.

Annotations are not part of the core-model of `Cube`s. This is work-in-progress.

## Annotations

Data owners might want to express additional information about their data, at any level of the cube model.

Think of use-cases like:

* Scale of measure for a dimension (temporal, spatial, nominal etc).
* Preferred color used in visualization for a dimension.
* Additional information about a particular observation or a group of observations. For example why there is no value in some cases.

_RDF Cube Schema_ does _not_ define a standard way of doing annotations. Adding annotations might have an impact on query performance on cubes and depending on the use-case another level of annotation details might be necessary.

### Direct annotations

Intuitively, one might add this kind of information as additional properties for example on the level of `Cube`, `Observation` or on the shape for a dimension.

The problem with this approach is that this is not very generic and creating libraries that can handle all the different use-cases is not easy. A library would have to query a lot of optional patterns which has a direct impact on query performance, especially when the annotations are on the level of `Observation`s.

### Using Web Annotation Data Model

A more flexible approach for annotations is the W3C [Web Annotation Data Model](https://www.w3.org/TR/annotation-model/). This data model defines a very generic approach on annotating any resource in the web.

```
@base <http://example.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix sensor: <http://example.org/sensor/> .
@prefix feature: <http://example.org/feature/> .

<anno1>
    a oa:Annotation ;
    oa:hasBody [
      feature:useColor <http://www.wikidata.org/entity/Q1088> ; # blue in Wikidata
    ] ;
    oa:hasTarget sensor:humidity . # dimension "humidity"

<anno2>
    a oa:Annotation ;
    oa:hasBody [
      a oa:TextualBody ;
      rdfs:label "Sensor did not return any value"
    ] ;
    oa:hasTarget <obs12345>, <obs123456> .

```
__NOTE__: This definitely needs a review. It is ok to use OA for RDF resources but we need to verify this by Rob Sanderson or alike.

### Other

[RDF* and SPARQL*](https://blog.liu.se/olafhartig/2019/01/10/position-statement-rdf-star-and-sparql-star/) might be evaluated/considered in the future.


## Views

