class SPARQL::Algebra::Operator::Day
The SPARQL
logical `day` operator.
@example
(prefix ((: <http://example.org/>)) (project (?s ?x) (extend ((?x (day ?date))) (bgp (triple ?s :date ?date)))))
Constants
- NAME
Public Instance Methods
apply(operand, **options)
click to toggle source
Returns the day part of `arg` as an integer.
@param [RDF::Literal] operand
the operand
@return [RDF::Literal] @raise [TypeError] if the operand is not a simple literal
# File lib/sparql/algebra/operator/day.rb, line 25 def apply(operand, **options) raise TypeError, "expected an RDF::Literal::DateTime, but got #{operand.inspect}" unless operand.is_a?(RDF::Literal::DateTime) RDF::Literal(operand.object.day) end