Redland RDF Application Framework - Ruby RDoc - Class: Redland::TripleStore

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

Class | Redland::TripleStore
In: | rdf/redland/store.rb
Parent: | Object

A class for storing RDF triples

### Methods

create_finalizer new

### Attributes

store | [RW] |
store_type | [RW] |

### Public Class methods

create_finalizer(store)

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

[Source]

    # 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='')

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

[Source]

    # 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-2011 Dave Beckett, (C) Copyright 2004-2005 University of Bristol