ISSUE-51: Generalized sh:severity

In the call today, I was asked to clarify how the severity of constraint 
violations can be specified. Several WG members also voiced their 
support for being able to specify the severity for each occurrence of a 
template, which was not supported until today.

Based on this preference, I have made a small generalization to the 
handling of sh:severity and will describe how it works below. I have 
made this change directly on our master copy as it seems a fairly 
straight-forward and hopefully uncontroversial change. I am holding off 
with the other changes until we had another meeting about this.

To get started, please read the new paragraph

especially Example 31 (Declaring the Severity using sh:severity)

This shows that there is now a way to specify the severity for each 
property occurrence (hopefully addressing Eric's point today). Each of 
these is a template call, instantiating sh:PropertyConstraint. I have 
moved the property sh:severity into the sh:Constraint class, which is a 
superclass of sh:PropertyConstraint. If left unspecified, it will use 
the severity declared at the template itself (i.e. with 
sh:AbstractCountPropertyConstraint as its subject). If even this is left 
unspecified, then it will apply sh:Error as a default.

For native constraints (in SPARQL) the situation is unchanged, e.g.

     a sh:Shape ;
     sh:constraint [
         sh:sparql "..." ;
         sh:severity sh:Warning ;
     ] .

will always produce a warning.

I have also updated the Turtle file and changed the prose in each 
textual definition to say "violation" instead of "sh:Error". I did not 
yet update the shacl-ref file.

I would appreciate a second pair of eyes to verify that I didn't miss 
anything in this refactoring.


Received on Thursday, 6 August 2015 23:24:50 UTC