Skip to content

Conversation

bergos
Copy link
Contributor

@bergos bergos commented Sep 1, 2025

This PR adds the sh:conformanceDisallows property and updates the definition of the conformance check. The examples are updated to cover the non-default severity levels. The section for the sh:conforms property contained a redundant definition of the conformance check that was removed.

Closes #453

Copy link
Contributor

@YoucTagh YoucTagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add some test cases as well?

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Sep 1, 2025

@bergos I searched for "disallowed" in your rendered version, and I don't understand something:
how would ValidationReport know which levels to disallow? Isn't that some info that the shape designer or invoker should specify? Where?

UPD: I've read #453 and in particular #453 (comment) (which is the basis of the voting). You say at the start:

We extended the specification to allow giving a parameter to the engine to change the severity level when a result is a violation.

  • Where is that in the spec? It should be linked from the sections mentioning "disallowed"
  • "Parameter to the engine" (provided dynamically) should not be the only way.
    This should relate to eg sh:shapesGraph and rsx:DataAndShapesGraphLink as mentioned in Need support for RDF datasets (i.e., graphs, quads) #183

@bergos
Copy link
Contributor Author

bergos commented Sep 2, 2025

@VladimirAlexiev You are right. I revisited severity section and added a note on how the conformance disallow set is defined.

@bergos
Copy link
Contributor Author

bergos commented Sep 2, 2025

@YoucTagh Tests would require a solution for issue #431.

Copy link
Contributor

@ajnelson-nist ajnelson-nist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have one blocking remark on a paragraph about engines interacting with defaults. Either it's a group-discussion matter for a significant behavior in engines providing defaults, or there's just a little English cleanup to clarify that engines can provide some way for users to request different conformance levels for a single validation run.

@ajnelson-nist
Copy link
Contributor

@YoucTagh Tests would require a solution for issue #431.

@bergos , it looks to me like we can actually write a test for this without #431 . The configuration of the validation run doesn't need to be included here - the result of the call-time configuration is included, by merit of sh:conformanceDisallows being present at all.

@VladimirAlexiev
Copy link
Contributor

@bergos I think it's still backwards:

@bergos
Copy link
Contributor Author

bergos commented Sep 7, 2025

@bergos , it looks to me like we can actually write a test for this without #431 . The configuration of the validation run doesn't need to be included here - the result of the call-time configuration is included, by merit of sh:conformanceDisallows being present at all.

@ajnelson-nist That would only work if we make sh:conformanceDisallows mandatory. I don't have a strong opinion on that. I guess my initial thought was that people don't stumble over a missing property in case they read the new spec, but deal with a validation report from an older engine, which would be the user's fault.

@bergos
Copy link
Contributor Author

bergos commented Sep 7, 2025

@VladimirAlexiev The set in the validation report is a representation of the set of the engine. I think that's an implementation detail. One could write an implementation that creates the validation report before the validation and uses that to store the set. I think the spec should not cover how an engine keeps intermediate states/values and how they are copied during processing.

@bergos
Copy link
Contributor Author

bergos commented Sep 9, 2025

@ajnelson-nist I've merged the changes you proposed.

Test contents adapted from Core document example by @bergos.

Test structure adapted from this file, picked more or less at random:
shacl12-test-suite/tests/core/path/path-alternative-001.ttl

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
@ajnelson-nist
Copy link
Contributor

Would it make sense to add some test cases as well?

Added in a43a352 , thank you for the reminder.

Copy link
Contributor

@ajnelson-nist ajnelson-nist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone else should approve before merge, if not to review the text, then to check the tests I just added.

Copy link
Contributor

@YoucTagh YoucTagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ex:PersonShape-age shape is used in both validation reports, once with severity sh:Warning and once with severity sh:Violation.
This shape is later defined in the specification as follows:

ex:PersonShape-age;
  a sh:PropertyShape;
  sh:path ex:age;
  sh:datatype xsd:integer;
  sh:maxCount 1;
  sh:reifierShape ex:ProvenanceShape;
  sh:reificationRequired true .

If the data graph in Example 24 is the one used for illustration, I think the validation reports are missing the reification validation results.

@ajnelson-nist
Copy link
Contributor

The ex:PersonShape-age shape is used in both validation reports, once with severity sh:Warning and once with severity sh:Violation. This shape is later defined in the specification as follows:

ex:PersonShape-age;
  a sh:PropertyShape;
  sh:path ex:age;
  sh:datatype xsd:integer;
  sh:maxCount 1;
  sh:reifierShape ex:ProvenanceShape;
  sh:reificationRequired true .

If the data graph in Example 24 is the one used for illustration, I think the validation reports are missing the reification validation results.

Ah, whoops. Good catch, I forgot to search for the shape definition.

One response pertinent to the test design: I did keep the shape I wrote consistent between both tests. What I varied in the test was the presence of sh:conformanceDisallows. Here's the diff between the two test files, posting to just note mootness before line 42:

28c28
<       <conformance-disallows-001>
---
>       <conformance-disallows-002>
31c31
< <conformance-disallows-001>
---
> <conformance-disallows-002>
33,35c33,35
<   rdfs:label "Test of path sh:conformanceDisallows 001" ;
<   rdfs:comment "conformanceDisallows presence lets sh:conforms be true despite presence of an sh:Warning-severity result.  Test contents and behavior otherwise match conformance-disallows-002."@en ;
<   rdfs:seeAlso <conformance-disallows-002> ;
---
>   rdfs:label "Test of path sh:conformanceDisallows 002" ;
>   rdfs:comment "conformanceDisallows absence causes sh:conforms be false due to presence of an sh:Warning-severity result.  Test contents and behavior otherwise match conformance-disallows-001."@en ;
>   rdfs:seeAlso <conformance-disallows-001> ;
42,43c42
<       sh:conforms "true"^^xsd:boolean ;
<       sh:conformanceDisallows sh:Violation ;
---
>       sh:conforms "false"^^xsd:boolean ;

Next step:

The test discrepancy @YoucTagh noted seems to bubble up to the example that I copied. Is it a problem in the document to have two tests in unrelated sections use the same example IRI with different implementations around the example IRI?

I'm fine with adjusting the test, but do we also need to adjust the document?

YoucTagh and others added 3 commits September 26, 2025 15:44
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
@nicholascar nicholascar added the Core For SHACL 1.2 Core spec label Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core For SHACL 1.2 Core spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definition of sh:conforms / handling of non-violating validation results
7 participants