Module: RDF::Term

Included in:
N3::Algebra::Formula, N3::List
Defined in:
lib/rdf/n3/refinements.rb,
lib/rdf/n3/extensions.rb

Overview

Refinements on RDF::Node

Instance Method Summary collapse

Instance Method Details

#as_datetimeRDF::Literal::DateTime

Parse the value as a dateTime literal, or return now.

Returns:

  • (RDF::Literal::DateTime)


78
79
80
# File 'lib/rdf/n3/extensions.rb', line 78

def as_datetime
  RDF::Literal::DateTime.new(DateTime.now)
end

#as_numberRDF::Literal::Numeric

Parse the value as a numeric literal, or return 0.

Returns:

  • (RDF::Literal::Numeric)


70
71
72
# File 'lib/rdf/n3/extensions.rb', line 70

def as_number
  RDF::Literal(0)
end

#evaluate(bindings, formulae:, **options) ⇒ RDF::Node, RDF::N3::Algebra::Formula

Blank node may refer to a formula.

Parameters:

  • bindings (Hash{Symbol => RDF::Term})

    a query solution containing zero or more variable bindings

  • options (Hash{Symbol => Object})

    ({}) options passed from query

Returns:

See Also:

  • SPARQL::Algebra::Expression.evaluate


12
# File 'lib/rdf/n3/refinements.rb', line 12

def evaluate(bindings, formulae: nil, **options); end

#sameTerm?(other) ⇒ Boolean

Is this the same term? Like ‘#eql?`, but no variable matching

Returns:

  • (Boolean)


62
63
64
# File 'lib/rdf/n3/extensions.rb', line 62

def sameTerm?(other)
  eql?(other)
end