Class: Cerberus::Annotations::Annotation
- Inherits:
-
Object
- Object
- Cerberus::Annotations::Annotation
- Defined in:
- app/models/cerberus/annotations/annotation.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(graph) ⇒ Annotation
constructor
A new instance of Annotation.
Constructor Details
#initialize(graph) ⇒ Annotation
Returns a new instance of Annotation.
12 13 14 |
# File 'app/models/cerberus/annotations/annotation.rb', line 12 def initialize graph @graph = graph end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
10 11 12 |
# File 'app/models/cerberus/annotations/annotation.rb', line 10 def graph @graph end |
Class Method Details
.from_json(json) ⇒ Object
4 5 6 7 |
# File 'app/models/cerberus/annotations/annotation.rb', line 4 def from_json json graph = RDF::Graph.new << JSON::LD::API.toRdf(JSON.parse(json)) self.new graph end |