-
Notifications
You must be signed in to change notification settings - Fork 30
#160: Allow lists at sh:class and sh:datatype #395
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 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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,45 @@ | ||
@prefix dash: <http://datashapes.org/dash#> . | ||
@prefix ex: <http://datashapes.org/sh/tests/core/node/datatype-003.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:TestShape | ||
rdf:type sh:NodeShape ; | ||
sh:datatype ( xsd:string rdf:langString ) ; | ||
sh:targetNode "<span>Hello</span>"^^rdf:HTML ; | ||
sh:targetNode "G'day"@en-AU ; | ||
sh:targetNode "Hallo"@de ; | ||
sh:targetNode "Hello" ; | ||
. | ||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<datatype-003> | ||
) ; | ||
. | ||
<datatype-003> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:datatype at node shape 003" ; | ||
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 "<span>Hello</span>"^^rdf:HTML ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; | ||
sh:sourceShape ex:TestShape ; | ||
sh:value "<span>Hello</span>"^^rdf:HTML ; | ||
] ; | ||
] ; | ||
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,98 @@ | ||
@prefix dash: <http://datashapes.org/dash#> . | ||
@prefix ex: <http://datashapes.org/sh/tests/core/property/class-002.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:InvalidResource1 | ||
rdf:type rdfs:Resource ; | ||
ex:testProperty ex:InvalidResource1 ; | ||
ex:testProperty "A string" ; | ||
. | ||
ex:OtherClass | ||
rdf:type rdfs:Class ; | ||
. | ||
ex:OtherClassInstance | ||
rdf:type ex:OtherClass ; | ||
. | ||
ex:SubClass | ||
rdf:type rdfs:Class ; | ||
rdfs:subClassOf ex:SuperClass ; | ||
. | ||
ex:SubClassInstance | ||
rdf:type ex:SubClass ; | ||
. | ||
ex:SuperClass | ||
rdf:type rdfs:Class ; | ||
. | ||
ex:SuperClassInstance | ||
rdf:type ex:SuperClass ; | ||
. | ||
ex:TestShape | ||
rdf:type sh:NodeShape ; | ||
sh:property ex:TestShape-testProperty ; | ||
sh:targetNode ex:InvalidResource1 ; | ||
sh:targetNode ex:ValidResource1 ; | ||
sh:targetNode ex:ValidResource2 ; | ||
. | ||
ex:TestShape-testProperty | ||
sh:path ex:testProperty ; | ||
rdfs:label "test property" ; | ||
sh:class ( ex:SuperClass ex:OtherClass ) ; | ||
. | ||
ex:ValidResource1 | ||
rdf:type rdfs:Resource ; | ||
ex:testProperty ex:OtherClassInstance ; | ||
ex:testProperty ex:SubClassInstance ; | ||
ex:testProperty ex:SuperClassInstance ; | ||
. | ||
ex:ValidResource2 | ||
rdf:type rdfs:Resource ; | ||
ex:testProperty [ | ||
rdf:type ex:SubClass ; | ||
] ; | ||
ex:testProperty [ | ||
rdf:type ex:SuperClass ; | ||
] ; | ||
. | ||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<class-002> | ||
) ; | ||
. | ||
<class-002> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:class at property shape 002" ; | ||
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:InvalidResource1 ; | ||
sh:resultPath ex:testProperty ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:ClassConstraintComponent ; | ||
sh:sourceShape ex:TestShape-testProperty ; | ||
sh:value ex:InvalidResource1 ; | ||
] ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:focusNode ex:InvalidResource1 ; | ||
sh:resultPath ex:testProperty ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:ClassConstraintComponent ; | ||
sh:sourceShape ex:TestShape-testProperty ; | ||
sh:value "A string" ; | ||
] ; | ||
] ; | ||
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,62 @@ | ||
@prefix dash: <http://datashapes.org/dash#> . | ||
@prefix ex: <http://datashapes.org/sh/tests/core/property/datatype-004.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:InvalidInstance1 | ||
ex:value 42 ; | ||
. | ||
ex:TestShape | ||
rdf:type sh:NodeShape ; | ||
sh:property ex:TestShape-value ; | ||
sh:targetNode ex:InvalidInstance1 ; | ||
sh:targetNode ex:ValidInstance1 ; | ||
sh:targetNode ex:ValidInstance2 ; | ||
sh:targetNode ex:ValidInstance3 ; | ||
. | ||
ex:TestShape-value | ||
sh:path ex:value ; | ||
sh:datatype ( xsd:string rdf:langString ) ; | ||
. | ||
ex:ValidInstance1 | ||
ex:value "A" ; | ||
. | ||
ex:ValidInstance2 | ||
ex:value "A" ; | ||
. | ||
ex:ValidInstance3 | ||
ex:value "A"@en ; | ||
. | ||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<datatype-004> | ||
) ; | ||
. | ||
<datatype-004> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:datatype at property shape 004" ; | ||
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:InvalidInstance1 ; | ||
sh:resultPath ex:value ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; | ||
sh:sourceShape ex:TestShape-value ; | ||
sh:value 42 ; | ||
] ; | ||
] ; | ||
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
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.