antoniogarrote/rdfstore-js

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

l00mi opened this issue · 1 comments

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.

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 + " }";
   }