-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cubelink shapes #1471
Use cubelink shapes #1471
Changes from 4 commits
cda8bcc
ec0f6d0
a56948f
20676f4
2fbd704
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cube-creator/cli": major | ||
--- | ||
|
||
Use [cube.link shapes](https://github.com/zazuko/cube-link/tree/main/validation) for validation |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ base <https://cube-creator.zazuko.com/shape#> | |
sh:message "cube:Cube needs at least one cube:ObservationSet" ; | ||
] , [ | ||
sh:path cube:observationConstraint ; | ||
sh:node <ObservationConstraintShape> ; | ||
sh:node <http://example.org/ObservationConstraintShape> ; # from cube.link | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, did not see that coming. Maybe it's gonna be a little nicer to merge zazuko/cube-link#107 and replace example.org There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
sh:message "cube:Cube must point to a valid cube:Constraint" ; | ||
] ; | ||
. | ||
|
@@ -60,84 +60,6 @@ base <https://cube-creator.zazuko.com/shape#> | |
] ; | ||
. | ||
|
||
<ObservationConstraintShape> | ||
a sh:NodeShape ; | ||
sh:property [ | ||
# we assume at least 3 dimensions, otherwise we would have an empty list of dimensions | ||
# one for cube:observedBy, one for rdf:type and at least one cube dimension | ||
sh:path sh:property ; | ||
sh:minCount 3 ; | ||
sh:message "cube:Constraint needs at least {$minCount} sh:properties" ; | ||
] , [ | ||
sh:path sh:property ; | ||
sh:node <ObservationConstraintProperty> ; | ||
] , [ | ||
sh:path sh:closed ; | ||
sh:hasValue true ; | ||
] ; | ||
. | ||
|
||
<ObservationConstraintProperty> a sh:NodeShape; | ||
sh:property [ | ||
sh:path qudt:scaleType ; | ||
sh:in ( qudt:IntervalScale qudt:NominalScale qudt:EnumerationScale qudt:RatioScale qudt:OrdinalScale) ; | ||
sh:message "If qudt:scale is used it needs to be within" ; | ||
] , [ | ||
sh:path sh:path ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; | ||
sh:message "a sh:path is needed on a property" ; | ||
] , [ | ||
sh:path sh:in ; | ||
sh:node <listnode> ; | ||
sh:message "sh:in needs to be a list" ; | ||
] , [ | ||
sh:message "needs a schema:name" ; | ||
sh:or ( | ||
[ | ||
sh:path schema:name ; | ||
sh:minCount 1 ; | ||
sh:datatype xsd:string ; | ||
] | ||
[ | ||
sh:path schema:name ; | ||
sh:minCount 1 ; | ||
sh:datatype rdf:langString ; | ||
] | ||
[ | ||
sh:path sh:path ; | ||
sh:in (rdf:type cube:observedBy) ; | ||
] | ||
) ; | ||
] , [ | ||
sh:message "needs a sh:datatype or sh:nodeKind" ; | ||
sh:or ( | ||
[ | ||
sh:path sh:datatype ; | ||
sh:minCount 1 ; | ||
] | ||
[ | ||
sh:path sh:nodeKind ; | ||
sh:minCount 1 ; | ||
] | ||
) ; | ||
] ; | ||
. | ||
|
||
# Testing proper rdf:list construction | ||
<listnode> a sh:NodeShape ; | ||
sh:property [ | ||
sh:path rdf:first ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; | ||
] , [ | ||
sh:path rdf:rest ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; | ||
sh:message "a rdf:List can only have one rdf:rest node, multiples nodes need to be linked" ; | ||
#sh:node <restnode>; | ||
] ; | ||
. | ||
|
||
<NoMdHierarchy> | ||
a sh:NodeShape ; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy! Using
Readable.from
is a neat trick. I have to remember that.It's a shame it takes the first argument and not a variadic argument