Skip to content
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

Error: Unknown graph with iri ?g #76

Open
tpluscode opened this issue Aug 1, 2022 · 0 comments
Open

Error: Unknown graph with iri ?g #76

tpluscode opened this issue Aug 1, 2022 · 0 comments

Comments

@tpluscode
Copy link

tpluscode commented Aug 1, 2022

Describe the bug

Insert/Where with a graph variable fails

To Reproduce

I tried to run the following query

PREFIX sh: <http://www.w3.org/ns/shacl#>

INSERT {
  GRAPH ?g { 
    ?shape sh:property ?property .
    ?property sh:group ?group . 
  }
} WHERE {
  GRAPH ?g { 
    ?shape <http://example.com/group> ?group .
    ?group <http://example.com/property> ?property . 
  }
}

This fails as seen below

node_modules/sparql-engine/dist/rdf/hashmap-dataset.js:81
            throw new Error("Unknown graph with iri " + iri);
            ^

Error: Unknown graph with iri ?g
    at HashMapDataset.getNamedGraph (node_modules/sparql-engine/dist/rdf/hashmap-dataset.js:81:19)
    at UpdateStageBuilder._buildInsertConsumer (node_modules/sparql-engine/dist/engine/stages/update-stage-builder.js:208:81)
    at node_modules/sparql-engine/dist/engine/stages/update-stage-builder.js:192:30
    at Array.map (<anonymous>)
    at UpdateStageBuilder._handleInsertDelete (node_modules/sparql-engine/dist/engine/stages/update-stage-builder.js:191:60)
    at node_modules/sparql-engine/dist/engine/stages/update-stage-builder.js:77:38
    at Array.map (<anonymous>)
    at UpdateStageBuilder.execute (node_modules/sparql-engine/dist/engine/stages/update-stage-builder.js:71:53)
    at PlanBuilder.build (node_modules/sparql-engine/dist/engine/plan-builder.js:211:73)
    at test.js:66:30

Expected behavior

The query should succeed, since ?g is a variable bound in the WHERE clause and not an IRI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant