Thanks to visit codestin.com
Credit goes to github.com

Skip to content

.set("val").sparql may result in DELETE DATA query with variables #352

@andrewzhurov

Description

@andrewzhurov

Paths, such as:

await path.create("http://example.com/subj1")
          .somePredicate
          .set("new value")
          .sparql

May result in DELETE DATA queries with variables, such as:

DELETE DATA {
  <http://example.com/subj1> <http://example.com/somePredicate> ?somePredicate.
}
;
INSERT DATA {
  <http://example.com/subj1> <http://example.com/somePredicate> "new value".
}

Which is okay by LDFlex, as seen in this test.

However, as per the spec, variables are not allowed in DELETE DATA queries, and other query engines that are more strictly conformant to the spec may fail to execute such queries, e.g., Comunica fails with:

SparqlParser.js:1193 Uncaught (in promise) Error: Detected illegal variable in BGP
    at Yr (SparqlParser.js:1193:19)
    at Object.performAction (SparqlParser.js:336:62)
    at tn.parse (SparqlParser.js:787:36)
    at Parser.d.parse (sparql.js:36:37)
    at s.run (ActorQueryParseSparql.ts:27:33)
    at s.runObservable (Actor.ts:83:37)
    at i.mediate (Mediator.ts:86:18)
    at async a.queryOrExplain (QueryEngineBase.ts:165:13)
    at async a.query (QueryEngineBase.ts:87:11)
    at async a.queryOfType (QueryEngineBase.ts:70:11)

Perhaps having such paths result in DELETE ... WHERE ... would make LDFlex more conformant with the spec and allow their execution by other engines.

Environment:
"@ldflex/comunica": "^5.0.1",
"ldflex": "^2.15.2",
"@comunica/query-sparql": "^2.6.9",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions