[Activerdf] The type of a created object

Paul Stadig paul at stadig.name
Thu Dec 7 21:53:42 GMT 2006


Hi,
Sorry for the stupid newbie question, but I'm not sure what I'm doing
wrong.  The following code is (pasted together) from (various parts
of) the wiki:

require 'rubygems'
require 'active_rdf'

adapter = ConnectionPool.add_data_source :type => :redland
adapter.load "/tmp/test_person_data.nt"

# we register a short-hand notation for the namespace used in this test data
Namespace.register :test, 'http://activerdf.org/test/'
# and now construct the necessary Ruby Modules and Classes
ObjectManager.construct_classes

# we can access all RDF properties of a person as Ruby attributes:
eyal = TEST::Person.new 'http://activerdf.org/test/eyal'

# lets create an instance of one of the classes, that were constructed in that
# way armin will be of rdfs:type test:person
armin = TEST::Person.new 'http://armin-haller.com/#me'

p eyal.type
p armin.type

As you can see the comment (and my understanding was that) armin
should have the type test:person, but in fact the last two lines of
the script print:

[#<RDFS::Resource:0xb7b088c8
@uri="http://www.w3.org/2000/01/rdf-schema#Resource">,
#<RDFS::Resource:0xb7b0865c @uri="http://activerdf.org/test/Person">]
nil

So armin has no type. Am I making a mistake, or is there a bug? I'm
using the gem version of activerdf 1.0.

Thanks,
Paul


More information about the Activerdf mailing list