Class: RDF::Graph

Inherits:
Object
  • Object
show all
Includes:
RDFObjects::Graph
Defined in:
lib/rdf/rdfobjects.rb,
lib/rdf/rdfobjects/graph.rb

Instance Method Summary collapse

Methods included from RDFObjects::Graph

#<<, #[], #create, #to_ntriples

Instance Method Details

#insert_statement(statement) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/rdf/rdfobjects/graph.rb', line 50

def insert_statement(statement)
  statement = statement.dup
  statement.context = context
  statement.to_triple.each_cons(3) do |s,p,o|
    s.graph = self
    o.graph = self if o.is_a?(RDF::Resource) && !o.frozen?
  end      
  @data.insert(statement)
end