class Jekyll::JekyllRdf::Drops::RdfLiteral

Represents an RDF literal to the Liquid template engine

Public Instance Methods

literal() click to toggle source

Return a user-facing string representing this RdfLiteral

# File lib/jekyll/drops/rdf_literal.rb, line 38
def literal
  term.to_s
end
to_liquid() click to toggle source

Return literal value to allow liquid filters to compute rdf literals as well source: github.com/eccenca/jekyll-rdf/commit/704dd98c5e457a81e97fcd011562f1f39fc3f813

# File lib/jekyll/drops/rdf_literal.rb, line 47
def to_liquid
  # Convert scientific notation

  term_str = term.to_s
  if(term.has_datatype?)
    custom_type = Jekyll::JekyllRdf::Helper::Types::find(term.datatype)
    return custom_type.to_type term_str if (!custom_type.nil?) && (custom_type.match? term_str)
  end
  return term.to_s
end