Parent

Redland::TripleStore

A class for storing RDF triples

Attributes

store[RW]
store_type[RW]

Public Class Methods

create_finalizer(store) click to toggle source

You shouldn't use this. Used internally for cleanup.

# File rdf/redland/store.rb, line 33
def TripleStore.create_finalizer(store)
  proc {|id| # "Finalizer on #{id}"
    #$log_final.info "closing store"
    Redland::librdf_free_storage(store) if store
  }
end
new(store_type='memory',name='',options='') click to toggle source

Creates a store with the given type, name, and options

# File rdf/redland/store.rb, line 10
def initialize(store_type='memory',name='',options='')
  case store_type
  when "memory";
  when "hashes";
  when "file";
  when "uri";
  when "mysql";
  when "sqlite";
  when "postgresql";
  else
    raise RedlandError.new("Failed to initialize storage, unknown storage type [#{store_type}]")
  end
  @name = name
  @store_type = store_type
  @store=Redland.librdf_new_storage($world.world,store_type,name,options)
  unless @store
    raise RedlandError.new("Creating Storage Failed")
  end

  ObjectSpace.define_finalizer(self,TripleStore.create_finalizer(@store))
end

Go to Redland Home - Language Bindings Home - Ruby API Home

(C) Copyright 2004-2013 Dave Beckett, (C) Copyright 2004-2005 University of Bristol