Catmandu::Exporter::RDF - serialize RDF data
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;
This Catmandu::Exporter exports RDF data in different RDF serializations.
A serialization form can be set with option
type. The option
typemust refer to a subclass name of RDF::Trine::Serializer, for instance
Turtlefor 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
nscan 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.
See also Catmandu::Exporter.
add( ... )
Returns the number of times
add has been called. In contrast to other Catmandu exporters, this does not reflect the number of exporter records because RDF data is always merged to one RDF graph.
uri( $uri )
Expand and abbreviated with RDF::NS. For instance "
dc:title" is expanded to "
Serialization is based on RDF::Trine::Serializer.