| 1 | =head1 NAME | ||
| 2 | |||
| 3 | AtteanX::Serializer::NTriples - N-Triples Serializer | ||
| 4 | |||
| 5 | =head1 VERSION | ||
| 6 | |||
| 7 | This document describes AtteanX::Serializer::NTriples version 0.040 | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | use Attean; | ||
| 12 | my $serializer = Attean->get_serializer('NTriples')->new(); | ||
| 13 | $serializer->serialize_iter_to_io( $iter, $fh ); | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | Serializes triples into the RDF 1.1 N-Triples format. | ||
| 18 | |||
| 19 | =head1 ATTRIBUTES | ||
| 20 | |||
| 21 | =over 4 | ||
| 22 | |||
| 23 | =item C<< canonical_media_type >> | ||
| 24 | |||
| 25 | =item C<< file_extensions >> | ||
| 26 | |||
| 27 | =back | ||
| 28 | |||
| 29 | =head1 METHODS | ||
| 30 | |||
| 31 | =over 4 | ||
| 32 | |||
| 33 | =item C<< serialize_iter_to_io( $fh, $iterator ) >> | ||
| 34 | |||
| 35 | =item C<< serialize_iter_to_bytes( $fh ) >> | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | 6 | ▶ | use v5.14; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 40 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | |||
| 42 | 6 | package AtteanX::Serializer::NTriples 0.040 { | |
| 43 | 6 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | 6 | ▶ | use Types::Standard qw(Str ArrayRef); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | 6 | ▶ | use Encode qw(encode); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 46 | 6 | ▶ | use Attean::ListIterator; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 47 | 6 | ▶ | use List::Util qw(any); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 48 | 6 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | |||
| 50 | 6 | extends 'AtteanX::Serializer::NTuples'; | |
| 51 | 6 | has 'canonical_media_type' => (is => 'ro', isa => Str, init_arg => undef, default => 'application/n-triples'); | |
| 52 | |||
| 53 | =item C<< media_types >> | ||
| 54 | |||
| 55 | Returns a list of media types that identify the format produced by this serializer. | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | 28 | ▶ | sub media_types { |
|
Subroutine
media_types: called CC=1 SCAR=0.0
Pod
documented
| |||
| 60 | 28 | return [qw(application/n-triples text/plain)]; | |
| 61 | } | ||
| 62 | |||
| 63 | =item C<< file_extensions >> | ||
| 64 | |||
| 65 | Returns a list of file extensions associated with the serialized format. | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | 28 | ▶ | sub file_extensions { return [qw(nt)] }; |
|
Subroutine
file_extensions: called CC=1 SCAR=0.0
Pod
documented
| |||
| 70 | |||
| 71 | 6 | with 'Attean::API::TripleSerializer'; | |
| 72 | 6 | with 'Attean::API::AppendableSerializer'; | |
| 73 | } | ||
| 74 | |||
| 75 | 6 | 1; | |
| 76 | |||
| 77 | __END__ | ||