-
Notifications
You must be signed in to change notification settings - Fork 43
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
JSON query generation generates nested optional while it should not #658
Comments
the critical part that breaks the loading seems to be "children": [
{
"line": {
"s": "object_8",
"p": "http://www.graceful17.org/shacl/sparnatural-config/object_related_to_event",
"o": "event_10",
"sType": "http://www.graceful17.org/shacl/sparnatural-config/object",
"oType": "http://www.graceful17.org/shacl/sparnatural-config/event",
"values": []
}
g17sn:object_related_to_event a sh:PropertyShape ;
rdfs:label "object related to event"@en ;
volipi:message "Tooltip for object related to event (This is only a query pattern)" ;
dash:searchWidget sparnatural:ListProperty ;
sh:class grace:event ;
sh:name "subject of" ;
sh:node g17sn:event ;
sh:nodeKind sh:IRI ;
sh:path [ sh:inversePath grace:event_related_to_object ] . When manually building the branch, the SPARQL forms this correctly: ?object_6 rdf:type <http://www.graceful17.org/ontology/object>;
^<http://www.graceful17.org/ontology/event_related_to_object> ?event_16. What is strange is that a short JSON loads fine as import {
"distinct": true,
"variables": [
{
"termType": "Variable",
"value": "object_1"
}
],
"order": null,
"branches": [
{
"line": {
"s": "object_1",
"p": "http://www.graceful17.org/shacl/sparnatural-config/object_related_to_event",
"o": "event_2",
"sType": "http://www.graceful17.org/shacl/sparnatural-config/object",
"oType": "http://www.graceful17.org/shacl/sparnatural-config/event",
"values": []
},
"children": []
}
]
} |
Probably unrelated but I also get this error when running the query
|
Considering the line where it happens is looks more related to the presence of an "optional" clause in the query. I don't have time to investigate further right now. You have multiple nested optionals, which is bad. Nested optionals are not supported in Sparnatural. |
Understood, and no worries. Yet, the query was built this way, including the nested optionals which are sometimes needed, through Sparnatural and executed without problems. It's only the loading if exposed to another session that fails. |
Sparnatural does not support that. The nested optional you have in you JSON export are buggy, they shouldn't be here. Only the outermost criteria should be flagged as optional. |
I see! Thanks for the fix (I will need to wait for the next release though)! |
Well, for now the JSON and SPARQL are generated separately. |
related to #646 and #647
When importing (
sparnatural.loadQuery(json)
) the following Sparnatural binding (successfully built, executed, and exported with Sparnatural) I get a console error (see below) and only half of the branches are built in the UI. Why is that?Import
Console
Full Log
The text was updated successfully, but these errors were encountered: