- From: Ross Singer <rossfsinger@gmail.com>
- Date: Tue, 6 Apr 2010 09:26:56 -0400
- To: Arto Bendiken <arto.bendiken@gmail.com>
- Cc: Nicholas Humfrey <nicholas.humfrey@bbc.co.uk>, public-rdf-ruby@w3.org
I'm a little surprised that raptor isn't "doing the right thing" here (unless, of course, it doesn't have any idea of the context of how the RDF/XML was received), since rapper does. See this thread: http://lists.w3.org/Archives/Public/public-lod/2010Jan/0123.html for some more backstory on this. -Ross. On Tue, Apr 6, 2010 at 5:43 AM, Arto Bendiken <arto.bendiken@gmail.com> wrote: > Hi Nick, > > On Tue, Apr 6, 2010 at 11:10 AM, Nicholas Humfrey > <nicholas.humfrey@bbc.co.uk> wrote: >> Hello, >> >> I am planning on writing a ruby gem to makes it easy to consume RDF from BBC >> Programmes. I started by having a play with rdf-raptor: >> >> require 'rubygems' >> require 'rdf' >> require 'rdf/raptor' >> >> puts RDF::Raptor.available? #=> true >> puts RDF::Raptor.version #=> "1.4.21" >> >> RDF::Reader.open('http://www.bbc.co.uk/programmes/b00rmssw.rdf') do |reader| >> reader.each_statement do |statement| >> puts statement.inspect >> end >> end >> >> And the output was: >> #<RDF::Statement:0x810896e4(<file:///programmes/b00rmssw.rdf> >> <http://www.w3.org/2000/01/rdf-schema#label> "Description of the episode >> GCHQ: Cracking the Code" .)> > > Looking at the RDF/XML file at > http://www.bbc.co.uk/programmes/b00rmssw.rdf, it seems that all its > resource descriptions are given with relative URLs and there is no > explicit base URI defined. So, if Raptor should parse that file > without an effective base URI, you'd probably get subject URLs like > the ones you saw. > > Therefore this is likely a bug in RDF::Raptor in that the gem > certainly ought to be passing in the input URL to Raptor as the > default base URI. > > I'll fix this later today and release a new version of the gem, but in > the meantime the workaround is trivial enough - just define an > explicit base URI as follows and everything should work fine: > > RDF::Reader.open(url = > 'http://www.bbc.co.uk/programmes/b00rmssw.rdf', :base_uri => url) > > -- > Arto Bendiken | http://datagraph.org/ > >
Received on Tuesday, 6 April 2010 13:27:29 UTC