Class: SPARQL::Client::Update::DeleteData
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb
Overview
Instance Attribute Summary collapse
- #data ⇒ RDF::Enumerable readonly
Attributes inherited from Operation
Instance Method Summary collapse
-
#graph(uri) ⇒ self
Cause data to be deleted from the graph specified by
uri
. -
#initialize(data, **options) ⇒ DeleteData
constructor
Delete statements from the graph.
- #to_s ⇒ Object
Methods inherited from Operation
Constructor Details
#initialize(data, **options) ⇒ DeleteData
Delete statements from the graph
224 225 226 227 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 224 def initialize(data, **) @data = data super(**) end |
Instance Attribute Details
#data ⇒ RDF::Enumerable (readonly)
211 212 213 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 211 def data @data end |
Instance Method Details
#graph(uri) ⇒ self
Cause data to be deleted from the graph specified by uri
234 235 236 237 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 234 def graph(uri) self.[:graph] = uri self end |
#to_s ⇒ Object
239 240 241 242 243 244 245 246 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 239 def to_s query_text = 'DELETE DATA {' query_text += ' GRAPH ' + SPARQL::Client.serialize_uri(self.[:graph]) + ' {' if self.[:graph] query_text += "\n" query_text += RDF::NTriples::Writer.buffer { |writer| @data.each { |d| writer << d } } query_text += '}' if self.[:graph] query_text += "}\n" end |