Skip to content

Commit

Permalink
Merge pull request #76 from ruby-rdf/feature/dataset-update
Browse files Browse the repository at this point in the history
Feature/dataset update
  • Loading branch information
gkellogg committed Nov 22, 2016
2 parents 66e1fdf + 7c711a8 commit ddc0edc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/sparql/client/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@ def each(&block)
client.construct([:s, :p, :o]).where([:s, :p, :o]).each_statement(&block)
end

##
# Iterates the given block for each RDF statement.
#
# If no block was given, returns an enumerator.
#
# The order in which statements are yielded is undefined.
#
# @overload each_statement
# @yield [statement]
# each statement
# @yieldparam [RDF::Statement] statement
# @yieldreturn [void] ignored
# @return [void]
#
# @overload each_statement
# @return [Enumerator<RDF::Statement>]
def each_statement(&block)
if block_given?
# Invoke {#each} in the containing class:
each(&block)
end
enum_statement
end

##
# @private
# @see RDF::Enumerable#supports?
Expand All @@ -48,6 +72,7 @@ def supports?(feature)
when :graph_name then false
when :inference then false # forward-chaining inference
when :validity then false
when :literal_equality then true
else false
end
end
Expand Down

0 comments on commit ddc0edc

Please sign in to comment.