module SPARQL::Algebra::Update

A SPARQL algebra Update can make modifications to it's dataset

Mixin with SPARQL::Algebra::Operator to provide update-like operations on graphs

@abstract

Public Instance Methods

execute(queryable, **options, &block) click to toggle source

Executes this upate on the given `queryable` graph or repository.

@param [RDF::Writable] queryable

the graph or repository to write

@param [Hash{Symbol => Object}] options

any additional keyword options

@option options [Boolean] debug

Query execution debugging

@return [RDF::Writable]

Returns the dataset.

@raise [NotImplementedError]

If an attempt is made to perform an unsupported operation

@see www.w3.org/TR/sparql11-update/

# File lib/sparql/algebra/update.rb, line 42
def execute(queryable, **options, &block)
  raise NotImplementedError, "#{self.class}#execute(#{queryable})"
end
graph_name=(value) click to toggle source

Add graph_name to sub-items, unless they already have a graph_name @param [RDF::URI, RDF::Query::Variable] value @return [RDF::URI, RDF::Query::Variable]

# File lib/sparql/algebra/update.rb, line 49
def graph_name=(value)
  operands.each do |operand|
    operand.graph_name = value if operand.respond_to?(:graph_name) && operand.graph_name != false
  end
  value
end
unshift(query) click to toggle source

Prepends an operator.

@param [RDF::Query] query

a query

@return [void] self

# File lib/sparql/algebra/update.rb, line 15
def unshift(query)
  @operands.unshift(query)
  self
end
variables() click to toggle source

The variables used in this update.

@return [Hash{Symbol => RDF::Query::Variable}]

# File lib/sparql/algebra/update.rb, line 24
def variables
  operands.inject({}) {|hash, o| o.executable? ? hash.merge(o.variables) : hash}
end