Skip to content

Use Case: using a Node Expression for sh:hasValue and sh:defaultValue at the same time #333

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

Open
tpluscode opened this issue Mar 22, 2025 · 0 comments
Labels
Node Expressions For SHACL 1.2 Node Expressions UCR Use Cases and Requirements

Comments

@tpluscode
Copy link
Contributor

This may already be implied, but I'd like to spell out a scenario where (the same) Node Expression is set to both hasValue and defaultValue. This will allow engine to validate a property and also set its value if missing

Example: SHACL-SHACL computing and validating sh:conforms

[
  sh:targetClass sh:ValidationReport ;
  sh:property [
    sh:path sh:conforms ;
    sh:datatype xsd:boolean ;
    sh:hasValue _:conforms ;
    sh:defaultValue _:conforms ;
  ] ;
].

_:conforms 
  fn:exists ([
    sh:path ( sh:validationResult sh:severity ) ;
    sh:hasValue sh:Violation ;
  ]) ;
. 

I make the assumption that only violations should actually fail validation.
Even if we do not put such a construct in SHACL-SHACL, an engine which implements Node Expressions could use this method for this or other purposes

@tpluscode tpluscode added Node Expressions For SHACL 1.2 Node Expressions UCR Use Cases and Requirements labels Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Node Expressions For SHACL 1.2 Node Expressions UCR Use Cases and Requirements
Projects
None yet
Development

No branches or pull requests

1 participant