Closed ch-sander closed 4 weeks ago
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": []
}
object_related_to_event
is defined by a sh:PropertyShape
with the sh:path
as [object_related_to_event](sh:inversePath grace:event_related_to_object)
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
Error: e is undefined content_script.js:80:218
G_cp_3a content_script.js:80
G_cp_Vb content_script.js:115
(Async: promise callback)
G_cp_Vb content_script.js:115
G_cp_id content_script.js:247
G_cp_zc content_script.js:244
G_cp_yc content_script.js:244
G_cp_4c content_script.js:232
onsubmit ask:1
submitAction SubmitSection.ts:28
Xi PlayBtn.ts:18
jQuery 2
(Async: EventListener.handleEvent)
addEventListener ask:1
jQuery 6
Xi PlayBtn.ts:15
render SubmitSection.ts:16
render SparnaturalComponent.ts:41
initSpecificationProvider SparnaturalComponent.ts:84
build SparnaturalSpecificationFactory.ts:53
buildStore BaseRDFReader.ts:102
(Async: promise callback)
buildStore BaseRDFReader.ts:91
build SparnaturalSpecificationFactory.ts:40
initSpecificationProvider SparnaturalComponent.ts:82
render SparnaturalComponent.ts:34
display SparnaturalElement.ts:64
connectedCallback SparnaturalElement.ts:41
<anonym> SparnaturalElement.ts:178
<anonym> SparnaturalElement.ts:178
<anonym> SparnaturalElement.ts:178
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.
Yet, the query was built this way, including the nested optionals which are sometimes needed
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)! I believed that the JSON is creating the SPARQL on the fly, and as the SPARQL looked okay to me (all in one OPTIONAL), I assumed the JSON must have been correct as well.
Well, for now the JSON and SPARQL are generated separately. But soon soon we will have the SPARQL generated from the JSON.
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