Module: SPARQL::Algebra::Update Abstract
- Included in:
- Operator::Add, Operator::Clear, Operator::Copy, Operator::Create, Operator::Delete, Operator::DeleteData, Operator::DeleteWhere, Operator::Drop, Operator::Insert, Operator::InsertData, Operator::Load, Operator::Modify, Operator::Move, Operator::Sequence, Operator::Update, Operator::With
- Defined in:
- lib/sparql/algebra/update.rb
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
-
#execute(queryable, **options, &block) ⇒ RDF::Writable
Executes this upate on the given
queryable
graph or repository. -
#graph_name=(value) ⇒ RDF::URI, RDF::Query::Variable
Add graph_name to sub-items, unless they already have a graph_name.
-
#unshift(query)
Prepends an operator.
-
#variables ⇒ Hash{Symbol => RDF::Query::Variable}
The variables used in this update.
Instance Method Details
#execute(queryable, **options, &block) ⇒ RDF::Writable
Executes this upate on the given queryable
graph or repository.
42 43 44 |
# File 'lib/sparql/algebra/update.rb', line 42 def execute(queryable, **, &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
49 50 51 52 53 54 |
# File '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.
15 16 17 18 |
# File 'lib/sparql/algebra/update.rb', line 15 def unshift(query) @operands.unshift(query) self end |
#variables ⇒ Hash{Symbol => RDF::Query::Variable}
The variables used in this update.
24 25 26 |
# File 'lib/sparql/algebra/update.rb', line 24 def variables operands.inject({}) {|hash, o| o.executable? ? hash.merge(o.variables) : hash} end |