-
Notifications
You must be signed in to change notification settings - Fork 13
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
Checking for existence of instance of a class not working? #107
Comments
Indeed, that is a know issue. If nothing in the data graph matches any shape targets (ie. in your example there is no resource with type SHACL Play! shows a different message, not equivalent to failed validation. That may be a UI-only feature |
A shape with sh:targetNode will always be executed, regardless of whether the graph contains that node, or any node. It will simply set the target to the given targetNode even if it doesn't "exist". So - from my superficial look - the validation engine should report a violation if there is no instance of that class. |
That does make sense but isn't it the opposite of what you said on Discord and also to how the engines behave? I don't know which version of SHACL_TQ weso.es uses, but all engines report success when the shape has no target or target which is not present in data graph https://rdfshape.weso.es/link/16789515368 By the way @jakubklimek, I noticed only now that you should change |
@tpluscode Actually, if I understand the Wiki example correctly, having |
ah ok, I failed to really understand before. Yes, without a logic as described by Holger this cannot work. Otherwise it does assume that no targets found => no validation |
I propose we revert #81 because we misunderstood the spec (and the example to check there is at least one instance is useful) |
Can you link to the spec where this is scenario mentioned? |
https://www.w3.org/TR/shacl/#targets
|
I want to check whether in the Data graph, there is at least one instance of
dcat:Catalog
. I followed this example from the SHACL wiki.tl;dr: It does not work in Zazuko, it works in SHACL Play!, but I am not sure which behavior is the correct one.
Data graph - note that there is one instance of
dcat:Catalog
:Shapes graph:
Like this, it validates in Zazuko. However, if I remove the
dcat:Catalog
, e.g., by emptying the data graph, it still validates, which is not what I want. According to the example, and also in SHACL Play! it does not validate, which is what I want. However, I am not sure that the example is correct, since the targetNode cannot target anything, when there is nodcat:Dataset
in the data graph, and therefore there is nothing to validate, and therefore the data graph seems valid. 🤷🏻♂️The text was updated successfully, but these errors were encountered: