Class: SPARQL::Algebra::Operator::Base
- Inherits:
-
Binary
- Object
- SPARQL::Algebra::Operator
- Binary
- SPARQL::Algebra::Operator::Base
- Includes:
- Query
- Defined in:
- lib/sparql/algebra/operator/base.rb
Overview
The SPARQL GraphPattern base
operator.
Constant Summary collapse
- NAME =
[:base]
Constants inherited from Binary
SPARQL::Algebra::Operator::Binary::ARITY
Constants inherited from SPARQL::Algebra::Operator
Instance Attribute Summary
Attributes included from Query
Attributes inherited from SPARQL::Algebra::Operator
Instance Method Summary collapse
-
#execute(queryable, options = {}) ⇒ RDF::Query::Solutions
Executes this query on the given
queryable
graph or repository. -
#optimize ⇒ Union, RDF::Query
Returns an optimized version of this query.
Methods included from Query
#context=, #each_solution, #failed?, #matched?, #unshift, #variables
Methods inherited from Binary
Methods inherited from SPARQL::Algebra::Operator
arity, base_uri, #base_uri, base_uri=, #boolean, #constant?, #eql?, #evaluatable?, evaluate, #executable?, for, #initialize, #inspect, #operand, prefixes, #prefixes, prefixes=, #to_sse, #to_sxp, #variable?
Methods included from Evaluatable
Methods included from Expression
cast, #constant?, #evaluate, for, new, open, parse, #to_sse, #variable?
Constructor Details
This class inherits a constructor from SPARQL::Algebra::Operator::Binary
Instance Method Details
#execute(queryable, options = {}) ⇒ RDF::Query::Solutions
Executes this query on the given queryable
graph or repository.
Really a pass-through, as this is a syntactic object used for providing
context for relative URIs.
28 29 30 31 32 33 |
# File 'lib/sparql/algebra/operator/base.rb', line 28 def execute(queryable, = {}) debug("Base #{operands.first}", ) @solutions = operands.last.execute(queryable, .merge(:depth => [:depth].to_i + 1)) debug("=> #{@solutions.inspect}", ) @solutions end |
#optimize ⇒ Union, RDF::Query
Returns an optimized version of this query.
Return optimized query
41 42 43 |
# File 'lib/sparql/algebra/operator/base.rb', line 41 def optimize operands.last.optimize end |