Sha256: a320b9460897ae8361dfcd62cf801502f67e7bcb7d73ef5de256a2f49e3455e6

Contents?: true

Size: 1.36 KB

Versions: 7

Compression:

Stored size: 1.36 KB

Contents

module SPARQL; module Algebra
  class Operator

    ##
    # The SPARQL UPDATE `using` operator.
    #
    # The USING and USING NAMED clauses affect the RDF Dataset used while evaluating the WHERE clause. This describes a dataset in the same way as FROM and FROM NAMED clauses describe RDF Datasets in the SPARQL 1.1 Query Language
    #
    # @example
    #   (using (:g1) (bgp (triple ?s ?p ?o)))
    #
    # @see https://www.w3.org/TR/sparql11-update/#add
    class Using < Operator
      include SPARQL::Algebra::Query

      NAME = :using

      ##
      # Executes this upate on the given `writable` graph or repository.
      #
      # Delegates to Dataset
      #
      # @param  [RDF::Queryable] queryable
      #   the graph or repository to write
      # @param  [Hash{Symbol => Object}] options
      #   any additional keyword options
      # @option options [Boolean] debug
      #   Query execution debugging
      # @return [RDF::Queryable]
      #   Returns queryable.
      # @raise [IOError]
      #   If `from` does not exist, unless the `silent` operator is present
      # @see    https://www.w3.org/TR/sparql11-update/
      def execute(queryable, **options, &block)
        debug(options) {"Using"}
        Dataset.new(*operands).execute(queryable, depth: options[:depth].to_i + 1, **options, &block)
      end
    end # Using
  end # Operator
end; end # SPARQL::Algebra

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sparql-3.1.8 lib/sparql/algebra/operator/using.rb
sparql-3.1.7 lib/sparql/algebra/operator/using.rb
sparql-3.1.6 lib/sparql/algebra/operator/using.rb
sparql-3.1.5 lib/sparql/algebra/operator/using.rb
sparql-3.1.4 lib/sparql/algebra/operator/using.rb
sparql-3.1.3 lib/sparql/algebra/operator/using.rb
sparql-3.1.2 lib/sparql/algebra/operator/using.rb