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

Issue with Store.executeWithEnvironment, docs outdated? #119

Closed
fbaumgardt opened this issue Jun 22, 2016 · 2 comments
Closed

Issue with Store.executeWithEnvironment, docs outdated? #119

fbaumgardt opened this issue Jun 22, 2016 · 2 comments

Comments

@fbaumgardt
Copy link
Contributor

I am trying to run SPARQL queries on the union of all named graphs, providing a defaultDataset like the README shows. This doesn't seem to work. If I construct the dataset with objects

{
token: "uri",
value:<graph-uri>
}

It ends up being wrapped in another object of similar shape and ultimately fails at https://github.com/antoniogarrote/rdfstore-js/blob/master/src/utils.js#L90. Defining a dataset with plain strings in an array does not throw an exception but also yields an empty result. Am I doing something wrong or is this a known issue?

@fbaumgardt
Copy link
Contributor Author

Quick update:

I derived the named graphs dataset from Store.registeredGraphs and that list contained duplicates. QueryPlanDPSize.executeBGPDatasets fails silently if https://github.com/antoniogarrote/rdfstore-js/blob/master/src/query_plan.js#L460 evaluates to false.

@smpadhy
Copy link

smpadhy commented Aug 18, 2017

I am trying to run SPARQL queries on an array of NamedGraphs as shown in the README document. I am still experiencing the issue as mentioned in this issue. I am getting error in at this line: https://github.com/antoniogarrote/rdfstore-js/blob/master/src/utils.js#L90
I saw an update has been made to fix this issue since the issue posted and merged to master but not sure that if README has been updated to reflect that.

I will appreciate any idea on this issue.

For reference here is the details of the example I am trying:

var defaultGraph = []
var namedGraphs = [{'token':'uri', 'value': 'http://example.org/bob'}, {'token':'uri',' value': 'http://example.org/alice'}]
store.executeWithEnvironment("SELECT * { ?s ?p ?o }", defaultGraph, namedGraphs, function(err, results) {
if(err) {
// process results
}
console.log("results: ", results)
})

From registeredGraphs, I am getting these two named graph: [ 'http://example.org/alice',
'http://example.org/bob' ]

The error I am getting as follows:

/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/utils.js:90
if(uri.indexOf(":") == -1) {
^

TypeError: uri.indexOf is not a function
at Object.lexicalFormBaseUri (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/utils.js:90:16)
at QueryEngine.normalizeTerm (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/query_engine.js:350:25)
at /Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/query_engine.js:402:18
at iterate (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/utils.js:377:9)
at Object.eachSeries (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/utils.js:393:5)
at QueryEngine.normalizeDatasets (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/query_engine.js:397:11)
at QueryEngine.executeSelect (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/query_engine.js:752:14)
at QueryEngine.executeQuery (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/query_engine.js:642:14)
at QueryEngine.execute (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/query_engine.js:618:22)
at Store.executeWithEnvironment (/Users/smruti/gitrepo/rdfNidm/node_modules/rdfstore/src/store.js:217:17)

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

3 participants