lib/ld/patch/algebra/patch.rb in ld-patch-3.1.1 vs lib/ld/patch/algebra/patch.rb in ld-patch-3.1.2
- old
+ new
@@ -21,13 +21,20 @@
# @raise [Error]
# If any error is caught along the way, and rolls back the transaction
def execute(graph, options = {})
debug(options) {"Delete"}
- graph.transaction(mutable: true) do |tx|
+ 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, options.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(tx, options.merge(bindings: bindings))
+ op.execute(graph, options.merge(bindings: bindings))
end
end
end
end
end
\ No newline at end of file