class RDF::N3::Algebra::Time::Month
For a date-time, its time:month is the two-digit month.
@see www.w3.org/TR/xpath-functions/#func-month-from-dateTime
Constants
- NAME
- URI
Public Instance Methods
Source
# File lib/rdf/n3/algebra/time/month.rb, line 17 def resolve(resource, position:) case position when :subject return nil unless resource.literal? resource.as_datetime.month when :object return nil unless resource.literal? || resource.variable? resource end end
The time:month operator takes string or dateTime and extracts the month component.
@param [RDF::Term] resource @param [:subject, :object] position @return [RDF::Term] @see RDF::N3::ResourceOperator#evaluate
Source
# File lib/rdf/n3/algebra/time/month.rb, line 30 def valid?(subject, object) subject.value.match?(%r(^\d{4}-\d{2})) end
There is no month unless it was specified in the lexical form