Catmandu::Exporter::RDF(3pm)

Catmandu::Exporter::RDF3pm

Serialize rdf data

Usage

In Perl code:

    use Catmandu -all;
    my $exporter = exporter('RDF',
        file => 'export.rdf',
        type => 'XML',
        fix  => 'rdf.fix'
    );
    $exporter->add( $aref ); # pass RDF data in aREF encoding
    $exporter->commit;

Overview

This Catmandu::Exporter exports RDF data in different RDF serializations.

Configuration

file
fh
encoding
fix

Default configuration options of Catmandu::Exporter. 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.

type

A serialization form can be set with option "type" with default value "NTriples". The option must refer to a subclass 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".

When the option "type" is set to 'NTriples' the export can be streamed in all other cases the results are exported in bulk after "commit()".

ns

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.

Methods

See also Catmandu::Exporter.

add( ... )

RDF data is added given in another RDF Encoding Form (aREF) as implemented with RDF::aREF and defined at <http://github.com/gbv/aref>.

count

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 ""http://purl.org/dc/elements/1.1/title"".

Releases

6 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8
  2. 9
  3. 10–11
  4. 12–13

From libcatmandu-rdf-perl 0.32-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.