Module: SPARQL::Algebra::Update Abstract

Overview

This module is abstract.

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

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

Instance Method Summary collapse

Instance Method Details

#execute(queryable, **options, &block) ⇒ RDF::Writable

Executes this upate on the given queryable graph or repository.

Parameters:

Options Hash (**options):

  • debug (Boolean)

    Query execution debugging

Returns:

Raises:

  • (NotImplementedError)

    If an attempt is made to perform an unsupported operation

See Also:



42
43
44
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/sparql-ffa592c8f275/lib/sparql/algebra/update.rb', line 42

def execute(queryable, **options, &block)
  raise NotImplementedError, "#{self.class}#execute(#{queryable})"
end

#graph_name=(value) ⇒ RDF::URI, RDF::Query::Variable

Add graph_name to sub-items, unless they already have a graph_name

Parameters:

Returns:



49
50
51
52
53
54
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/sparql-ffa592c8f275/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)

This method returns an undefined value.

Prepends an operator.

Parameters:



15
16
17
18
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/sparql-ffa592c8f275/lib/sparql/algebra/update.rb', line 15

def unshift(query)
  @operands.unshift(query)
  self
end

#variablesHash{Symbol => RDF::Query::Variable}

The variables used in this update.



24
25
26
# File 'vendor/bundler/ruby/3.0.0/bundler/gems/sparql-ffa592c8f275/lib/sparql/algebra/update.rb', line 24

def variables
  operands.inject({}) {|hash, o| o.executable? ? hash.merge(o.variables) : hash}
end