Class: Jekyll::JekyllRdf::Drops::RdfGraph

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/jekyll/drops/rdf_graph.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(graph) ⇒ RdfGraph

Returns a new instance of RdfGraph.



32
33
34
# File 'lib/jekyll/drops/rdf_graph.rb', line 32

def initialize(graph)
  @graph = graph
end

Instance Attribute Details

#graphObject (readonly)

Returns the value of attribute graph.



30
31
32
# File 'lib/jekyll/drops/rdf_graph.rb', line 30

def graph
  @graph
end

Instance Method Details

#to_nquadsObject



40
41
42
43
44
45
# File 'lib/jekyll/drops/rdf_graph.rb', line 40

def to_nquads
  result = @graph.statements.map{|state|
    state.to_nquads
  }.join("")
  return result
end

#to_ntriplesObject



47
48
49
50
51
52
# File 'lib/jekyll/drops/rdf_graph.rb', line 47

def to_ntriples
  result = @graph.statements.map{|state|
    state.to_ntriples
  }.join("")
  return result
end

#to_sObject



36
37
38
# File 'lib/jekyll/drops/rdf_graph.rb', line 36

def to_s
  to_nquads
end