Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inclusion of sh:phase and sh:Phase #35

Closed
kurtcagle opened this issue Mar 9, 2017 · 2 comments
Closed

Inclusion of sh:phase and sh:Phase #35

kurtcagle opened this issue Mar 9, 2017 · 2 comments

Comments

@kurtcagle
Copy link

Within the Validation Report, I'd like to recommend the inclusion of a sh:phase property within the contraint restrictions that would indicate that the constraint is considered active only when a named phase is passed as an argument into the validator. This would look something like:

ex:EventShape
    a sh:NodeShape;
    sh:targetClass class:Event;
    sh:name "Event";
    sh:description "This class identifies both named and anonymous events.";
    sh:property [
        a sh:PropertyShape;
        sh:path event:startDate;
        sh:name "Start Date";
        sh:datatype xsd:date;
        sh:minCount "1"^^xsd:integer;
        sh:maxCount "1"^^xsd:integer;
        sh:order "0";
        sh:group shape:EventGroup;
        sh:description "This indicates the date that an event begins, and is treated as inclusive.";
        sh:phase phase:testValidation
    ];
    sh:property [
        a sh:PropertyShape;
        sh:path event:startDate;
        sh:name "Start Date";
        sh:datatype xsd:date;
        sh:minCount "0"^^xsd:integer;
        sh:maxCount "1"^^xsd:integer;
        sh:order "0";
        sh:group shape:EventGroup;
        sh:description "This indicates the date that an event begins, and is treated as inclusive.";
        sh:phase phase:deployedValidation
    ];

phase:testValidation
    a sh:Phase;
    sh:name "Test Validation";
    sh:description "This is only invoked during testing."
    .
phase:deployedValidation
    a sh:Phase;
    sh:name "Deployed Validation";
    sh:description "This is only invoked during deployed validation."
    .

Output from _validate_("Test Validation")

[	a sh:ValidationReport ;
	sh:conforms false ;
	sh:result [
		a sh:ValidationResult ;
                sh:phase phase:TestValidation ;
		sh:resultSeverity sh:Violation ;
		sh:focusNode ex:Bob ;
		sh:resultPath ex:age ;
		sh:value "twenty two" ;
		sh:resultMessage "ex:age expects a literal of datatype xsd:integer." ;
		sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
		sh:sourceShape ex:PersonShape-age ;
	]
] .

The lack of inclusion of phase means it will return phase results for all phases.

This is intended to provide similar functionality to that offered by Schematron.

@HolgerKnublauch
Copy link
Contributor

Hi Kurt,

we have discussed this in yesterday's meeting (see minutes https://www.w3.org/2017/03/15-shapes-minutes.html#item05). We do acknowledge that your use case is relevant. At the same time we believe that your scenarios can already be covered with a couple of other techniques that would not require a new property in the SHACL namespace.

  • Shapes belonging into different phases can be organized into different files or graphs
  • Anyone can make up their own properties. Shapes are RDF resources that may hold arbitrary other properties than those anticipated by the SHACL WG. For example, it is conceivable that some users may only want to use shapes from a certain author (dc:author), by creation time stamp, by complexity (e.g. run sh:node constraints after sh:datatype/sh:class). Given that there is a large variety of such scenarios, the WG is not convinced that adding a single property is the best way forward. Instead we believe such things will evolve over time, and different communities will create their own properties in 3rd party namespaces. The same applies to the results vocabulary - we do expect that different tools will produce additional properties than those prescribed by SHACL.

We do have concerns that adding something like a Phase would open up a number of follow-up issues that would require deeper investigation. For example what would happen if shape is used via sh:node but contains constraints that are used only in certain contexts. I am afraid this may complicate the language and we will not be able to resolve this topic sufficiently before the next (CR) deadline. We encourage this to be handled by follow-up Community Groups.

Please let us know your thoughts and whether you could "live" with the response above for now.

@kurtcagle
Copy link
Author

I can live with this for now - it may be a situation where the use of such process metadata can best be illustrated in a primer or similar document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants