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
Resource of http://www.w3.org/ns/shacl#value is empty in validation report #55
Comments
Hi @michielhildebrand When using PySHACL as a library as part of a larger python application and called within the code, this problem is not present, the |
The sh:value is also empty in turtle
I also tried it as a python library. I get the exact same result. |
I looked into it a bit closer. I hope this helps to figure out where it goes wrong. pyShacl returns this report:
In here I would expect the sh:value of the last ValidationResult to contain the sh:focusNode of the first ValidationResult. In Topbraid this is the case:
|
Thanks @michielhildebrand I think I've determined why this is not working properly for you, I've just got to isolate the exact set of conditions to replicate it. Edit: yep, I see that it affects sh:focusNode too. the Validation Report graph is a bit weird because it contains nodes from both the SHACL Shape Graph, and the DataGraph, smooshed into one representation. What is important here is that FocusNode and ValueNode are the only two entries in each ValidationResult which originate from the DataGraph. Since v0.11.0 pyshacl uses rdflib.Dataset rather than rdflib.Graph for its internal rdf store, which means when I'm pulling nodes from the Data graph to put in the validation report, it doesn't know which namedgraph to use when querying them, so just comes back blank. I don't know why this hasn't been caught by the tests, there are tests in place to ensure this kind of regression doesn't happen. |
@michielhildebrand |
Fixed by #cf6df94 |
Cool! I see something in the valueNode now. Thanks a lot. BTW. Sorry for the delay. I was offline for a few weeks. |
Hi Ashley, I noticed an issue with the fix. In case the value is a blank node you seem to generate a new id for it. Therefore the same blank node occurring in a value and in a focusNode can not be compared on id. |
Hi @michielhildebrand I think I might be able to fix the second part you mentioned about the valueNode and focusNode not having the same ID in the Report Graph. In the current implementation they are both copied over separately (thus they are two new blank nodes), but I could put a simple check if they are the same node, only copy it into the report graph once, then use that for both valueNode and focusNode, then they will have the same ID. I'll create a new issue for it. |
New issue #57 |
In the report the resource found in a http://www.w3.org/ns/shacl#value is empty, see the json below.
This report is the result of a propertyShape with a sh:node constraint. The first validation result in the example contains the information of the shape containing the sh:node. This fine. The value (N6087b61f1f1d44e08519420c185ba3f2) should contain the information of the result for the sh:node. I confirmed this in TopBraid.
The text was updated successfully, but these errors were encountered: