-
Notifications
You must be signed in to change notification settings - Fork 30
Issue 189: Add sh:nodeByExpression
Constraint Component
#408
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
mgberg
wants to merge
9
commits into
gh-pages
Choose a base branch
from
issue-189
base: gh-pages
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.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ef4d05b
Add sh:nodeByExpression to spec
mgberg a0cd31b
Add sh:nodeByExpression to vocabulary
mgberg f959d1c
Add test cases for sh:nodeByExpression
mgberg 23d4057
Replace "conformance checking" with "conformance check", remove leadi…
mgberg 0cb88b4
Apply requested spec edits for sh:nodeByExpression section
mgberg 1672ee9
Apply requested test edits for sh:nodeByExpression
mgberg 401f7c2
Update shacl12-core/index.html
mgberg a355688
Extend sh:nodeByExpression description
mgberg 6376bfa
Include sh:nodeByExpression example in the core spec scoped to the co…
mgberg 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
59 changes: 59 additions & 0 deletions
59
shacl12-test-suite/tests/core/node/nodeByExpression-001.ttl
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/nodeByExpression-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:InvalidInstance | ||
rdf:type ex:TestClass ; | ||
rdfs:label "Invalid instance" ; | ||
. | ||
ex:TestClass | ||
rdf:type rdfs:Class ; | ||
rdf:type sh:NodeShape ; | ||
rdfs:label "Test class" ; | ||
rdfs:subClassOf rdfs:Resource ; | ||
# Only using an IRI Expression here because Core doesn't define interesting node expressions | ||
sh:nodeByExpression ex:TestNodeShape ; | ||
. | ||
ex:TestNodeShape | ||
rdf:type sh:NodeShape ; | ||
sh:class ex:OtherClass ; | ||
. | ||
ex:ValidInstance | ||
rdf:type ex:OtherClass ; | ||
rdf:type ex:TestClass ; | ||
rdfs:label "Valid instance" ; | ||
. | ||
<> | ||
rdf:type mf:Manifest ; | ||
mf:entries ( | ||
<nodeByExpression-001> | ||
) ; | ||
. | ||
<nodeByExpression-001> | ||
rdf:type sht:Validate ; | ||
rdfs:label "Test of sh:nodeByExpression at 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:InvalidInstance ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraint ex:TestNodeShape ; | ||
sh:sourceConstraintComponent sh:NodeConstraintComponent ; | ||
sh:sourceShape ex:TestClass ; | ||
sh:value ex:InvalidInstance ; | ||
] ; | ||
] ; | ||
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
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.
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.
An example at this point showing where it is different to
sh:node
would be useful.Uh oh!
There was an error while loading. Please reload this page.
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.
An example was removed as per the discussion above (here and here).
There are two differences between
sh:nodeByExpression
andsh:node
within the scope of the core spec:sh:nodeByExpression
cannot take a node shape that is a blank node assh:node
can, as a blank node would be interpreted as a Node Expression.sh:nodeByExpression
additionally include a value forsh:sourceConstraint
.The example I originally included was essentially a duplicate of the example for
sh:node
with the constraint component replaced and a value forsh:sourceConstraint
in the example result. @HolgerKnublauch suggested I remove it and wait to put a more comprehensive example in the Node Expression spec.I can certainly revert that change if it is desired to have that example back.
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.
Thanks for the explanation.
As a general comment, I'm not sure we are helping users by not including examples that show clear node expressions in Core but that's not for this PR.
(Do people really think there will be common static only SHACL 1.2 implementations?)
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.
@afs I mean there are some SHACL 1.0 ones that don't support SPARQL-based constraints such as https://github.com/zazuko/rdf-validate-shacl#limitations (on which https://shacl-playground.zazuko.com/ is based) for example.
@mgberg I like this description as well.. can't we add this as well to the text?
I don't think one can have too much examples, esp. if they help clearing things up.
+1 to adding it back
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.
@simonstey I modified the description in the spec to include those points explicitly, and I also added the example back.