class Jekyll::JekyllRdf::Drops::RdfTerm

Represents an RDF term to the Liquid template engine

Attributes

term[R]

The represented RDF term

Public Class Methods

build_term_drop(term, site, covered) click to toggle source

Convert an RDF term into a new Jekyll::Drops::RdfTerm

  • term - The term to be represented

  • site - The Jekyll::Site to be enriched

# File lib/jekyll/drops/rdf_term.rb, line 90
def self.build_term_drop(term, site, covered)
  case term
  when RDF::URI, RDF::Node
    return Jekyll::JekyllRdf::Helper::RdfHelper.resources(term)
  when RDF::Literal
    return RdfLiteral.new(term)
  else
    return nil
  end
end
new(term) click to toggle source

Create a new Jekyll::JekyllRdf::Drops::RdfTerm

  • term - The term to be represented

# File lib/jekyll/drops/rdf_term.rb, line 45
def initialize(term)
  @term  ||= term
end

Public Instance Methods

==(other_obj) click to toggle source
# File lib/jekyll/drops/rdf_term.rb, line 73
def ==(other_obj)
  return self.eql? other_obj
end
===(other_obj) click to toggle source
# File lib/jekyll/drops/rdf_term.rb, line 81
def ===(other_obj)
  return self.to_s.eql? other_obj.to_s
end
add_necessities(site, page) click to toggle source

Function stub with no functionality. Its purpose is to keep RdfResource compatible.

# File lib/jekyll/drops/rdf_term.rb, line 52
def add_necessities(site, page)
  return self
end
eql?(other_obj) click to toggle source
# File lib/jekyll/drops/rdf_term.rb, line 77
def eql? other_obj
  return (self.to_s.eql? other_obj.to_s)&&((other_obj.class <= self.class)||(self.class <= other_obj.class)||(other_obj.class <= self.term.class))
end
inspect() click to toggle source
# File lib/jekyll/drops/rdf_term.rb, line 101
def inspect
  obj_id = ('%x' % (self.object_id << 1)).to_s
  return "#<#{self.class.to_s.split("::")[-1]}:0x#{"0"*(14 - obj_id.length)}#{obj_id} @term=#{@term}>"
end
ready?() click to toggle source

Function stub with no functionality. Its purpose is to keep RdfResource compatible.

# File lib/jekyll/drops/rdf_term.rb, line 59
def ready?
  return true;
end
to_s() click to toggle source

Convert this RdfTerm into a string This should be:

# File lib/jekyll/drops/rdf_term.rb, line 69
def to_s
  term.to_s
end