diff --git a/.changeset/thick-papayas-turn.md b/.changeset/thick-papayas-turn.md new file mode 100644 index 0000000..2094228 --- /dev/null +++ b/.changeset/thick-papayas-turn.md @@ -0,0 +1,5 @@ +--- +"cube-link": patch +--- + +Adding dimension annotations (`meta:annotation`) re https://gitlab.ldbar.ch/bafu/visualize/-/issues/542 diff --git a/meta/core.md b/meta/core.md index 87787b8..c25a3c6 100644 --- a/meta/core.md +++ b/meta/core.md @@ -27,6 +27,34 @@ To be able to distinguish Dimensions that are defined inside a Cube from Dimensi +### meta:Limit {#Limit} + +A type of [annotation](#annotation) which can be used to express a limit or target value for a dimension. + + + ## Properties ### meta:dataKind (temporal / spatial) {#dataKind} @@ -84,3 +112,60 @@ With `meta:nextInHierarchy` the next lower level is attached to the higher level This property is used on a Dimension Constraint to express a relation with other properties through a [meta:Relation](#Relation) instance, the nature of this relationship is determined by the properties used on the instance. See [this example](../#relexample). + +### meta:annotation {#annotation} + +This property is used to add additional information to a dimension. + +### meta:annotationContext {#annotationContext} + +Links to dimension values to which the annotation applies. The object of `meta:annotationContext` +MUST be well-formed Property Shapes. The value of its `sh:path` MUST be na IRI of a cube dimension. +Only a subset of SHACL Constraints are supported which defined which observations that the annotation +applies to, namely: + +1. `sh:hasValue` - to select specific value(s) +2. `sh:minInclusive` - to select values greater or equal to a specific value +3. `sh:maxInclusive` - to select values smaller or equal to a specific value +4. `sh:minExclusive` - to select values greater than a specific value +5. `sh:maxExclusive` - to select values smaller than a specific value + + + +### meta:limit {#limit} + +The value of a [Limit annotation](#Limit). + +### meta:upperLimit {#upper-limit} + +The upper limit of a [Limit annotation](#Limit). + +### meta:lowerLimit {#lower-limit} + +The lower limit of a [Limit annotation](#Limit). diff --git a/validation/standalone-constraint-constraint.ttl b/validation/standalone-constraint-constraint.ttl index 3b88cac..1d839b7 100644 --- a/validation/standalone-constraint-constraint.ttl +++ b/validation/standalone-constraint-constraint.ttl @@ -65,6 +65,10 @@ sh:path sh:property ; sh:node :DimensionRelation ; ] , + [ + sh:path sh:property ; + sh:node :Annotation ; + ], [ sh:path sh:property ; sh:or ( @@ -205,6 +209,47 @@ ] ; . +:Annotation + a sh:NodeShape ; + sh:property + [ + sh:path rdf:type ; + sh:minCount 1 ; + sh:message "annotation needs an rdf:type" ; + ], + [ + sh:path meta:annotationContext ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:message "at most one meta:annotationContext is allowed" ; + ], + [ + sh:path + ( + [ sh:inversePath meta:annotation ] + ) ; + sh:class cube:MeasureDimension ; + sh:message "annotated dimension must be a cube:MeasureDimension" ; + ] ; +. + +:AnnotationContext + a sh:NodeShape ; + sh:targetObjectsOf meta:annotationContext ; +. + +:LimitAnnotation + a sh:NodeShape ; + sh:targetClass cube:Limit ; + sh:property + [ + sh:path meta:limit ; + sh:minCount 1 ; + sh:or ( [ sh:datatype xsd:integer ] [ sh:datatype xsd:decimal ] ) ; + sh:message "at least on meta:limit is needed and it needs to be a number" ; + ] ; +. + :Confidence a sh:NodeShape ; sh:targetClass relation:ConfidenceLowerBound, relation:ConfidenceUpperBound ; sh:property