Class: SPARQL::Algebra::Operator::Update
- Includes:
- Update
- Defined in:
- lib/sparql/algebra/operator/update.rb
Overview
The SPARQL GraphPattern prefix operator.
[29] Update ::= Prologue ( Update1 ( ';' Update )? )?
Constant Summary collapse
- NAME =
[:update]
Instance Method Summary collapse
-
#execute(queryable, **options) ⇒ RDF::Queryable
Executes this upate on the given
queryablegraph or repository. -
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this operator.
Methods included from Update
#empty?, #graph_name=, #unshift, #variables
Instance Method Details
#execute(queryable, **options) ⇒ RDF::Queryable
Executes this upate on the given queryable graph or repository.
67 68 69 70 71 72 73 74 |
# File 'lib/sparql/algebra/operator/update.rb', line 67 def execute(queryable, **) debug() {"Update"} raise IOError, "queryable is not mutable" unless queryable.mutable? operands.each do |op| op.execute(queryable, **.merge(depth: [:depth].to_i + 1)) end queryable end |
#to_sparql(**options) ⇒ String
Returns a partial SPARQL grammar for this operator.
81 82 83 |
# File 'lib/sparql/algebra/operator/update.rb', line 81 def to_sparql(**) str = operands.map { |e| e.to_sparql(**) }.join(";\n") end |