RDF::Simple::Parser
a simple RDF/XML parser - reads a string containing RDF in XML returns a 'bucket-o-triples' (array of arrays)
my $uri = 'http://www.zooleika.org.uk/bio/foaf.rdf'; my $rdf = LWP::Simple::get($uri); my $parser = RDF::Simple::Parser->new(base => $uri) my @triples = $parser->parse_rdf($rdf); # returns an array of array references which are triples
create a new RDF::Simple::Parser 'base' supplies a base URI for relative URIs found in the document
accepts a string which is an RDF/XML document (complete XML, with headers) returns an array of array references which are RDF triples.
This parser is a transliteration of Sean B Palmer's python RDF/XML parser: http://www.infomesh.net/2003/rdfparser/ Thus the idioms inside are a bit pythonic. Most credit for the effort is due to sbp.
Jo Walsh <jo@london.pm.org>
this module is available under the same terms as perl itself
To install RDF::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::Simple
CPAN shell
perl -MCPAN -e shell install RDF::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.