Closed JohannesLipp closed 2 years ago
We set this issue ON HOLD, until @sebbader reports a fix/finding in #509 . Thank you!
We need to specify the default value for each sh:or
.
Suggestion
Use the sh:order
property inside the sh:or
constraint.
So for example the deafult value should be the entry with sh:order 1
.
You should use the current instance (e.g. sh:nodeKind IRI vs sh:class ... ) as the default value.
Example:
shapes:RuleShape
a sh:NodeShape ;
sh:targetClass ids:Rule ;
sh:property [
a sh:PropertyShape ;
sh:path ids:assignee ;
sh:or (
[
sh:nodeKind sh:IRI ;
sh:order 1;
]
[
sh:class ids:Participant ;
sh:order 2;
]
);
sh:minCount 0 ;
sh:severity sh:Violation ;
sh:message "<https://raw.githubusercontent.com/International-Data-Spaces-Association/InformationModel/master/testing/contract/RuleShape.ttl> (RuleShape): An ids:Rule must have at maximum one ids:Participant linked through the ids:assignee property."@en ;
] ;.
@lcomet We cleared all open problems and this issue can be tackled from now one :)
@JohannesLipp @HaydarAk I implemented the required changes int the branch extendSHACLShapes-enhancement For more details about the specific changes and additional notes, please refer to the document Implementation Extend SHACL shapes
As we are extended type handling in the code generation, we can now support both indirect and direct references.
Please properly cover this in the information model by replacing existing
sh:nodeKind sh:IRI ;
statements in SHACL withsh:or ( [ sh:class ids:XXX ; ] [ sh:nodeKind sh:IRI ; ] ) ;
for the respective class.Concrete steps to solve this could include:
sh:nodeKind sh:IRI
(should yield about 62 results). Repeat the following steps for each result:sh:path
(e.g.,sh:path ids:provider
)^ids:provider
with regex in "Find in Files")rdfs:range ids:Participant
)sh:or ( [ sh:class ids:Participant ; ] [ sh:nodeKind sh:IRI ; ] ) ;
Note that some do not require any change (e.g.,
ids:accessURL
, which indeed points to an xsd:anyURI) and some already contain hints via comments (e.g.,#sh:class ids:Agent ;
) - please ensure to still double-check these instead of blindly relying on the comments.