-
-
06 Mar 2020 16:01:20 UTC
- Distribution: RDF-Simple
- Module version: 1.16
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (3)
- Testers (232 / 133 / 0)
- Kwalitee
Bus factor: 1- 77.25% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (34.58KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
RDF::Simple::Parser - convert RDF string to bucket of triples
DESCRIPTION
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 object.
'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_file($sFname)
-
Takes one argument, a string which is a fully qualified filename. Reads the contents of that file, parses it as RDF, and returns the same thing as parse_rdf().
- parse_uri($uri)
-
Accepts a string which is a fully qualified http:// uri at which some valid RDF lives. Fetches the remote file and returns the same thing as parse_rdf().
- getns
-
Returns a hashref of all namespaces found in the document.
BUGS
Please report bugs via the RT web site http://rt.cpan.org/Ticket/Create.html?Queue=RDF-Simple
AUTHOR
Jo Walsh <jo@london.pm.org> Currently maintained by Martin Thurn <mthurn@cpan.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.
cpanm RDF::Simple
perl -MCPAN -e shell install RDF::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.