Sha256: ca7df18bbf3b2fc1ae78404cdf718a8052bbcea281df3f8e6082932b8348d93b

Contents?: true

Size: 1.39 KB

Versions: 14

Compression:

Stored size: 1.39 KB

Contents

module SPARQL; module Algebra
  class Operator
    ##
    # The SPARQL GraphPattern `base` operator.
    #
    # @example
    #   (base <http://example.org/>
    #     (bgp (triple <a> <b> 123.0)))
    #
    # @see http://www.w3.org/TR/rdf-sparql-query/#QSynIRI
    class Base < Binary
      include Query
      
      NAME = [:base]

      ##
      # 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.
      #
      # @param  [RDF::Queryable] queryable
      #   the graph or repository to query
      # @param  [Hash{Symbol => Object}] options
      #   any additional keyword options
      # @return [RDF::Query::Solutions]
      #   the resulting solution sequence
      # @see    http://www.w3.org/TR/rdf-sparql-query/#sparqlAlgebra
      def execute(queryable, options = {})
        debug(options) {"Base #{operands.first}"}
        @solutions = operands.last.execute(queryable, options.merge(:depth => options[:depth].to_i + 1))
        debug(options) {"=> #{@solutions.inspect}"}
        @solutions
      end
      
      ##
      # Returns an optimized version of this query.
      #
      # Return optimized query
      #
      # @return [Union, RDF::Query] `self`
      def optimize
        operands.last.optimize
      end
    end # Base
  end # Operator
end; end # SPARQL::Algebra

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sparql-1.0.6 lib/sparql/algebra/operator/base.rb
sparql-1.0.5 lib/sparql/algebra/operator/base.rb
sparql-1.0.4 lib/sparql/algebra/operator/base.rb
sparql-1.0.3 lib/sparql/algebra/operator/base.rb
sparql-1.0.2 lib/sparql/algebra/operator/base.rb
sparql-1.0.1 lib/sparql/algebra/operator/base.rb
sparql-1.0.0 lib/sparql/algebra/operator/base.rb
sparql-0.3.3 lib/sparql/algebra/operator/base.rb
sparql-0.3.2 lib/sparql/algebra/operator/base.rb
sparql-0.3.1 lib/sparql/algebra/operator/base.rb
sparql-0.3.0 lib/sparql/algebra/operator/base.rb
sparql-0.1.1 lib/sparql/algebra/operator/base.rb
sparql-0.1.0 lib/sparql/algebra/operator/base.rb
sparql-0.0.2 lib/sparql/algebra/operator/base.rb