[data-shapes] Pull Request: refactor: rename union/minus node expressions to join/remove in node …

simonstey has just submitted a new pull request for https://github.com/w3c/data-shapes:

== refactor: rename union/minus node expressions to join/remove in node … ==
This is a revision of the now closed PR here: https://github.com/w3c/data-shapes/pull/526#issue-3351151169

----------

This pull request implements comprehensive changes to address [Issue #484](https://github.com/w3c/data-shapes/issues/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:**
- `shnex:union` → `shnex:join` - Emphasizes sequence concatenation with order preservation
- `shnex:minus` → `shnex:remove` - Clearer operation name for sequence subtraction
- `shnex:path` → `shnex:pathValues` - Distinguishes from constraint `sh:path` (needs to align with #514 )

**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:
```turtle
# 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 

* [See this document rendered online here](https://raw.githack.com/w3c/data-shapes/issue-484-sequence-processing/shacl12-node-expr/index.html)


See https://github.com/w3c/data-shapes/pull/636


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 4 November 2025 08:23:56 UTC