327: SHACL-SHACL shapes for SHACL-SPARQL ASK, SELECT, and Annotations#377
327: SHACL-SHACL shapes for SHACL-SPARQL ASK, SELECT, and Annotations#377ajnelson-nist wants to merge 19 commits intogh-pagesfrom
Conversation
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
|
Thanks. I have just merged the main issue 327 branch into the main branch, so you could pull and merge it back in, and then also perhaps add the syntax rule references that you needed and other changes you proposed in the comment? |
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
|
Reverting to draft. I found a few misalignments between the text, |
|
@HolgerKnublauch , I wanted to check on direction before coding more: Some of the English from 330 suggested annotations go on Ask or Select Validators, but not all of the coding suggests the same. E.g., It'd be better for So, two questions:
If this matter is graduating to an Issue to follow-on 327, please note so and I'll move this comment. |
|
For reference, I posted a visualization in Discussion 380. |
Targeting of `shsh:SPARQLExecutableShape` derived from: ```turtle sh:prefixes rdfs:domain sh:SPARQLExecutable . ``` Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
|
@ajnelson-nist -- status? (this is set as a "draft"). |
|
Stepping back into this PR: I sketched out expanding result annotations to support "ASK" queries as validators, and I currently am not sure if it makes sense. The "SELECT" annotation pipeline works fine because there are variable bindings exposed in the Here is an adaptation of the example in today's state of SHACL-SPARQL Section 4: ex:AskAnnotationExample
a sh:NodeShape ;
sh:targetNode ex:ExampleResource ;
sh:sparql [ # _:b1
sh:resultAnnotation [
sh:annotationProperty ex:time ;
sh:annotationVarName "time" ;
] ;
sh:ask """
ASK {
FILTER (1 != 1)
BIND (CONCAT("The ", "message.") AS ?message) .
BIND (NOW() AS ?time) .
}
""" ;
] .[ a sh:ValidationReport ;
sh:conforms false ;
sh:result [
a sh:ValidationResult ;
sh:focusNode ex:ExampleResource ;
sh:resultMessage "The message." ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraint _:b1 ;
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ;
sh:sourceShape ex:AskAnnotationExample ;
ex:time "2015-03-27T10:58:00"^^xsd:dateTime ; # Example
]
] .Is that what's expected for annotating Note that I left |
|
Hi Alex, the sh:ask property can only be used in SPARQL-based Constraint Components, not individual constraints. So the example is already invalid. In SPARQL-based constraint components, ASK queries will only bind $this (focusNode) and ?value (the value node). This is indirectly mentions in section 3.3 https://www.w3.org/TR/shacl12-sparql/#constraint-components-validation |
These assignments accidentally induced an unsatisfiable requirement that `sh:ask` and `sh:select` both be on any node using `sh:resultAnnotation`. Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
This patch adds a SHACL-SHACL rule and a syntax rule to the SHACL-SPARQL document. Thanks to Holger for confirming some of the details about variable visibility (in the noted comment). References: * #377 (comment) Reported-by: Holger Knublauch <holger@topquadrant.com> Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
This patch copies and adapts the sibling file `validator-001.ttl`. Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Thank you, @HolgerKnublauch . I've added text to the SHACL-SPARQL document clarifying this restriction, and a shape to SHACL-SHACL enforcing it. I found a demonstration of Because of the domain of I don't intend to look at This PR is ready for review and merge. |
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
| <td><code>sh:annotationValue</code></td> | ||
| <td> | ||
| Constant <a>RDF terms</a> that shall be used as default values. | ||
| <span data-syntax-rule="annotationValue">Constant <a>RDF terms</a></span> that shall be used as |
There was a problem hiding this comment.
The end looks weirdly placed - did you mean to wrap it around the full sentence, and how is this a syntax rule?
| rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/component" ; | ||
| mf:include <optional-001.ttl> ; | ||
| mf:include <propertyValidator-select-001.ttl> ; | ||
| mf:include <resultAnnotation-ask-001.ttl> ; |
There was a problem hiding this comment.
I am not sure this should be covered by a test case: the spec states "Implementations that support this feature" which indicates that the whole feature is optional. As such a test case cannot be made mandatory for all implementations
There was a problem hiding this comment.
"Implementations that support this feature" which indicates that the whole feature is optional. As such a test case cannot be made mandatory for all implementations
It seems worthwhile to me to report "unsupported" for such cases, as there's no error in such an implementation; it's expected to fail the test. This is helpful to potential deployers, beyond our chartered Success Criteria.
In my world, MUST statements MUST be tested, SHOULD statements SHOULD be tested, and even MAY statements SHOULD be tested. The latter two are not about success criteria; they'are about competitive (dis)advantage of various implementations.
There was a problem hiding this comment.
W3C tests are about showing implementability and agreement amongst implementers.
The tests are not validated and not maintained - they are not suitable for competitive issues.
There was a problem hiding this comment.
My understanding is that there need to be two implementations that pass each test case. For an optional feature this is unlikely. So I don't understand why this can become a test case unless we add some flag to mark the test as optional?
This is an addition to (and builds upon) PR #330 . It started as drafting SHACL-SHACL for the Annotations in SHACL-SPARQL, but some of the editorial updates suggested linking to SHACL-SHACL rules for ASK and SELECT queries, which I realized weren't written. So, this PR is slight scope creep over #327, and suggests some TODOs around finishing syntax review rules, e.g. for tying
sh:prefixes, and setting up CONSTRUCT and UPDATE shapes.I suggest either this be merged into #330 , or be handled on its own to finish catch-up with SHACL-SPARQL syntax review.