| 1 |
require 'rdf/redland/model' |
| 2 |
require 'rdf/redland/store' |
| 3 |
require 'rdf/redland/stream' |
| 4 |
require 'rdf/redland/statement' |
| 5 |
require 'rdf/redland/util' |
| 6 |
require 'rdf/redland/node' |
| 7 |
require 'rdf/redland/parser' |
| 8 |
require 'rdf/redland/queryresults' |
| 9 |
require 'rdf/redland/query' |
| 10 |
require 'rdf/redland/resource' |
| 11 |
require 'rdf/redland/serializer' |
| 12 |
require 'rdf/redland/uri' |
| 13 |
require 'rdf/redland/resource' |
| 14 |
require 'rdf/redland/util' |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
module Redland |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
require 'redland' |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
class RedlandError < RuntimeError |
| 30 |
end |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
class NodeTypeError < RedlandError |
| 35 |
end |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
class World |
| 44 |
|
| 45 |
attr_accessor :world |
| 46 |
|
| 47 |
|
| 48 |
def initialize() |
| 49 |
@world = Redland::librdf_new_world() |
| 50 |
Redland::librdf_world_open(@world) |
| 51 |
ObjectSpace.define_finalizer(self,World.create_finalizer(@world)) |
| 52 |
end |
| 53 |
|
| 54 |
def World.create_finalizer(world) |
| 55 |
proc {|id| "Finalizer on #{id}" |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
} |
| 61 |
end |
| 62 |
end |
| 63 |
|
| 64 |
|
| 65 |
$world = Redland::World.new() |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
end |
| 72 |
|
| 73 |
require 'rdf/redland/constants' |
| 74 |
|
| 75 |
if $0 == __FILE__ |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
puts "listing instances of World: " |
| 80 |
ObjectSpace.each_object(Redland::World){|obj| |
| 81 |
p obj |
| 82 |
} |
| 83 |
puts "DONE" |
| 84 |
puts "Running the garbage collector" |
| 85 |
GC.start |
| 86 |
puts "Listing remaining instances of World:" |
| 87 |
ObjectSpace.each_object(Redland::World){|obj| |
| 88 |
p obj |
| 89 |
} |
| 90 |
puts "DONE" |
| 91 |
end |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|