Class: SPARQL::Client::Update::Create

Inherits:
Operation show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb

Overview

Instance Attribute Summary collapse

Attributes inherited from Operation

#options

Instance Method Summary collapse

Methods inherited from Operation

#expects_statements?, #silent

Constructor Details

#initialize(uri, **options) ⇒ Create

Returns a new instance of Create.

Parameters:



422
423
424
425
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 422

def initialize(uri, **options)
  @uri = RDF::URI(uri)
  super(**options)
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



419
420
421
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 419

def uri
  @uri
end

Instance Method Details

#to_sObject



427
428
429
430
431
432
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-client-464d3f76cfd5/lib/sparql/client/update.rb', line 427

def to_s
  query_text = 'CREATE '
  query_text += 'SILENT ' if self.options[:silent]
  query_text += 'GRAPH ' + SPARQL::Client.serialize_uri(@uri)
  query_text
end