Skip to content

Issue 414: list constraints #416

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
wants to merge 23 commits into
base: feat/memberShape
Choose a base branch
from
Open

Conversation

jeswr
Copy link
Member

@jeswr jeswr commented Jun 28, 2025

Closes #414. This PR implements sh:minListLength, sh:maxListLength and sh:uniqList.


My interpretation of the following from the definition of 2.1.1 Constraints, Parameters and Constraint Components is that because the sh:MemberShapeConstraintComponent now has multiple parameters; there can only be one occurrence of sh:memberShape in a given shape - and I have updated the sh:maxCount accordingly.

Some constraint components declare only a single parameter. For example sh:ClassConstraintComponent has the single parameter sh:class. These parameters may be used multiple times in the same shape, and each value of such a parameter declares an individual constraint. The interpretation of such declarations is conjunction, i.e. all constraints apply. The following example specifies that the values of ex:customer have to be SHACL instances of both ex:Customer and ex:Person.


⚠️⚠️ ⚠️
This is currently targeted to #403 branch for a smaller diff in the GH UI. #403 should be merged and this targeted to gh-pages rather than merging this branch into #403

@jeswr jeswr marked this pull request as ready for review June 28, 2025 12:43
Copy link
Contributor

@HolgerKnublauch HolgerKnublauch left a comment

Choose a reason for hiding this comment

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

I think you have linked the new constraint parameters to the same constraint component for memberShape. I believe it would be better to introduce separate constraint components for each of them. It makes the definition more modular but, more importantly, it is perfectly sensible to use for example sh:minListLength without a sh:memberShape constraint.

@jeswr

This comment was marked as resolved.

@jeswr jeswr changed the title Issue 403: list constraints Issue 414: list constraints Jun 29, 2025
@HolgerKnublauch
Copy link
Contributor

I wouldn't worry too much about malformed lists. Usually people use tools to produce them, including editing TTL source code. So if they are reported twice, this shouldn't be the end of the world.

@jeswr
Copy link
Member Author

jeswr commented Jun 29, 2025

I also saw a comment about lists not being valid objects of sh:targetNode but it's now not appearing in the GH UI - was this comment deleted because the statement doesn't hold, or is GH doing weird things?

@HolgerKnublauch
Copy link
Contributor

Yeah my fault. I deleted the comment because I understood later what you did.

@jeswr jeswr force-pushed the feat/list-constraints branch from 536ce96 to 2133631 Compare June 29, 2025 17:11
@jeswr jeswr requested a review from HolgerKnublauch June 29, 2025 17:19
@jeswr
Copy link
Member Author

jeswr commented Jun 29, 2025

I think this is good to go now - I suggest we merge this to gh-pages and close #403 as I have applied changes to the sh:memberShape definition in this PR including moving it to the new List Constraint Component section and addressing #416 (comment)

Copy link
Contributor

@HolgerKnublauch HolgerKnublauch left a comment

Choose a reason for hiding this comment

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

I am in the middle of implementing all this in Java and found various issues.

@jeswr jeswr requested a review from HolgerKnublauch June 30, 2025 10:31
@jeswr
Copy link
Member Author

jeswr commented Jun 30, 2025

I have addressed the issues found - is there an(other?) open source implementation that'd be useful for me to implement the changes against (@bergos' JS shacl-engine perhaps) in case there are any more errors to catch.

P.S. I am conferencing for the next 3 days so will be slow to respond

@jeswr jeswr requested a review from HolgerKnublauch July 3, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants