Class: Jekyll::JekyllRdf::Drops::RdfStatement
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::JekyllRdf::Drops::RdfStatement
- Defined in:
- lib/jekyll/drops/rdf_statement.rb
Overview
Represents an RDF statement to the Liquid template engine
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
The object RdfTerm of this RDF statement.
-
#predicate ⇒ Object
readonly
The predicate RdfTerm of this RDF statement.
-
#subject ⇒ Object
readonly
The subject RdfTerm of this RDF statement.
Instance Method Summary collapse
-
#initialize(statement, site) ⇒ RdfStatement
constructor
Create a new Jekyll::Drops::RdfStatement.
- #inspect ⇒ Object
Constructor Details
#initialize(statement, site) ⇒ RdfStatement
Create a new Jekyll::Drops::RdfStatement
-
statement
- The statement to be represented -
sparql
- The SPARQL::Client which contains thestatement
-
site
- The Jekyll::Site to be enriched
56 57 58 59 60 |
# File 'lib/jekyll/drops/rdf_statement.rb', line 56 def initialize(statement, site) @subject ||= Jekyll::JekyllRdf::Drops::RdfTerm.build_term_drop(statement.subject, site, true) @predicate ||= Jekyll::JekyllRdf::Drops::RdfTerm.build_term_drop(statement.predicate, site, true) @object ||= Jekyll::JekyllRdf::Drops::RdfTerm.build_term_drop(statement.object, site, true) end |
Instance Attribute Details
#object ⇒ Object (readonly)
The object RdfTerm of this RDF statement
48 49 50 |
# File 'lib/jekyll/drops/rdf_statement.rb', line 48 def object @object end |
#predicate ⇒ Object (readonly)
The predicate RdfTerm of this RDF statement
43 44 45 |
# File 'lib/jekyll/drops/rdf_statement.rb', line 43 def predicate @predicate end |
#subject ⇒ Object (readonly)
The subject RdfTerm of this RDF statement
38 39 40 |
# File 'lib/jekyll/drops/rdf_statement.rb', line 38 def subject @subject end |
Instance Method Details
#inspect ⇒ Object
62 63 64 65 |
# File 'lib/jekyll/drops/rdf_statement.rb', line 62 def inspect obj_id = ('%x' % (self.object_id << 1)).to_s return "#<RdfStatement:0x#{"0"*(14 - obj_id.length)}#{obj_id} @subject=#{subject.inspect} @predicate=#{predicate.inspect} @object=#{object.inspect}>" end |