line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::Algebra::Load |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Algebra::Load - Algebra class for LOAD operations |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Algebra::Load version 2.915_01. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package RDF::Query::Algebra::Load; |
15
|
|
|
|
|
|
|
|
16
|
36
|
|
|
36
|
|
186
|
use strict; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
922
|
|
17
|
36
|
|
|
36
|
|
183
|
use warnings; |
|
36
|
|
|
|
|
66
|
|
|
36
|
|
|
|
|
908
|
|
18
|
36
|
|
|
36
|
|
175
|
no warnings 'redefine'; |
|
36
|
|
|
|
|
4027
|
|
|
36
|
|
|
|
|
1232
|
|
19
|
36
|
|
|
36
|
|
190
|
use base qw(RDF::Query::Algebra); |
|
36
|
|
|
|
|
61
|
|
|
36
|
|
|
|
|
2487
|
|
20
|
|
|
|
|
|
|
|
21
|
36
|
|
|
36
|
|
183
|
use Data::Dumper; |
|
36
|
|
|
|
|
60
|
|
|
36
|
|
|
|
|
1563
|
|
22
|
36
|
|
|
36
|
|
174
|
use Log::Log4perl; |
|
36
|
|
|
|
|
70
|
|
|
36
|
|
|
|
|
233
|
|
23
|
36
|
|
|
36
|
|
1518
|
use Scalar::Util qw(refaddr); |
|
36
|
|
|
|
|
254
|
|
|
36
|
|
|
|
|
1646
|
|
24
|
36
|
|
|
36
|
|
181
|
use Carp qw(carp croak confess); |
|
36
|
|
|
|
|
61
|
|
|
36
|
|
|
|
|
2075
|
|
25
|
36
|
|
|
36
|
|
176
|
use Scalar::Util qw(blessed reftype refaddr); |
|
36
|
|
|
|
|
64
|
|
|
36
|
|
|
|
|
1925
|
|
26
|
36
|
|
|
36
|
|
194
|
use Time::HiRes qw(gettimeofday tv_interval); |
|
36
|
|
|
|
|
59
|
|
|
36
|
|
|
|
|
295
|
|
27
|
36
|
|
|
36
|
|
4414
|
use RDF::Trine::Iterator qw(smap sgrep swatch); |
|
36
|
|
|
|
|
67
|
|
|
36
|
|
|
|
|
3269
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
###################################################################### |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our ($VERSION); |
32
|
|
|
|
|
|
|
my %TRIPLE_LABELS; |
33
|
|
|
|
|
|
|
my @node_methods = qw(subject predicate object); |
34
|
|
|
|
|
|
|
BEGIN { |
35
|
36
|
|
|
36
|
|
16464
|
$VERSION = '2.915_01'; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
###################################################################### |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Beyond the methods documented below, this class inherits methods from the |
43
|
|
|
|
|
|
|
L<RDF::Query::Algebra> class. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=over 4 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item C<new ( $url )> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns a new LOAD structure. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
56
|
2
|
|
|
2
|
1
|
4
|
my $class = shift; |
57
|
2
|
|
|
|
|
4
|
my $url = shift; |
58
|
2
|
|
|
|
|
4
|
my $graph = shift; |
59
|
2
|
|
|
|
|
4
|
my $silent = shift; |
60
|
2
|
|
|
|
|
9
|
return bless([$url, $graph, $silent], $class); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item C<< construct_args >> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Returns a list of arguments that, passed to this class' constructor, |
66
|
|
|
|
|
|
|
will produce a clone of this algebra pattern. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub construct_args { |
71
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
72
|
1
|
|
|
|
|
4
|
return ($self->url, $self->graph, $self->silent); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item C<< sse >> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Returns the SSE string for this algebra expression. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub sse { |
82
|
2
|
|
|
2
|
1
|
5
|
my $self = shift; |
83
|
2
|
|
|
|
|
4
|
my $context = shift; |
84
|
2
|
|
|
|
|
4
|
my $indent = shift; |
85
|
|
|
|
|
|
|
|
86
|
2
|
|
|
|
|
7
|
my $url = $self->url; |
87
|
2
|
|
|
|
|
8
|
my $graph = $self->graph; |
88
|
2
|
|
|
|
|
5
|
my $string; |
89
|
2
|
50
|
|
|
|
6
|
my $s = $self->silent ? "SILENT " : ''; |
90
|
2
|
100
|
|
|
|
8
|
if ($graph) { |
91
|
1
|
|
|
|
|
13
|
$string = sprintf( |
92
|
|
|
|
|
|
|
"(load %s<%s> <%s>)", |
93
|
|
|
|
|
|
|
$s, |
94
|
|
|
|
|
|
|
$url->uri_value, |
95
|
|
|
|
|
|
|
$graph->uri_value, |
96
|
|
|
|
|
|
|
); |
97
|
|
|
|
|
|
|
} else { |
98
|
1
|
|
|
|
|
6
|
$string = sprintf( |
99
|
|
|
|
|
|
|
"(load %s<%s>)", |
100
|
|
|
|
|
|
|
$s, |
101
|
|
|
|
|
|
|
$url->uri_value, |
102
|
|
|
|
|
|
|
); |
103
|
|
|
|
|
|
|
} |
104
|
2
|
|
|
|
|
23
|
return $string; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item C<< as_sparql >> |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Returns the SPARQL string for this algebra expression. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub as_sparql { |
114
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
115
|
0
|
|
|
|
|
0
|
my $context = shift; |
116
|
0
|
|
|
|
|
0
|
my $indent = shift; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
0
|
my $url = $self->url; |
119
|
0
|
|
|
|
|
0
|
my $graph = $self->graph; |
120
|
0
|
0
|
|
|
|
0
|
my $s = $self->silent ? "SILENT " : ''; |
121
|
0
|
|
|
|
|
0
|
my $string; |
122
|
0
|
0
|
|
|
|
0
|
if ($graph) { |
123
|
0
|
|
|
|
|
0
|
$string = sprintf( |
124
|
|
|
|
|
|
|
"LOAD %s<%s> INTO GRAPH <%s>", |
125
|
|
|
|
|
|
|
$s, |
126
|
|
|
|
|
|
|
$url->uri_value, |
127
|
|
|
|
|
|
|
$graph->uri_value, |
128
|
|
|
|
|
|
|
); |
129
|
|
|
|
|
|
|
} else { |
130
|
0
|
|
|
|
|
0
|
$string = sprintf( |
131
|
|
|
|
|
|
|
"LOAD %s<%s>", |
132
|
|
|
|
|
|
|
$s, |
133
|
|
|
|
|
|
|
$url->uri_value, |
134
|
|
|
|
|
|
|
); |
135
|
|
|
|
|
|
|
} |
136
|
0
|
|
|
|
|
0
|
return $string; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item C<< referenced_blanks >> |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Returns a list of the blank node names used in this algebra expression. |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=cut |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub referenced_blanks { |
146
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
147
|
0
|
|
|
|
|
0
|
return; |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=item C<< referenced_variables >> |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub referenced_variables { |
155
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
156
|
1
|
|
|
|
|
4
|
return; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item C<< url >> |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub url { |
164
|
3
|
|
|
3
|
1
|
6
|
my $self = shift; |
165
|
3
|
|
|
|
|
12
|
return $self->[0]; |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item C<< graph >> |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub graph { |
173
|
3
|
|
|
3
|
1
|
5
|
my $self = shift; |
174
|
3
|
|
|
|
|
7
|
return $self->[1]; |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=item C<< silent >> |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=cut |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub silent { |
182
|
3
|
|
|
3
|
1
|
6
|
my $self = shift; |
183
|
3
|
|
|
|
|
10
|
return $self->[2]; |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
1; |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
__END__ |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=back |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 AUTHOR |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Gregory Todd Williams <gwilliams@cpan.org> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=cut |