-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
ec1d5cd
feat: add memberShape to vocab, shacl-shacl and tests
jeswr b09c177
chore: add HTML documentation
jeswr 644e29c
fix: use SHACL list rather than RDF list, allow memberShape to be use…
jeswr 8ab3864
Update shacl12-core/index.html
jeswr 387b7e4
Update shacl12-core/index.html
jeswr 1133a3c
#401 fix: constrain deactivated using datatype rather than in (#402)
jeswr ddc2fb7
Revert "#401 fix: constrain deactivated using datatype rather than in…
jeswr bacd1ef
chore: cleanup newlines
jeswr dc710f6
chore: fixup ordering of constraint components
jeswr 2f2f804
chore: remove maxCount constraint on memberShape
jeswr 328bc62
chore: replace list of constraint parameters with reference
jeswr dfb794d
chore: fix memberShape validation example in text and 001 test
jeswr 333632d
chore: cleanup tests
jeswr aa20336
chore: update vocab definition
jeswr 8b80bc6
chore: add memberShape test for multiple violating values
jeswr 503c115
chore: cleanup turtle
jeswr 4de9d0b
cleanup: remove unecessary otherwise
jeswr 94ab836
Update shacl12-vocabularies/shacl.ttl
jeswr 1ed3c37
chore: add clarifying comments
jeswr a0dec2a
chore: add clarifications to tests
jeswr e95d2dc
feat: use sh:detail
jeswr 5db4a27
chore: update membershape text definition
jeswr 6b418b1
chore: fix must casing
jeswr 4422f15
chore: add better sh:detail examples for invalid lists
jeswr bf7b597
chore: correctly reference _:b1 in property memberShape
jeswr 0f9fad2
chore: fix formatting of memberShape test
jeswr 5f2bb6b
chore: add link to sh:detail results for sh:memberShape
jeswr 7ff2a9a
chore: move link to sh:detail results for sh:memberShape
jeswr 4eb7e54
chore: remove maxCount form memberShape vocab definition
jeswr 0894e99
chore: remove non-existent files from manifest
jeswr 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 9195eca
chore: remove lingering `uniqList` references
jeswr 58daff6
Fixed membershape test case
HolgerKnublauch e01a2a6
Fixed missing sh:value at minListLength test
HolgerKnublauch 77f8392
Fixed missing sh:value at uniqueMembers test case
HolgerKnublauch 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
@prefix dash: <http://datashapes.org/dash#> . | ||
@prefix ex: <http://datashapes.org/sh/tests/core/node/memberShape-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:IRIShape a sh:NodeShape ; | ||
sh:nodeKind sh:IRI . | ||
|
||
ex:IRIListShape | ||
rdf:type sh:NodeShape ; | ||
sh:memberShape ex:IRIShape ; | ||
sh:targetNode ex:list0 ; | ||
# Valid empty list | ||
sh:targetNode rdf:nil ; | ||
# ex:list1 is valid, the remainder trigger violations (including ex:list3 which has no properties in this graph) | ||
sh:targetNode ex:list1, ex:list2, ex:list3, ex:list4, ex:list5, ex:list6, ex:list7, ex:list9 ; | ||
. | ||
|
||
ex:list0 | ||
rdf:first ex:Alice ; | ||
rdf:rest ( | ||
ex:Bob | ||
) ; | ||
. | ||
|
||
ex:list1 | ||
rdf:first ex:Alice ; | ||
rdf:rest rdf:nil ; | ||
ex:extraProperty "extra" ; | ||
. | ||
|
||
ex:list2 | ||
rdf:first ex:Alice ; | ||
rdf:rest ( | ||
"Bob" | ||
) | ||
. | ||
|
||
ex:list4 | ||
rdf:first ex:Alice ; | ||
. | ||
|
||
ex:list5 | ||
rdf:first "Charlie" ; | ||
rdf:rest ( | ||
"Donna" | ||
) | ||
. | ||
|
||
ex:list6 | ||
rdf:first "Charlie" ; | ||
. | ||
|
||
ex:list8 rdfs:label "Malformed SHACL List" . | ||
|
||
ex:list7 | ||
rdf:first "Charlie" ; | ||
rdf:rest ex:list8 ; | ||
. | ||
|
||
# using ex:list9 and ex:list10 to test recursive list error | ||
ex:list9 | ||
rdf:first ex:Alice ; | ||
rdf:rest ex:list10 ; | ||
. | ||
|
||
ex:list10 | ||
rdf:first "Bob" ; | ||
rdf:rest ex:list9 . | ||
|
||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<memberShape-001> | ||
) ; | ||
. | ||
|
||
<memberShape-001> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:memberShape 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:list2 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list2 ; | ||
sh:detail [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode "Bob" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; | ||
sh:sourceShape ex:IRIShape ; | ||
sh:value "Bob" ; | ||
] ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list3 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list3 ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list4 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list4 ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list5 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list5 ; | ||
sh:detail [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode "Charlie" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; | ||
sh:sourceShape ex:IRIShape ; | ||
sh:value "Charlie" ; | ||
], [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode "Donna" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; | ||
sh:sourceShape ex:IRIShape ; | ||
sh:value "Donna" ; | ||
] | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list6 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list6 ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list7 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list7 ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:list9 ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ; | ||
sh:sourceShape ex:IRIListShape ; | ||
sh:value ex:list9 ; | ||
] ; | ||
] ; | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@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:value rdf:nil ; | ||
] ; | ||
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.