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
SHACL - Scoping of logical operators with sh:hasValue and dash:hasValueIn #2458
Comments
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
I'm not sure I understand the example. Why should this succeed? The contraint appears to expresss that every instance of test must have a value for |
The definition for sh:and is "for every value" so if there are no values then it should succeed. Further more, each shape inside the sh:and is a node shape. So we are actually saying that each value for sh:info should be "red" and "blue" and ... It took me a while to understand it. It's fairly counter intuitive. |
...but the example is an |
I'll update the title. The definition sh:and and sh:or are the same wrt. how they operate if there are not elements and how they operate on value nodes vs. targets. |
If I'm getting this correctly, the way to retain the old behaviour for target shapes is to use paths? So, for example, if I want this Shape to target people named Aerith or Bob, and not to match on null names, I'd do:
Whereas if I want to match null names, I'd go for:
That one is hard to wrap one's head around, maybe you'll need some documentation pointing out how it works. Not that such documentation wouldn't be better off located in the SHACL spec. |
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
* #2458 initial test cases Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * more test cases Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * GH-2458 initial fix Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * GH-2458 better fix Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * more passing tests Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * GH-2458 all tests pass Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * fixed based on review Signed-off-by: Håvard Ottestad <hmottestad@gmail.com> * GH-2458 added some more test cases and fixed them Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
There is a scoping issue for sh:or when used node shapes vs property shapes.
The above example fails validation in the ShaclSail, but should pass since
sh:hasValue
is inside ash:nodeShape
and thus each value is validated independently.The text was updated successfully, but these errors were encountered: