16: def initialize(params = {})
17: if params[:location] and params[:location] == :postgresql
18: initialize_postgresql(params)
19: return
20: end
21:
22: if params[:location] and params[:location] != :memory
23:
24: type = 'bdb'
25: if params[:location].include?('/')
26: path, file = File.split(params[:location])
27: else
28: path = '.'
29: file = params[:location]
30: end
31: else
32:
33: type = 'memory'; path = ''; file = '.'
34: end
35:
36:
37: begin
38: @store = Redland::HashStore.new(type, file, path, false)
39: @model = Redland::Model.new @store
40: @reads = true
41: @writes = true
42: $activerdflog.info "initialised Redland adapter to #{@model.inspect}"
43:
44: rescue Redland::RedlandError => e
45: raise ActiveRdfError, "could not initialise Redland database: #{e.message}"
46: end
47: end