class SPARQL::Client::Update::DeleteData
Attributes
data[R]
@return [RDF::Enumerable]
Public Class Methods
new(data, **options)
click to toggle source
Delete statements from the graph
@example DELETE DATA { <example.org/jhacker> <xmlns.com/foaf/0.1/name> "J. Random Hacker" .}
data = RDF::Graph.new do |graph| graph << [RDF::URI('http://example.org/jhacker'), RDF::Vocab::FOAF.name, "J. Random Hacker"] end delete_data(data)
@param [Array<RDF::Statement>, RDF::Enumerable] data @param [Hash{Symbol => Object}] options
Calls superclass method
SPARQL::Client::Update::Operation::new
# File lib/sparql/client/update.rb, line 224 def initialize(data, **options) @data = data super(**options) end
Public Instance Methods
graph(uri)
click to toggle source
Cause data to be deleted from the graph specified by `uri`
@param [RDF::URI] uri @return [self]
# File lib/sparql/client/update.rb, line 234 def graph(uri) self.options[:graph] = uri self end
to_s()
click to toggle source
# File lib/sparql/client/update.rb, line 239 def to_s query_text = 'DELETE DATA {' query_text += ' GRAPH ' + SPARQL::Client.serialize_uri(self.options[:graph]) + ' {' if self.options[: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" end