line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
AtteanX::Serializer::NQuads - N-Triples Serializer |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 VERSION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
This document describes AtteanX::Serializer::NQuads version 0.032 |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Attean; |
12
|
|
|
|
|
|
|
my $serializer = Attean->get_serializer('NQuads')->new(); |
13
|
|
|
|
|
|
|
$serializer->serialize_iter_to_io( $iter, $fh ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Serializes triples and quads into the RDF 1.1 N-Quads 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
|
4
|
|
|
4
|
|
8109
|
use v5.14; |
|
4
|
|
|
|
|
17
|
|
40
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
141
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use Moo; |
43
|
4
|
|
|
4
|
|
21
|
use Types::Standard qw(Str ArrayRef); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
22
|
|
44
|
4
|
|
|
4
|
|
1190
|
use Encode qw(encode); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
33
|
|
45
|
4
|
|
|
4
|
|
2312
|
use Attean::ListIterator; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
140
|
|
46
|
4
|
|
|
4
|
|
25
|
use List::MoreUtils qw(any); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
78
|
|
47
|
4
|
|
|
4
|
|
18
|
use namespace::clean; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
27
|
|
48
|
4
|
|
|
4
|
|
3528
|
|
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
30
|
|
49
|
|
|
|
|
|
|
extends 'AtteanX::Serializer::NTuples'; |
50
|
|
|
|
|
|
|
has 'canonical_media_type' => (is => 'ro', isa => Str, init_arg => undef, default => 'application/n-quads'); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item C<< media_types >> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Returns a list of media types that identify the format produced by this serializer. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return [qw(application/n-quads)]; |
59
|
|
|
|
|
|
|
} |
60
|
10
|
|
|
10
|
1
|
24
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item C<< file_extensions >> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Returns a list of file extensions associated with the serialized format. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
with 'Attean::API::MixedStatementSerializer'; |
70
|
16
|
|
|
16
|
1
|
80
|
with 'Attean::API::AppendableSerializer'; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=back |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 BUGS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Please report any bugs or feature requests to through the GitHub web interface |
81
|
|
|
|
|
|
|
at L<https://github.com/kasei/perlrdf/issues>. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SEE ALSO |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L<https://www.w3.org/TR/n-quads/> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 AUTHOR |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Gregory Todd Williams C<< <gwilliams@cpan.org> >> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 COPYRIGHT |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Copyright (c) 2014--2022 Gregory Todd Williams. This |
94
|
|
|
|
|
|
|
program is free software; you can redistribute it and/or modify it under |
95
|
|
|
|
|
|
|
the same terms as Perl itself. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |