Method: RDF::List#each_statement

Defined in:
lib/rdf/model/list.rb

#each_statement(&block) ⇒ Enumerator Also known as: to_rdf

Yields each statement constituting this list.

Examples:

RDF::List[1, 2, 3].each_statement do |statement|
  puts statement.inspect
end

Returns:

See Also:

Since:

  • 0.2.3



833
834
835
836
837
838
839
# File 'lib/rdf/model/list.rb', line 833

def each_statement(&block)
  return enum_statement unless block_given?

  each_subject do |subject|
    graph.query({subject: subject}, &block)
  end
end