Re: using perl for rdf/xml to N3 conversions

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 UTC