Catmandu::Exporter::RDF - serialize RDF data
version 0.14
use Catmandu::Exporter::RDF; my $exporter = Catmandu::Exporter::RDF->new( file => 'export.rdf', type => 'XML', fix => 'rdf.fix' ); $exporter->add( $aref ); # pass RDF data in aREF encoding $exporter->commit;
Create a new Catmandu RDF exporter which serializes into a file or to STDOUT.
A serialization form can be set with option type. The option type must refer to a subclass name of RDF::Trine::Serializer, for instance Turtle for RDF/Turtle with RDF::Trine::Serializer::Turtle. The first letter is transformed uppercase, so format => 'turtle' will work as well. In addition there are aliases ttl for Turtle, n3 for Notation3, xml and XML for RDFXML, json for RDFJSON.
type
Turtle
format => 'turtle'
ttl
n3
Notation3
xml
XML
RDFXML
json
RDFJSON
The option fix is supported as derived from Catmandu::Fixable. For every add or for every item in add_many the given fixes will be applied first.
fix
add
add_many
The option ns can refer to an instance of or to a constructor argument of RDF::NS. Use a fixed date, such as "20130816" to make sure your URI namespace prefixes are stable.
ns
20130816
RDF data is added given in another RDF Encoding Form (aREF) as implemented with RDF::aREF and defined at http://github.com/gbv/aref.
Always returns 1 or 0 (there is only one RDF graph in a RDF document).
Expand and abbreviated with RDF::NS. For instance "dc:title" is expanded to "http://purl.org/dc/elements/1.1/title".
dc:title
http://purl.org/dc/elements/1.1/title
Catmandu::Exporter, RDF::Trine::Serializer
Jakob Voß
This software is copyright (c) 2014 by Jakob Voß.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Catmandu::RDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::RDF
CPAN shell
perl -MCPAN -e shell install Catmandu::RDF
For more information on module installation, please visit the detailed CPAN module installation guide.