Class: Jekyll::JekyllRdf::Drops::RdfGraph
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::JekyllRdf::Drops::RdfGraph
- Defined in:
- lib/jekyll/drops/rdf_graph.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Instance Method Summary collapse
-
#initialize(graph) ⇒ RdfGraph
constructor
A new instance of RdfGraph.
- #to_nquads ⇒ Object
- #to_ntriples ⇒ Object
- #to_s ⇒ Object
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
#graph ⇒ Object (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_nquads ⇒ Object
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_ntriples ⇒ Object
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_s ⇒ Object
36 37 38 |
# File 'lib/jekyll/drops/rdf_graph.rb', line 36 def to_s to_nquads end |