Skip to content

Commit

Permalink
use INSERT { GRAPH ...} instead of INSERT GRAPH {...} to work for vir…
Browse files Browse the repository at this point in the history
…tuoso
  • Loading branch information
syphax-bouazzouni committed Apr 30, 2024
1 parent c841d9d commit 94cffd9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/sparql/client/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,13 @@ def expects_statements?
end

def to_s
query_text = 'INSERT DATA {'
query_text += ' GRAPH ' + SPARQL::Client.serialize_uri(self.options[:graph]) + ' {' if self.options[:graph]
graph = " GRAPH #{SPARQL::Client.serialize_uri(self.options[:graph])} " if self.options[:graph]
query_text = 'INSERT {'
query_text += graph + + ' {'
query_text += "\n"
query_text += RDF::NTriples::Writer.buffer { |writer| @data.each { |d| writer << d } }
query_text += '}' if self.options[:graph]
query_text += "}\n"
query_text + "}\n"
end
end

Expand Down

0 comments on commit 94cffd9

Please sign in to comment.