Class: SPARQL::Client::Update::Clear
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb
Overview
Direct Known Subclasses
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Attributes inherited from Operation
Instance Method Summary collapse
-
#all ⇒ self
Cause data to be cleared from all graphs.
-
#default ⇒ self
Cause data to be cleared from the default graph.
-
#expects_statements? ⇒ false
Clear always returns statements.
-
#graph(uri) ⇒ self
Cause data to be cleared from graph specified by
uri
. -
#named ⇒ self
Cause data to be cleared from named graphs.
- #to_s ⇒ Object
Methods inherited from Operation
Constructor Details
This class inherits a constructor from SPARQL::Client::Update::Operation
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
355 356 357 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 355 def uri @uri end |
Instance Method Details
#all ⇒ self
Cause data to be cleared from all graphs
389 390 391 392 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 389 def all @what = :all self end |
#default ⇒ self
Cause data to be cleared from the default graph
371 372 373 374 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 371 def default @what = :default self end |
#expects_statements? ⇒ false
Clear always returns statements
398 399 400 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 398 def expects_statements? false end |
#graph(uri) ⇒ self
Cause data to be cleared from graph specified by uri
362 363 364 365 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 362 def graph(uri) @what, @uri = :graph, uri self end |
#named ⇒ self
Cause data to be cleared from named graphs
380 381 382 383 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 380 def named @what = :named self end |
#to_s ⇒ Object
402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 402 def to_s query_text = 'CLEAR ' query_text += 'SILENT ' if self.[:silent] case @what.to_sym when :graph then query_text += 'GRAPH ' + SPARQL::Client.serialize_uri(@uri) when :default then query_text += 'DEFAULT' when :named then query_text += 'NAMED' when :all then query_text += 'ALL' else raise ArgumentError, "invalid CLEAR operation: #{@what.inspect}" end query_text end |