a simple RDF/XML parser -
reads a string containing RDF in XML
returns a 'bucket-o-triples' (array of arrays)
SYNOPSIS
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
METHODS
new( [ base => 'http://example.com/foo.rdf' ])
create a new RDF::Simple::Parser
'base' supplies a base URI
for relative URIs found in the document
'http_proxy' optionally supplies
the address of an http proxy server.
If this is not given it will try to use
the default environment settings.
parse_rdf($rdf)
accepts a string which is an RDF/XML document
(complete XML, with headers)
returns an array of array references which are RDF triples.
parse_uri($uri)
accepts a string which is a fully qualified http:// uri
at which some valid RDF lives.
returns the same thing as parse_rdf
NOTES
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.
AUTHOR
Jo Walsh <jo@london.pm.org>
LICENSE
this module is available under the same terms as perl itself
Module Install Instructions
To install RDF::Simple, copy and paste the appropriate command in to your terminal.