Class: LD::Patch::Algebra::Patch
- Inherits:
-
SPARQL::Algebra::Operator
- Object
- SPARQL::Algebra::Operator
- LD::Patch::Algebra::Patch
- Includes:
- SPARQL::Algebra::Update
- Defined in:
- lib/ld/patch/algebra/patch.rb
Overview
The LD Patch patch
operator.
Transactionally iterates over all operands building bindings along the way
Constant Summary collapse
- NAME =
:patch
Instance Method Summary collapse
-
#execute(graph, options = {}) ⇒ RDF::Transactable
Executes this upate on the given
transactable
graph or repository.
Instance Method Details
#execute(graph, options = {}) ⇒ RDF::Transactable
Executes this upate on the given transactable
graph or repository.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ld/patch/algebra/patch.rb', line 23 def execute(graph, = {}) debug() {"Delete"} if graph.respond_to?(:transaction) graph.transaction(mutable: true) do |tx| operands.inject(RDF::Query::Solutions.new([RDF::Query::Solution.new])) do |bindings, op| # Invoke operand using bindings from prvious operation op.execute(tx, .merge(bindings: bindings)) end end else operands.inject(RDF::Query::Solutions.new([RDF::Query::Solution.new])) do |bindings, op| # Invoke operand using bindings from prvious operation op.execute(graph, .merge(bindings: bindings)) end end end |