Skip to content

Commit

Permalink
fix: allow temporal ordinal dimension (as currently established for F…
Browse files Browse the repository at this point in the history
…OAG and NFI)
  • Loading branch information
Rdataflow committed Apr 18, 2024
1 parent 214b479 commit d289758
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-pets-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cube-link": patch
---

`profile-visualize`: allowed temporal dimensions (`meta:dataKind a time:GeneralDateTimeDescription`) to have ordinal scale type
2 changes: 1 addition & 1 deletion test/profile-visualize/invalid-temporal.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ex:Cube
sh:closed true ;
sh:property
[
# no datatype, no time:unitType
# no datatype, no time:unitType, not qudt:scaleType qudt:OrdinalScale
schema:name "Year" ;
sh:path <y> ;
sh:nodeKind sh:Literal ;
Expand Down
4 changes: 2 additions & 2 deletions test/profile-visualize/invalid-temporal.ttl.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ _:report a sh:ValidationReport ;
sh:sourceShape <https://cube.link/shape/profile-opendataswiss-lindas#TemporalDimensionConstraint> ;
sh:focusNode _:b3 ;
sh:value _:b3 ;
sh:resultMessage "Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType" ;
sh:resultMessage "Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType, or have an ordinal scaleType" ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:XoneConstraintComponent ;
sh:sourceShape <https://cube.link/shape/profile-opendataswiss-lindas#TemporalDimensionConstraint> ;
sh:focusNode _:b5 ;
sh:value _:b5 ;
sh:resultMessage "Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType" ;
sh:resultMessage "Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType, or have an ordinal scaleType" ;
] ;
sh:conforms false .
25 changes: 25 additions & 0 deletions test/profile-visualize/valid-temporal.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,31 @@ ex:Cube
sh:maxCount 1 ;
qudt:scaleType qudt:NominalScale ;
],
[
schema:name "Ordinal-Month" ;
sh:path <ordinalAny> ;
sh:nodeKind sh:IRI ;
meta:dataKind
[
a time:GeneralDateTimeDescription ;
time:unitType time:unitMonth ;
] ;
sh:minCount 1 ;
sh:maxCount 1 ;
qudt:scaleType qudt:OrdinalScale ;
],
[
schema:name "Ordinal-AnyPeriod" ;
sh:path <ordinalAny> ;
sh:nodeKind sh:IRI ;
meta:dataKind
[
a time:GeneralDateTimeDescription ;
] ;
sh:minCount 1 ;
sh:maxCount 1 ;
qudt:scaleType qudt:OrdinalScale ;
],
[
sh:path rdf:type ;
sh:nodeKind sh:IRI ;
Expand Down
13 changes: 12 additions & 1 deletion validation/profile-visualize.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ prefix : <https://cube.link/shape/profile-opendataswiss-lindas#>
a sh:NodeShape ;
sh:targetClass time:GeneralDateTimeDescription ;
sh:message
"Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType" ;
"Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType, or have an ordinal scaleType" ;
sh:xone
(
[
Expand All @@ -204,5 +204,16 @@ prefix : <https://cube.link/shape/profile-opendataswiss-lindas#>
sh:maxCount 1 ;
] ;
]
[
sh:property
[
sh:path ( [ sh:inversePath meta:dataKind ] qudt:scaleType ) ;
sh:hasValue qudt:OrdinalScale ;
],
[
sh:path time:unitType ;
sh:maxCount 0 ;
]
]
)
.

0 comments on commit d289758

Please sign in to comment.