Skip to content

Conversation

@simonstey
Copy link
Contributor

@simonstey simonstey commented Aug 25, 2025

This pull request implements comprehensive changes to address Issue #484 regarding sequence processing naming inconsistencies in SHACL Node Expressions. The changes align the vocabulary and documentation with the sequence-based nature of node expression processing while maintaining backward compatibility through deprecation notices.

Problem Statement

SHACL Node Expressions are fundamentally sequence-based but were using set-style operation names, creating confusion:

  • Operations like union and minus suggested set semantics despite working on ordered sequences
  • The generic path property conflicted conceptually with constraint sh:path
  • Missing advanced sequence operations limited processing capabilities

Solution

1. Vocabulary Renaming for Sequence Semantics

Renamed Operations:

Deprecation Strategy:

  • Updated shacl.ttl with deprecation notices for sh:union and sh:minus
  • Maintained backward compatibility while guiding migration to new terms

2. Advanced Sequence Operations

New Operations Added:

  • shnex:flatMap - Applies expression to each input node and flattens results
  • shnex:findFirst - Returns first node conforming to a given shape
  • shnex:matchAll - Returns true if all nodes conform to a given shape

Files Modified

Vocabulary Files

  • shacl12-vocabularies/shnex.ttl

    • Added complete RDF definitions for FlatMap, FindFirst, and MatchAll expressions
    • Updated existing definitions with sequence-appropriate naming
    • Enhanced property comments for clarity
  • shacl12-vocabularies/shacl.ttl

    • Added deprecation notices for sh:union and sh:minus
    • Clear migration guidance to new sequence-based terms

Documentation

  • shacl12-node-expr/index.html
    • Renamed sections: UnionExpression → JoinExpression, MinusExpression → RemoveExpression

New Advanced Operations:

# Find first senior employee
sh:values [
    shnex:findFirst [
        shnex:nodes [ shnex:pathValues ex:employee ] ;
        shnex:findFirst ex:SeniorEmployeeShape ;
    ] ;
] .

# Check if all employees are active
sh:values [
    shnex:matchAll [
        shnex:nodes [ shnex:pathValues ex:employee ] ;
        shnex:matchAll ex:ActiveEmployeeShape ;
    ] ;
] .

Closes #484

nicholascar and others added 25 commits August 21, 2025 17:43
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Committing for grammar remarks, but this does not visit the topic raised about whether there officially exists a "SHACL 1.1".

Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
… shnex:remove in spec, examples, and vocabulary
@simonstey simonstey linked an issue Aug 25, 2025 that may be closed by this pull request
nicholascar and others added 4 commits August 25, 2025 22:46
SHACL Overview, what's new
* #505: Added section on Dynamic SHACL, including two examples

* Apply suggestions from code review

Co-authored-by: Alex Nelson <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ted Thibodeau Jr <[email protected]>

* Update shacl12-node-expr/index.html

Co-authored-by: David Habgood <[email protected]>

* Update shacl12-node-expr/index.html

Co-authored-by: David Habgood <[email protected]>

* Update shacl12-node-expr/index.html

Co-authored-by: Ted Thibodeau Jr <[email protected]>

---------

Co-authored-by: Alex Nelson <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: David Habgood <[email protected]>
bergos and others added 22 commits October 25, 2025 15:51
Added style.css to core too
* Define support for property paths in SHACL UI

* Remove targets from the examples

Apply suggestions from code review

Co-authored-by: Thomas Bergwinkl <[email protected]>

* Add notes on restrictions and challenges

* Add shape example to "Other Complex Paths" subsection

* Don't put RFC2119 keywords in bold

* Replace repetitive RFC2119 keywords

---------

Co-authored-by: Thomas Bergwinkl <[email protected]>
Co-authored-by: Ieben Smessaert <[email protected]>
added sh:conformanceDisallows, updated conformance-definition
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
… shnex:remove in spec, examples, and vocabulary
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
@simonstey simonstey marked this pull request as ready for review November 3, 2025 14:44
@simonstey
Copy link
Contributor Author

@TallTed @HolgerKnublauch I now rebased this PR onto gh-pages (and hopefully haven't broken anything in the process of doing so)

@TallTed I've applied your 3 suggestions, thx!

@simonstey simonstey requested a review from TallTed November 3, 2025 14:46
@HolgerKnublauch
Copy link
Contributor

Thanks @simonstey! The branch seems to be on the wrong base though - it displays 115 changed files and 147 commits. Maybe the easiest way forward is to create a new branch that only overwrites the node-expr doc?

Copy link
Contributor Author

@simonstey simonstey left a comment

Choose a reason for hiding this comment

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

yep, I guess that's the better approach

@simonstey
Copy link
Contributor Author

I'll close this PR in favor of #636

@simonstey simonstey closed this Nov 4, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sequence processing