Sha256: 423ab3830c3f3e3fcd818df80e32632988f5fa6f9199e59d610a9cb7f17b9c5b

Contents?: true

Size: 1.36 KB

Versions: 17

Compression:

Stored size: 1.36 KB

Contents

module SPARQL; module Algebra
  class Operator
    ##
    # The SPARQL GraphPattern `prefix` operator.
    #
    # @example
    #   (update
    #     (modify
    #       (bgp (triple ?s ?p ?o))
    #       (insert ((triple ?s ?p "q")))))
    #
    # @see http://www.w3.org/TR/sparql11-update/#graphUpdate
    class Update < Operator
      include SPARQL::Algebra::Update
      
      NAME = [:update]

      ##
      # Executes this upate on the given `queryable` graph or repository.
      #
      # @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 the dataset.
      # @raise [NotImplementedError]
      #   If an attempt is made to perform an unsupported operation
      # @raise [IOError]
      #   If `queryable` is immutable
      # @see    http://www.w3.org/TR/sparql11-update/
      def execute(queryable, options = {})
        debug(options) {"Update"}
        raise IOError, "queryable is not mutable" unless queryable.mutable?
        operands.each do |op|
          op.execute(queryable, options.merge(depth: options[:depth].to_i + 1))
        end
        queryable
      end
    end # Update
  end # Operator
end; end # SPARQL::Algebra

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sparql-3.0.2 lib/sparql/algebra/operator/update.rb
sparql-3.0.1 lib/sparql/algebra/operator/update.rb
sparql-3.0.0 lib/sparql/algebra/operator/update.rb
sparql-2.2.2 lib/sparql/algebra/operator/update.rb
sparql-2.2.1 lib/sparql/algebra/operator/update.rb
sparql-2.2.0 lib/sparql/algebra/operator/update.rb
sparql-2.1.0 lib/sparql/algebra/operator/update.rb
sparql-2.0.0 lib/sparql/algebra/operator/update.rb
sparql-2.0.0.beta2 lib/sparql/algebra/operator/update.rb
sparql-1.99.1 lib/sparql/algebra/operator/update.rb
sparql-2.0.0.beta1 lib/sparql/algebra/operator/update.rb
sparql-1.1.9.1 lib/sparql/algebra/operator/update.rb
sparql-1.99.0 lib/sparql/algebra/operator/update.rb
sparql-1.1.9 lib/sparql/algebra/operator/update.rb
sparql-1.1.8 lib/sparql/algebra/operator/update.rb
sparql-1.1.7 lib/sparql/algebra/operator/update.rb
sparql-1.1.6 lib/sparql/algebra/operator/update.rb