def initialize(subject=nil,predicate=nil,object=nil,model=nil)
@model = model
if subject.class == Hash
if subject.key?(:from_object)
@statement = Redland.librdf_new_statement_from_statement(subject[:from_object])
@model = subject[:model]
end
else
unless subject
s = nil
else
if (subject.class == Uri)|| (subject.class == String)
subject = Node.new(subject)
end
s = Redland.librdf_new_node_from_node(subject.node)
end
unless predicate
p = nil
else
if (predicate.class == Uri) || (predicate.class == String)
predicate = Node.new(predicate)
end
p = Redland.librdf_new_node_from_node(predicate.node)
end
unless object
o = nil
else
if (object.class == Uri) || (object.class == String)
object = Node.new(object)
end
o = Redland.librdf_new_node_from_node(object.node)
end
@statement = Redland.librdf_new_statement_from_nodes($world.world,s,p,o)
end
raise RedlandError.new("Statement construction failed") if !@statement
ObjectSpace.define_finalizer(self,Statement.create_finalizer(@statement))
end