sh:severity for SPARQL-based constraints

11 views
Skip to first unread message

Sebastian Thelen

unread,
Apr 6, 2018, 8:30:20 AM4/6/18
to TopBraid Suite Users
Hi, 

I'm trying to change the severity level for SPARQL-based constraints from their default value sh:Violation to sh:Warning. The way I'm trying to achieve this is as follows:

cdm:manifestation_court-report
a rdfs:Class , sh:NodeShape ;
rdfs:subClassOf cdm:manifestation_print ;
dash:closedByTypes true ;
sh:property [ sh:maxCount "1"^^xsd:nonNegativeInteger ;
sh:path cdm:manifestation_court-report_belongs_to_type_court-report
] ;
sh:sparql [ a sh:SPARQLConstraint ;
sh:message "Concept has to be equivalent to <http://publications.europa.eu/ontology/cdm#type_court-report>" ;
sh:prefixes cdm: ;
sh:select "SELECT $this ?value WHERE {$this <http://publications.europa.eu/ontology/cdm#manifestation_court-report_belongs_to_type_court-report> ?value.\n FILTER NOT EXISTS {?value skos:inScheme ?conceptScheme.\n ?conceptScheme ^owl:hasValue/^owl:equivalentClass/rdfs:subClassOf* <http://publications.europa.eu/ontology/cdm#type_court-report> }}" ;
sh:severity sh:Warning
] .

Unfortunately, when there is a validation issue, the issue is still reported as "resultSeverity" : "shacl:Violation". Is there any way to do this? Chaning the severity level for non-SPARQL-based constraints seems to work, e.g., for cdm:manifestation_court-report_belongs_to_type_court-report.

Cheers, 
Sebastian

Holger Knublauch

unread,
Apr 6, 2018, 8:38:52 AM4/6/18
to topbrai...@googlegroups.com
Hi Sebastian,

sh:severity is only supported for shapes, but the sh:sparql constraint is not a shape. You can either move the sh:severity triple into the manfestation_court-report shape (but then it would also apply to the other constraints), or create another shape with the same target, e.g.

cdm:manifestation_court-report_Warnings
	a sh:NodeShape ;
	sh:targetClass cdm:manifestation_court-report ;
	sh:severity sh:Warning ;
	sh:sparql [
		...
	] .
HTH
Holger
--
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 topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastian Thelen

unread,
Apr 6, 2018, 9:27:02 AM4/6/18
to TopBraid Suite Users
Hi Holger, 

thanks for your prompt reply. Moving sh:severity to manfestation_court-report is not an option for me as all other constraint violations still need to be treated as sh:Violations. Therefore I will try to generate a new shape just as you suggested. 

Sebastian 
Reply all
Reply to author
Forward
0 new messages