Class: RDF::N3::Algebra::List::First

Inherits:
RDF::N3::Algebra::ListOperator show all
Defined in:
lib/rdf/n3/algebra/list/first.rb

Overview

Iff the subject is a list and the object is the first thing that list, then this is true. The object can be calculated as a function of the list.

The object can be calculated as a function of the list.

Examples:

{ ( 1 2 3 4 5 6 ) list:first 1 } => { :test1 a :SUCCESS }.

Constant Summary collapse

NAME =
:listFirst
URI =
RDF::N3::List.first

Instance Attribute Summary

Attributes included from Enumerable

#existentials, #universals

Instance Method Summary collapse

Methods inherited from RDF::N3::Algebra::ListOperator

#as_literal, #execute, #input_operand, #validate

Methods included from Builtin

#each, #evaluate, #hash, #input_operand, #rank, #to_uri

Instance Method Details

#resolve(list) ⇒ RDF::Term

Resolves this operator using the given variable ‘bindings`. If the last operand is a variable, it creates a solution for each element in the list.

Parameters:

Returns:

See Also:

  • ListOperator#evaluate


20
21
22
# File 'lib/rdf/n3/algebra/list/first.rb', line 20

def resolve(list)
  list.first
end