From: Jay2 Fernando Date: 2007-04-05T08:46:19+09:00 Subject: Reading an rdf file with ActiveRDF I posted this same problem on the ActiveRDF mailing list. However, after hours of restless waiting, no response has been posted. Thus, I decided to post the same problem here in the hope of finding a solution to my problem. I am trying to read/parse the following rdf file (this is produced by "scrapbook", a wonderful firefox plugin): [code] [/code] Using 'rapper,' I have converted the rdf file into an ntriples file. Following the "Getting started" guide of ActiveRDF, I try the following: [code] 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 [/code] At this point, everything is fine. However, I couldn't determine how to retrieve or read a record from the RDF file. I try: [code] item = TEST::item20070405010733 [/code] and get [code] => # [/code] However, I can't do anything with the resulting RDFS object. I would have wanted to: [code] puts item.source [/code] but only get a 'nil'. Can anyone help? -- Posted via http://www.ruby-forum.com/.