W3C home > Mailing lists > Public > semantic-web@w3.org > May 2008

Re: using perl for rdf/xml to N3 conversions

From: cdr <_@whats-your.name>
Date: Sat, 31 May 2008 15:31:39 -0400
To: Peter Ansell <ansell.peter@gmail.com>
Cc: Semantic Web <semantic-web@w3.org>
Message-ID: <20080531193139.GA5002@m.hsd1.ma.comcast.net>

On Sun Jun 01, 2008 at 08:13:04AM +1000, Peter Ansell wrote:
> 
> Hi all,
> 
> I am not an expert in perl, but I have hacked together a script that
> requires me to convert an rdf/xml document into an N3/NTriples
> document. My current ideas are as follows, but I can't make them work
> properly.
> 
>    $rdfXmlParser = new RDF::Notation3::XML();
>    $model = $rdfXmlParser->parse_string($rdf_data);
> 
>    $rdfN3RDFCore = new RDF::Notation3::RDFCore();
>    $n3 = $rdfN3RDFCore->get_n3($model);
> 
>    print($n3);

you have the right idea..

heres a great introduction to Redland & Perl:

http://kill.devc.at/internet/semantic-web/rdf/redland/tutorial


also if you dig, you can probably find 'triplr' source in redland's SVN (maybe not) or even use the test suites as some example code if the doc examples are lacking.

also the W3C site is mostly written in Perl and RDF, and its source code is available fpr perusal as well..


you'll probbaly find more ready-made examples on blogs and wikis for Python and Ruby..

> 
> Just wondering if anyone here has experience in this and could point
> me in the right direction. The documentation for these packages
> doesn't explain how to make anything interoperate and doesn't have
> many examples to follow.
> 
> Cheers,
> 
> Peter
Received on Saturday, 31 May 2008 23:41:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 21:45:22 GMT