W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > April 2010

Re: Loading into an RDF::Graph

From: Ben Lavender <blavender@gmail.com>
Date: Thu, 15 Apr 2010 20:35:12 +0200
Message-ID: <m2iee8ed2da1004151135ta60ac273y66f9e8ddfe5199be@mail.gmail.com>
To: Nicholas Humfrey <nicholas.humfrey@bbc.co.uk>
Cc: public-rdf-ruby@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 15 April 2010 18:35:45 GMT