[Activerdf] read scrapbook.rdf files

J2F j2fuentes at gmail.com
Wed Apr 4 18:51:59 IST 2007


I am trying to parse/read the attached RDF file (a file generated by the
extremely useful firefox plugin "scrapbook"
(http://amb.vis.ne.jp/mozilla/scrapbook/):


I try the following:

require 'rubygems'
require 'active_rdf'

adapter = ConnectionPool.add_data_source :type => :rdflite
adapter.load "/tmp/scrapbook.nt" 
Namespace.register(:test, 'http://amb.vis.ne.jp/mozilla/scrapbook-rdf#')
ObjectManager.construct_classes

Up to this point, everything is fine. However I couldn't determine how
to retrieve records. I tried:

item = TEST::item20070405010733

and I get

=> #<RDFS::Resource:0xb679fc78 @predicates={},
@uri="http://amb.vis.ne.jp/mozilla/scrapbook-rdf#item20070405010733">

I could not get anything from this item, however. I tried:

item.title
=> nil


item.source
=> nil

I also tried:

item = TEST::urn:scrapbook:item20070405010857

However, I get a syntax error.

I hope that someone could help. Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scrapbook.rdf
Type: text/rdf
Size: 2018 bytes
Desc: not available
Url : http://lists.deri.org/pipermail/activerdf/attachments/20070405/2a48c9a1/scrapbook.bin


More information about the ActiveRDF mailing list