Sha256: cade7ab1f0a6c11fbf6a05c0de8857a06b063d3567aa5b657c565e612a35624d

Contents?: true

Size: 741 Bytes

Versions: 9

Compression:

Stored size: 741 Bytes

Contents

module SPARQL; module Algebra
  class Operator
    ##
    # The SPARQL GraphPattern `graph` operator.
    #
    # This is a wrapper to add a `context` to the query.
    #
    # @example
    #   (prefix ((: <http://example/>))
    #     (graph ?g
    #       (bgp (triple ?s ?p ?o))))
    #
    # @see http://www.w3.org/TR/rdf-sparql-query/#sparqlAlgebra
    class Graph < Operator::Binary
      NAME = [:graph]
      ##
      # A `graph` is an RDF::Query with a context.
      #
      # @param [RDF::URI, RDF::Query::Variable] context
      # @param [RDF::Query] bgp
      # @return [RDF::Query]
      def self.new(context, bgp)
        bgp.context = context
        bgp
      end
    end # Graph
  end # Operator
end; end # SPARQL::Algebra

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sparql-1.0.1 lib/sparql/algebra/operator/graph.rb
sparql-1.0.0 lib/sparql/algebra/operator/graph.rb
sparql-0.3.3 lib/sparql/algebra/operator/graph.rb
sparql-0.3.2 lib/sparql/algebra/operator/graph.rb
sparql-0.3.1 lib/sparql/algebra/operator/graph.rb
sparql-0.3.0 lib/sparql/algebra/operator/graph.rb
sparql-0.1.1 lib/sparql/algebra/operator/graph.rb
sparql-0.1.0 lib/sparql/algebra/operator/graph.rb
sparql-0.0.2 lib/sparql/algebra/operator/graph.rb