Class: LD::Patch::Algebra::Prefix
- Inherits:
-
SPARQL::Algebra::Operator::Binary
- Object
- SPARQL::Algebra::Operator::Binary
- LD::Patch::Algebra::Prefix
- Includes:
- SPARQL::Algebra::Update
- Defined in:
- lib/ld/patch/algebra/prefix.rb
Overview
The LD Patch ‘prefix` operator.
Constant Summary collapse
- NAME =
:prefix
Instance Method Summary collapse
-
#execute(queryable, options = {}) {|solution| ... } ⇒ RDF::Query::Solutions
Executes this query on the given ‘queryable` graph or repository.
-
#optimize ⇒ Union, RDF::Query
Returns an optimized version of this query.
Instance Method Details
#execute(queryable, options = {}) {|solution| ... } ⇒ 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 URIs.
32 33 34 35 |
# File 'lib/ld/patch/algebra/prefix.rb', line 32 def execute(queryable, = {}, &block) debug() {"Prefix"} @solutions = queryable.query(operands.last, **.merge(depth: [:depth].to_i + 1), &block) end |
#optimize ⇒ Union, RDF::Query
Returns an optimized version of this query.
If optimize operands, and if the first two operands are both Queries, replace with the unique sum of the query elements
44 45 46 |
# File 'lib/ld/patch/algebra/prefix.rb', line 44 def optimize operands.last.optimize end |