-
Notifications
You must be signed in to change notification settings - Fork 30
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
jeswr
wants to merge
19
commits into
feat/memberShape
Choose a base branch
from
feat/list-constraints
base: feat/memberShape
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,051
−301
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8d7637a
chore: add vocab definitions for sh:minListLength, sh:maxListLength, …
jeswr 990e698
chore: add list constraints
jeswr 044c3e5
chore: mark sh:minListLength, sh:maxListLength and sh:uniqList as opt…
jeswr c0be857
chore: add list tests
jeswr e21007c
chore: cleanup sh:memberShape text deifnition
jeswr 3f8c33a
chore: cleanup sh:memberShape text deifnition
jeswr 480da45
fix list test url
jeswr 175e03f
chore: update vocab, shacl and tests to make sh:minListLength, sh:max…
jeswr ba60f54
chore: separate list validators separate components in the spec document
jeswr 2133631
chore: add examples to list constraints
jeswr 61696f5
chore: fix unique members namespace
jeswr 97ecfe6
chore: rename `uniqList` ->` uniqueMembers` in shacl shacl
jeswr 8c6b52b
chore: fix reference to `UniqueMembersConstraintComponent` in vocab
jeswr 5c72e8e
chore: remove blank node targetNodes for lists
jeswr ca91c2c
fix: make invalid SHACL lists a top-level violation
jeswr 1c17cb0
fix: Use correct focusNode and value for maxListLength test
jeswr 54f1500
fix: remove unnecessary maxCount and fix maxListLength name error in …
jeswr 91bf091
chore: remove result messages from tests
jeswr 99ca14f
chore: make sourceShape a property shape where applicable
jeswr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@prefix dash: <http://datashapes.org/dash#> . | ||
@prefix ex: <http://datashapes.org/sh/tests/core/node/maxListLength-001.test#> . | ||
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> . | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix sht: <http://www.w3.org/ns/shacl-test#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
ex:ListShape | ||
rdf:type sh:NodeShape ; | ||
sh:maxListLength 2 ; | ||
# Satisfies all constraints | ||
sh:targetNode ex:list0, rdf:nil ; | ||
# Violates maxListLength constraint | ||
sh:targetNode ex:list1, ex:notAList ; | ||
. | ||
|
||
ex:list0 | ||
rdf:first 1 ; | ||
rdf:rest ( 2 ) . | ||
|
||
ex:list1 | ||
rdf:first 1 ; | ||
rdf:rest ( 2 3 ) . | ||
|
||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<maxListLength-001> | ||
) ; | ||
. | ||
|
||
<maxListLength-001> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:maxListLength on node shape 001" ; | ||
mf:action [ | ||
sht:dataGraph <> ; | ||
sht:shapesGraph <> ; | ||
] ; | ||
mf:result [ | ||
rdf:type sh:ValidationReport ; | ||
sh:conforms "false"^^xsd:boolean ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list1 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; | ||
sh:sourceShape ex:ListShape ; | ||
sh:value ex:list1 ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:notAList ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MaxListLengthConstraintComponent ; | ||
sh:sourceShape ex:ListShape ; | ||
sh:value ex:notAList ; | ||
] ; | ||
] ; | ||
mf:status sht:approved ; | ||
. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@prefix dash: <http://datashapes.org/dash#> . | ||
@prefix ex: <http://datashapes.org/sh/tests/core/node/minListLength-001.test#> . | ||
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> . | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix sht: <http://www.w3.org/ns/shacl-test#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
ex:ListShape | ||
rdf:type sh:NodeShape ; | ||
sh:minListLength 1 ; | ||
# Satisfies all constraints | ||
sh:targetNode ex:list0 ; | ||
# Violates minListLength constraint | ||
sh:targetNode rdf:nil, ex:notAList ; | ||
. | ||
|
||
ex:list0 | ||
rdf:first 1 ; | ||
rdf:rest ( 2 ) . | ||
|
||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<minListLength-001> | ||
) ; | ||
. | ||
|
||
<minListLength-001> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:minListLength on node shape 001" ; | ||
mf:action [ | ||
sht:dataGraph <> ; | ||
sht:shapesGraph <> ; | ||
] ; | ||
mf:result [ | ||
rdf:type sh:ValidationReport ; | ||
sh:conforms "false"^^xsd:boolean ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode rdf:nil ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; | ||
sh:sourceShape ex:ListShape ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:notAList ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MinListLengthConstraintComponent ; | ||
sh:sourceShape ex:ListShape ; | ||
sh:value ex:notAList ; | ||
] ; | ||
] ; | ||
mf:status sht:approved ; | ||
. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.