antoniogarrote / rdfstore-js

JS RDF store with SPARQL support
MIT License
564 stars 109 forks source link

problem with parsing function arguments #132

Closed cie closed 8 years ago

cie commented 8 years ago

Hi! There's something wrong with the SPARQL parser concerning function arguments and whitespace. This gives a parse error:

const rdfstore = require("rdfstore")
rdfstore.create(function(err, store) {
    store.execute("SELECT * {FILTER ab:cd(1 + as:df() )}", function(err, res) {
        if(err) console.error(err);
        else console.log(res);
    })
})

However, if you remove the whitespace after the inner function call, it works:

const rdfstore = require("rdfstore")
rdfstore.create(function(err, store) {
    store.execute("SELECT * {FILTER ab:cd(1 + as:df())}", function(err, res) {
        if(err) console.error(err);
        else console.log(res);
    })
})