AtteanX/Serializer/NTriples.pm

filter: Statementstmt 96.8% 31 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.9% 10 / 11 Podpod 100% 3 / 3 totaltotal 95.6% 44 / 46 CC 1 SCAR 0.9
CC
1
Cov
97%
canonical_iri
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« AtteanX/Serializer/NQuads.pm ↑ Summary AtteanX/Store/Simple.pm »
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.041
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<< canonical_iri >>
34  
35 Returns the canonical IRI of this format.
36  
37 =item C<< serialize_iter_to_io( $fh, $iterator ) >>
38  
39 =item C<< serialize_iter_to_bytes( $fh ) >>
40  
41 =cut
42  
43 6 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 6 package AtteanX::Serializer::NTriples 0.041 {
47 6 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 6 ▶ use Types::Standard qw(Str ArrayRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
49 6 ▶ use Encode qw(encode);
Subroutine BEGIN: called CC=1 SCAR=0.0
50 6 ▶ use Attean::ListIterator;
Subroutine BEGIN: called CC=1 SCAR=0.0
51 6 ▶ use List::Util qw(any);
Subroutine BEGIN: called CC=1 SCAR=0.0
52 6 ▶ use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 6 extends 'AtteanX::Serializer::NTuples';
55 0 ▶ sub canonical_iri { return 'http://www.w3.org/ns/formats/N-Triples' }
Subroutine canonical_iri: not called CC=1 SCAR=6.9
Pod documented
56 6 has 'canonical_media_type' => (is => 'ro', isa => Str, init_arg => undef, default => 'application/n-triples');
57  
58 =item C<< media_types >>
59  
60 Returns a list of media types that identify the format produced by this serializer.
61  
62 =cut
63  
64 28 ▶ sub media_types {
Subroutine media_types: called CC=1 SCAR=0.0
Pod documented
65 28 return [qw(application/n-triples text/plain)];
66 }
67  
68 =item C<< file_extensions >>
69  
70 Returns a list of file extensions associated with the serialized format.
71  
72 =cut
73  
74 28 ▶ sub file_extensions { return [qw(nt)] };
Subroutine file_extensions: called CC=1 SCAR=0.0
Pod documented
75
76 6 with 'Attean::API::TripleSerializer';
77 6 with 'Attean::API::AppendableSerializer';
78 }
79  
80 6 1;
81  
82 __END__
« AtteanX/Serializer/NQuads.pm ↑ Summary AtteanX/Store/Simple.pm »