Closed sennierer closed 1 year ago
Hi @sennierer ,
I noticed your shape doesn't have a targeting clause, so it won't apply to anything. (This is a permitted implementation style, though not useful yet in your case. Target-less shapes can be incorporated into other shapes with sh:node
or sh:property
, but otherwise wouldn't be flagged as an error by the SHACL-SHACL validation check (--metashacl
flag).)
If you add the triple ex:crm_P82a_begin_of_the_begin sh:targetClass crm:E52_Time-Span .
it should work as you expect. I saw that raise the error you were trying to trigger:
$ pyshacl --shacl shapes.ttl data.ttl
Validation Report
Conforms: False
Results (1):
Constraint Violation in OrConstraintComponent (http://www.w3.org/ns/shacl#OrConstraintComponent):
Severity: sh:Violation
Source Shape: ex:crm_P82a_begin_of_the_begin
Focus Node: <http://www.intavia.eu/apis/birth/timespan/26697>
Value Node: Literal("1776-01-01T00:00:00" = 1776-01-01 00:00:00, datatype=xsd:dateTime)
Result Path: crm:P82a_begin_of_the_begin
Message: Node Literal("1776-01-01T00:00:00" = 1776-01-01 00:00:00, datatype=xsd:dateTime) does not conform to one or more shapes in [ sh:datatype xsd:date ] , [ sh:datatype xsd:gYear ]
Dear @ajnelson-nist ! Thanks very much for the quick help! That did the trick!
I created a shacl file from a ttl and try to adopt it now to our needs, but datatype validation in PropertyShapes seems to not work. triples:
and the following shacl definition:
Shouldnt there be a violation in the report that P82a didnt use the correct xsd:datatype? Or am I doing something wrong?