Re: Loading into an RDF::Graph

Nick,

You can already sort of do this with RDF::Repository:

require 'rubygems'
require 'rdf'
require 'rdf/ntriples'
r = RDF::Repository.load('http://datagraph.org/jhacker/foaf.nt',
:context => 'http://example.org/context')

It seems sensible for RDF::Graph.load to do the same thing but with
the implied context, as you suggest.  Shouldn't be too hard to add.

Ben

On Thu, Apr 15, 2010 at 11:30 AM, Nicholas Humfrey
<nicholas.humfrey@bbc.co.uk> wrote:
> Hello,
>
> I was playing about with RDF.rb last night. I started by trying this:
>
> require 'rubygems'
> require 'rdf'
> require 'rdf/raptor'
>
> graph = RDF::Graph.new('http://www.bbc.co.uk/programmes/b0081dq5.rdf')
> graph.load(graph.context.to_s, :base_uri => graph.context)
>
>
> Could the API be simplified to:
>
> graph = RDF::Graph.new('http://www.bbc.co.uk/programmes/b0081dq5.rdf')
> graph.load!
>
>
> Or perhaps:
>
> graph = RDF::Graph.load('http://www.bbc.co.uk/programmes/b0081dq5.rdf')
>
>
>
> nick.
>
>
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
>
>

Received on Thursday, 15 April 2010 18:35:45 UTC