-
Notifications
You must be signed in to change notification settings - Fork 39
refactor: rename union/minus node expressions to join/remove in node … #636
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
base: gh-pages
Are you sure you want to change the base?
Conversation
… to node expressions
… node expressions
…e expressions spec
|
"concatentation" is used in the definition. Various text stil uses "union":
and
and
Example 10 has
The text on duplicates is unclear - it seems to read as they may occur but also that a system that eliminates them is also correct. Is it order preserving? Also - shnex:remove - is it order preserving?
that could be read as one-for-one or a remove contained list. A list "1 1 1 2 2" removing "1 1" - could be "1 2 2", or "1 1 2 2" legal or "1 2 1" with different readings. |
|
Suggestion: make the names "list*" (including similar operations). This gives more freedom to what the specific operation name is:
The handling of order preserving needs to be made clear - or text to say it does not matter (i.e. it's a multiset/bag). This is in other places as well -- shnex:intersection (what is the intersection of "1 1 1 2 2 1" and "1 1"? the text can be read several ways including as "subsection" or keep original (LHS) cardinality) |
Co-authored-by: Ted Thibodeau Jr <[email protected]>
… and documentation
|
Here's the summary of how I tried to address @afs 's comments: 1. “Join” → “Concat” terminology and semanticsIn
2. Expanded examples and evaluation tracesIntersection Expressions section:
Remove Expressions section:
3. FlatMap Expressions: clarified semantics and richer exampleThe Advanced Sequence Operations / FlatMap Expressions section was significantly reworked:
4. Minor formatting tweaks
5. Vocabulary updates for concat vs joinIn
In
|
HolgerKnublauch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good starting point. It will be easier to drill into details once this is merged into main and we have individual sub-issues compared to this mega thread. I have not myself looked into all details but will do so once I do the implementation and test cases.
| <p class="syntax"> | ||
| <span data-syntax-rule="FlatMapExpression-syntax"> | ||
| A <a>blank node</a> that is the <a>subject</a> of the following properties | ||
| is called a <dfn>flatMap expression</dfn>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| is called a <dfn>flatMap expression</dfn>, | |
| is called a <dfn>flat map expression</dfn>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elsewhere we used names like "path values expression" instead of pathValues expression, so we should decide on one or the other, but not mix them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flatMap is a name in it own right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever makes us agree to merge this in is OK for me. Naming is secondary. It is easy to get lost in details.
| <div class="def-header">EVALUATION OF FLATMAP EXPRESSIONS</div> | ||
| <p> | ||
| Let <code>flatMap</code> be the <a>value</a> of <code>shnex:flatMap</code> | ||
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in a <a>flatMap expression</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in a <a>flatMap expression</a>. | |
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in a <a>flat map expression</a>. |
| <code>evalExpr(flatMap, focusGraph, <var>n</var>, scope)</code>. | ||
| </p> | ||
| <p> | ||
| The <a>output nodes</a> of the <a>flatMap expression</a> are produced by concatenating all sequences |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The <a>output nodes</a> of the <a>flatMap expression</a> are produced by concatenating all sequences | |
| The <a>output nodes</a> of the <a>flat map expression</a> are produced by concatenating all sequences |
| <p class="syntax"> | ||
| <span data-syntax-rule="FindFirstExpression-syntax"> | ||
| A <a>blank node</a> that is the <a>subject</a> of the following properties | ||
| is called a <dfn>findFirst expression</dfn>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| is called a <dfn>findFirst expression</dfn>, | |
| is called a <dfn>find first expression</dfn>, |
| <div class="def-header">EVALUATION OF FINDFIRST EXPRESSIONS</div> | ||
| <p> | ||
| Let <code>shape</code> be the <a>value</a> of <code>shnex:findFirst</code> | ||
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in a <a>findFirst expression</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in a <a>findFirst expression</a>. | |
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in a <a>find first expression</a>. |
| and <code>nodes</code> be the <a>value</a> of <code>shnex:nodes</code> in the <a>matchAll expression</a>. | ||
| If <code>shnex:nodes</code> is not specified, let <code>nodes</code> be the focus node. | ||
| Let <code>N</code> be the <a>output nodes</a> of <code>evalExpr(nodes, focusGraph, focusNode, scope)</code>. | ||
| The <a>output nodes</a> of the <a>matchAll expression</a> contain the boolean <code>true</code> if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The <a>output nodes</a> of the <a>matchAll expression</a> contain the boolean <code>true</code> if | |
| The <a>output nodes</a> of the <a>match all expression</a> contain the boolean <code>true</code> if |
| <p id="MatchAllExpressionExample"> | ||
| The following example illustrates the use of <code>shnex:matchAll</code> to derive a property | ||
| <code>ex:allEmployeesActive</code> that checks whether all employees of a company are currently active. | ||
| The matchAll operation tests each employee against a shape that validates their active status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The matchAll operation tests each employee against a shape that validates their active status. | |
| The match all operation tests each employee against a shape that validates their active status. |
| </span> | ||
| </p> | ||
| <div class="def" id="FindFirstExpression-evaluation"> | ||
| <div class="def-header">EVALUATION OF FINDFIRST EXPRESSIONS</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <div class="def-header">EVALUATION OF FINDFIRST EXPRESSIONS</div> | |
| <div class="def-header">EVALUATION OF FIND FIRST EXPRESSIONS</div> |
| </span> | ||
| </p> | ||
| <div class="def" id="FlatMapExpression-evaluation"> | ||
| <div class="def-header">EVALUATION OF FLATMAP EXPRESSIONS</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <div class="def-header">EVALUATION OF FLATMAP EXPRESSIONS</div> | |
| <div class="def-header">EVALUATION OF FLAT MAP EXPRESSIONS</div> |
| The <a>node expression</a> that is applied to each input node. | ||
| The <a>node expression</a> that is applied to each input node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The <a>node expression</a> that is applied to each input node. | |
| The <a>node expression</a> that is applied to each input node. | |
| The <a>node expression</a> that is applied to each input node. |
| shnex:remove <b>( owl:Thing rdfs:Resource )</b> ; | ||
| ] .</b> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new </b> in line 1131 has no effect, as it's preceded by the existing </b> in line 1130. I believe the new one should be removed, because the old one follows the closing paren that matches the opening paren which immediately follows the opening <b>.
| shnex:remove <b>( owl:Thing rdfs:Resource )</b> ; | |
| ] .</b> | |
| shnex:remove <b>( owl:Thing rdfs:Resource )</b> ; | |
| ] . |
| </div> | ||
| <p><em>The remainder of this section is informative.</em></p> | ||
| <p> | ||
| The following example declares a derived property <code>ex:availableAuthors</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The following example declares a derived property <code>ex:availableAuthors</code> | |
| The following example declares a derived property, <code>ex:availableAuthors</code>, |
This is a revision of the now closed PR here: #526 (comment)
Closes #484
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:
unionandminussuggested set semantics despite working on ordered sequencespathproperty conflicted conceptually with constraintsh:pathSolution
1. Vocabulary Renaming for Sequence Semantics
Renamed Operations:
shnex:union→shnex:join- Emphasizes sequence concatenation with order preservationshnex:minus→shnex:remove- Clearer operation name for sequence subtractionshnex:path→shnex:pathValues- Distinguishes from constraintsh:path(needs to align with Rename shnex:path to shnex:pathValues and change its shnex:nodes to shnex:focusNode #514 )Deprecation Strategy:
shacl.ttlwith deprecation notices forsh:unionandsh:minus2. Advanced Sequence Operations
New Operations Added:
shnex:flatMap- Applies expression to each input node and flattens resultsshnex:findFirst- Returns first node conforming to a given shapeshnex:matchAll- Returns true if all nodes conform to a given shapeFiles Modified
Vocabulary Files
shacl12-vocabularies/shnex.ttlshacl12-vocabularies/shacl.ttlsh:unionandsh:minusDocumentation
shacl12-node-expr/index.htmlNew Advanced Operations: