-
Notifications
You must be signed in to change notification settings - Fork 8
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
set sh:minCount
1 for sh:nodeKind
to prevent mixed nodeKinds
#109
Comments
We should consider using shapes to validate shapes mentioned in the SHACL specs, which includes: sh:property [
sh:path sh:nodeKind ;
sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in
sh:maxCount 1 ; # nodeKind-maxCount
] ; Among others, there are shapes to validates lists (and in cube link we have something very similar). These shacl-shacl shapes are available here |
@giacomociti yes of course with shacl-shacl (as it's done already in the cube-constraint-constraint.ttl) 👍 based on your snippet we need to consider
|
so I understand our requirement is a little stronger than the basic consistency constraint provided by shacl-shacl (maybe I commented on the wrong issue because the constraints asked for in #105 instead are directly covered by shacl-shacl). Currently, we have a constraint on Maybe we could be even more precise and require either a literal node kind with some data type or an IRI node kind : sh:property [
sh:message "sh:nodeKind needs to be either sh:IRI or sh:Literal with some sh:datatype" ;
sh:or(
[
sh:path sh:nodeKind;
sh:hasValue sh:IRI;
]
[
sh:and(
[
sh:path sh:nodeKind;
sh:hasValue sh:Literal ;
]
sh:node <datatype>
)
]
);
] ; where the |
@giacomociti yes this approach looks promising 👍 nb: I just looked at |
We discussed this and I see it two-fold. Cube Creator would not necessarily need to use shacl-shacl because the core of cube shapes are generated by a reusable pipeline step. Thus, the step code should be tested so that we ensure it always produces valid shacl. On the other hand, data producers who do not use Cube Creator would benefit from a profile which includes shsh, or an explicit validation provided by a CLI (re zazuko/barnard59#187) to check their shapes against shsh in addition to cube.link rules. |
@tpluscode sure if you already thoroughly tested cc code to fulfill |
More tests never hurt anyone 😎 |
Closed by 7e710e3 which requires nodeKind ( sh:IRI sh:Literal ) |
see @l00mi remark to prevent mixed nodeKinds
https://zulip.zazuko.com/#narrow/stream/40-bafu-ext/topic/foag.3A.20filtering.20dates/near/370780
The text was updated successfully, but these errors were encountered: