Hi Sebastian,
first the obvious warning - this is work in progress and we are in
between 5.2 and 5.3 where some things have changed (e.g. sh:Shape will
be sh:NodeShape in 5.3).
In your specific example, note that dash:closedByTypes does not look
into sh:targetClass triples. Instead, you'd need to directly instantiate
validation:WorkShape, i.e. this instance
<http://foo>
rdf:type validation:WorkShape ;
cdm:cites <http://bar> ;
.
would work, or move the sh:property constraint into cdm:work. The design
of dash:closedByShape expects to be able to walk up the class hierarchy
of the types of the instance. Like with any such SHACL extension, you
can branch off and create your own variation that also considers
sh:targetClass. If that's a design pattern you find useful, feel free to
send me an updated definition.
Regards,
Holger
On 9/03/2017 21:01, Sebastian Thelen wrote:
Hi Holger,
I'm trying to use thedash:ClosedByTypesConstraintComponent included in
the DASH namespace of the most recent TopBraid release. I've tried to
create a simple example according to what I have understood from this
post to familiarize myself with the mechanism but already this first
example is giving me a validation error even though the instance data
should be ok.
The shape I wrote looks as follows:
@prefix dash: <http://datashapes.org/dash#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix cdm: <http://publications.europa.eu/ontology/cdm#> .
@prefix validation: <http://validation.org/>.
validation:WorkShape
a rdfs:Class, sh:Shape ;
dash:closedByTypes true;
sh:targetClass cdm:work ;
sh:property [
sh:path cdm:cites;
];
sh:ignoredProperties ( rdf:type ).
This is the instance data:
<http://foo>
rdf:type cdm:work;
cdm:cites <http://bar>.
The validator returns the following report:
[ a sh:ValidationReport ;
sh:conforms false ;
sh:result [ a sh:ValidationResult ;
sh:focusNode <http://foo> ;
sh:resultMessage "Property cdm:cites is
not among those permitted for any of the types" ;
sh:resultPath cdm:cites ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent
dash:ClosedByTypesConstraintComponent ;
sh:sourceShape validation:WorkShape ;
sh:value <http://bar>
]
] .
At this point there are no subclasses of cdm:work, yet. They will be
added later. I don't see why the property cdm:cites is not permitted.
My intention was actually to explicitely require the use of this
property? Do you have any idea why this is happening?
Sebastian
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include the TopBraid
Suite family of products and its base technologies such as
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Group "TopBraid
Suite Users", the topics of which include the TopBraid Suite family of products and
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.