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

Fixes on the store interface .delete() and .insert() #58

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/js-store/src/store.js
Expand Up @@ -609,8 +609,8 @@ Store.Store.prototype.insert = function() {
var callback;
if(arguments.length === 1) {
triples = arguments[0];
callback= function(){};
} else if(arguments.length === 2) {
graph = this.rdf.createNamedNode(this.engine.lexicon.defaultGraphUri);
triples = arguments[0];
callback= arguments[1] || function(){};
} else if(arguments.length === 3) {
Expand All @@ -630,7 +630,7 @@ Store.Store.prototype.insert = function() {
if(graph != null) {
query = "INSERT DATA { GRAPH " + this._nodeToQuery(graph) +" { "+ query + " } }";
} else {
query = "INSERT DATA { " + this._nodeToQuery(graph) +" { "+ query + " }";
query = "INSERT DATA { "+ query + " }";
}

this.engine.execute(query, callback);
Expand Down Expand Up @@ -680,8 +680,8 @@ Store.Store.prototype.delete = function() {
var callback;
if(arguments.length === 1) {
triples = arguments[0];
callback= function(){};
} else if(arguments.length === 2) {
graph = this.rdf.createNamedNode(this.engine.lexicon.defaultGraphUri);
triples = arguments[0];
callback= arguments[1] || function(){};
} else if(arguments.length === 3) {
Expand All @@ -701,7 +701,7 @@ Store.Store.prototype.delete = function() {
if(graph != null) {
query = "DELETE DATA { GRAPH " + this._nodeToQuery(graph) +" { "+ query + " } }";
} else {
query = "DELETE DATA { " + this._nodeToQuery(graph) +" { "+ query + " }";
query = "DELETE DATA { "+ query + " }";
}

this.engine.execute(query, callback);
Expand Down