line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
50
|
|
|
50
|
|
671
|
use v5.14; |
|
50
|
|
|
|
|
164
|
|
2
|
50
|
|
|
50
|
|
262
|
use warnings; |
|
50
|
|
|
|
|
100
|
|
|
50
|
|
|
|
|
2202
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Attean::Triple - RDF Triples |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes Attean::Triple version 0.032 |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use v5.14; |
15
|
|
|
|
|
|
|
use Attean; |
16
|
|
|
|
|
|
|
my $triple = Attean::Triple->new( $s, $p, $o ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
The Attean::Triple class represents an RDF triple. |
21
|
|
|
|
|
|
|
It conforms to the L<Attean::API::Triple|Attean::API::Binding> role. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 ROLES |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This role consumes L<Attean::API::Triple>. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 METHODS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=over 4 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=item C<< subject >> |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=item C<< predicate >> |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item C<< object >> |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=back |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
use Moo; |
42
|
50
|
|
|
50
|
|
313
|
use Scalar::Util qw(blessed); |
|
50
|
|
|
|
|
121
|
|
|
50
|
|
|
|
|
278
|
|
43
|
50
|
|
|
50
|
|
16141
|
use Attean::RDF; |
|
50
|
|
|
|
|
113
|
|
|
50
|
|
|
|
|
2379
|
|
44
|
50
|
|
|
50
|
|
309
|
use Attean::API::Binding; |
|
50
|
|
|
|
|
111
|
|
|
50
|
|
|
|
|
419
|
|
45
|
50
|
|
|
50
|
|
37289
|
|
|
50
|
|
|
|
|
112
|
|
|
50
|
|
|
|
|
7987
|
|
46
|
|
|
|
|
|
|
has 'subject' => (is => 'ro', required => 1); |
47
|
|
|
|
|
|
|
has 'predicate' => (is => 'ro', required => 1); |
48
|
|
|
|
|
|
|
has 'object' => (is => 'ro', required => 1); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
with 'Attean::API::TriplePattern'; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $self = shift; |
53
|
|
|
|
|
|
|
my $graph = shift; |
54
|
1
|
|
|
1
|
0
|
65
|
# TODO: deprecate this in favor of as_quad_pattern() provided by Attean::API::TriplePattern |
55
|
1
|
|
|
|
|
2
|
return $self->as_quad_pattern($graph); |
56
|
|
|
|
|
|
|
} |
57
|
1
|
|
|
|
|
4
|
|
58
|
|
|
|
|
|
|
my $self = shift; |
59
|
|
|
|
|
|
|
return join(' ', '<<', (map { $self->$_()->ntriples_string() } qw(subject predicate object)), '>>'); |
60
|
|
|
|
|
|
|
} |
61
|
0
|
|
|
0
|
0
|
|
} |
62
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
use Moo; |
64
|
|
|
|
|
|
|
use Attean::API::Binding; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
has 'subject' => (is => 'ro', does => 'Attean::API::BlankOrIRI', required => 1); |
67
|
50
|
|
|
50
|
|
354
|
has 'predicate' => (is => 'ro', does => 'Attean::API::IRI', required => 1); |
|
50
|
|
|
|
|
96
|
|
|
50
|
|
|
|
|
241
|
|
68
|
50
|
|
|
50
|
|
14642
|
has 'object' => (is => 'ro', does => 'Attean::API::Term', required => 1); |
|
50
|
|
|
|
|
126
|
|
|
50
|
|
|
|
|
8176
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
with 'Attean::API::Triple'; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
around BUILDARGS => sub { |
73
|
|
|
|
|
|
|
my $orig = shift; |
74
|
|
|
|
|
|
|
my $class = shift; |
75
|
|
|
|
|
|
|
if (scalar(@_) == 3) { |
76
|
|
|
|
|
|
|
my %args; |
77
|
|
|
|
|
|
|
@args{ $class->variables } = @_; |
78
|
|
|
|
|
|
|
return $class->$orig(%args); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
return $class->$orig(@_); |
81
|
|
|
|
|
|
|
}; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 BUGS |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Please report any bugs or feature requests to through the GitHub web interface |
91
|
|
|
|
|
|
|
at L<https://github.com/kasei/attean/issues>. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SEE ALSO |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 AUTHOR |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Gregory Todd Williams C<< <gwilliams@cpan.org> >> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Copyright (c) 2014--2022 Gregory Todd Williams. |
104
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under |
105
|
|
|
|
|
|
|
the same terms as Perl itself. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |