Class: SPARQL::Algebra::Operator::Update

Inherits:
SPARQL::Algebra::Operator show all
Includes:
Update
Defined in:
vendor/bundler/ruby/2.5.0/bundler/gems/sparql-b66c70fb77a0/lib/sparql/algebra/operator/update.rb

Overview

The SPARQL GraphPattern prefix operator.

Examples:

(update
  (modify
    (bgp (triple ?s ?p ?o))
    (insert ((triple ?s ?p "q")))))

See Also:

Constant Summary collapse

NAME =
[:update]

Constants inherited from SPARQL::Algebra::Operator

ARITY, IsURI, URI

Instance Attribute Summary

Attributes inherited from SPARQL::Algebra::Operator

#operands

Instance Method Summary collapse

Methods included from Update

#graph_name=, #unshift, #variables

Methods inherited from SPARQL::Algebra::Operator

#aggregate?, arity, #base_uri, base_uri, base_uri=, #boolean, #constant?, #each_descendant, #eql?, #evaluatable?, evaluate, #executable?, #first_ancestor, for, #initialize, #inspect, #ndvars, #node?, #operand, #optimize, #parent, #parent=, prefixes, #prefixes, prefixes=, #rewrite, #to_binary, #to_sxp, #to_sxp_bin, #validate!, #variable?, #vars

Methods included from Expression

cast, #constant?, #evaluate, extension, extensions, for, #invalid?, new, #node?, open, #optimize, parse, register_extension, #to_sxp_bin, #valid?, #validate!, #variable?

Constructor Details

This class inherits a constructor from SPARQL::Algebra::Operator

Instance Method Details

#execute(queryable, options = {}) ⇒ RDF::Queryable

Executes this upate on the given queryable graph or repository.

Parameters:

  • queryable (RDF::Queryable)

    the graph or repository to write

  • options (Hash{Symbol => Object}) (defaults to: {})

    any additional keyword options

Options Hash (options):

  • debug (Boolean)

    Query execution debugging

Returns:

Raises:

  • (NotImplementedError)

    If an attempt is made to perform an unsupported operation

  • (IOError)

    If queryable is immutable

See Also:



34
35
36
37
38
39
40
41
# File 'vendor/bundler/ruby/2.5.0/bundler/gems/sparql-b66c70fb77a0/lib/sparql/algebra/operator/update.rb', line 34

def execute(queryable, options = {})
  debug(options) {"Update"}
  raise IOError, "queryable is not mutable" unless queryable.mutable?
  operands.each do |op|
    op.execute(queryable, options.merge(depth: options[:depth].to_i + 1))
  end
  queryable
end