Method: RDF::List#first

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

#firstRDF::Term

Returns the first element in this list.

Examples:

RDF::List[*(1..10)].first               #=> RDF::Literal(1)

Returns:

Since:

  • 0.2.3



610
611
612
# File 'lib/rdf/model/list.rb', line 610

def first
  graph.first_object(subject: first_subject, predicate: RDF.first)
end