antoniogarrote / rdfstore-js

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

Malfunction of Store.Store.prototype.insert() if no graph to insert to is defined. #53

Open l00mi opened 11 years ago

l00mi commented 11 years ago

The insert() of Triples does not work if there is no graph defined to insert into.

if(graph != null) {
    query = "INSERT DATA { GRAPH " + this._nodeToQuery(graph) +" { "+ query + " } }";
} else {
    query = "INSERT DATA { " + this._nodeToQuery(graph) +" { "+ query + " }";
}

The second query is wrong. I did try to change to:

query = "INSERT DATA { " + query + " }";

But without luck, this query is not working either.

l00mi commented 11 years ago

Found the same issues in DELETE.

if(graph != null) {
       query = "DELETE DATA { GRAPH " + this._nodeToQuery(graph) +" { "+ query + " } }";
   } else {
       query = "DELETE DATA { " + this._nodeToQuery(graph) +" { "+ query + " }";
   }