line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::ExecutionContext |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::ExecutionContext - Query execution context |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::ExecutionContext version 2.916. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 METHODS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=over 4 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package RDF::Query::ExecutionContext; |
19
|
|
|
|
|
|
|
|
20
|
35
|
|
|
35
|
|
171
|
use strict; |
|
35
|
|
|
|
|
69
|
|
|
35
|
|
|
|
|
847
|
|
21
|
35
|
|
|
35
|
|
174
|
use warnings; |
|
35
|
|
|
|
|
58
|
|
|
35
|
|
|
|
|
1540
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
###################################################################### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our ($VERSION); |
26
|
|
|
|
|
|
|
BEGIN { |
27
|
35
|
|
|
35
|
|
28910
|
$VERSION = '2.916'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
###################################################################### |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item C<< new ( model => $model, query => $query, bound => \%bound ) >> |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
158
|
|
|
158
|
1
|
300
|
my $class = shift; |
38
|
158
|
|
|
|
|
2022
|
my %args = @_; |
39
|
158
|
|
|
|
|
1490
|
my $self = bless( [{ %args }], $class ); |
40
|
158
|
|
|
|
|
908
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item C<< copy ( %new_args ) >> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub copy { |
48
|
112
|
|
|
112
|
1
|
173
|
my $self = shift; |
49
|
112
|
|
|
|
|
278
|
my %args = @_; |
50
|
112
|
|
|
|
|
194
|
my $class = ref($self); |
51
|
112
|
|
|
|
|
156
|
my @data; |
52
|
112
|
|
|
|
|
161
|
foreach my $i (0 .. $#{ $self }) { |
|
112
|
|
|
|
|
285
|
|
53
|
112
|
|
|
|
|
161
|
push(@data, { %{ $self->[$i] } }); |
|
112
|
|
|
|
|
1214
|
|
54
|
|
|
|
|
|
|
} |
55
|
112
|
|
|
|
|
271
|
@{ $data[0] }{ keys %args } = values %args; |
|
112
|
|
|
|
|
274
|
|
56
|
112
|
|
|
|
|
474
|
return bless( \@data, $class ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item C<< pushstack >> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub pushstack { |
64
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
65
|
0
|
|
|
|
|
0
|
unshift( @{ $self }, {} ); |
|
0
|
|
|
|
|
0
|
|
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item C<< popstack >> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub popstack { |
73
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
74
|
0
|
|
|
|
|
0
|
shift( @{ $self } ); |
|
0
|
|
|
|
|
0
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item C<< model >> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub model { |
82
|
1150
|
|
|
1150
|
1
|
1602
|
my $self = shift; |
83
|
1150
|
|
|
|
|
2701
|
my $model = $self->_get_value( 'model', @_ ); |
84
|
1150
|
50
|
|
|
|
3107
|
unless ($model) { |
85
|
0
|
|
|
|
|
0
|
$model = RDF::Trine::Model->temporary_model; |
86
|
|
|
|
|
|
|
} |
87
|
1150
|
|
|
|
|
2926
|
return $model; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item C<< query >> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub query { |
95
|
764
|
|
|
764
|
1
|
1104
|
my $self = shift; |
96
|
764
|
|
|
|
|
2596
|
return $self->_get_value( 'query', @_ ); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item C<< options >> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub options { |
104
|
850
|
|
|
850
|
1
|
1171
|
my $self = shift; |
105
|
850
|
|
|
|
|
2193
|
return $self->_get_value( 'options', @_ ); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item C<< bound >> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub bound { |
113
|
523
|
|
|
523
|
1
|
755
|
my $self = shift; |
114
|
523
|
|
50
|
|
|
1567
|
return $self->_get_value( 'bound', @_ ) || {}; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item C<< bind_variable ( $varname => $node ) >> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub bind_variable { |
122
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
123
|
0
|
|
|
|
|
0
|
my $var = shift; |
124
|
0
|
|
|
|
|
0
|
my $term = shift; |
125
|
0
|
|
0
|
|
|
0
|
my $bound = $self->_get_value( 'bound', @_ ) || {}; |
126
|
0
|
|
|
|
|
0
|
$bound->{$var} = $term; |
127
|
0
|
|
|
|
|
0
|
return $self->_get_value('bound', $bound); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item C<< base_uri >> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub base_uri { |
135
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
136
|
0
|
|
0
|
|
|
0
|
return $self->_get_value( 'base_uri', @_ ) || {}; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item C<< ns >> |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub ns { |
144
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
145
|
0
|
|
0
|
|
|
0
|
return $self->_get_value( 'ns', @_ ) || {}; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item C<< logger >> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=cut |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub logger { |
153
|
3
|
|
|
3
|
1
|
6
|
my $self = shift; |
154
|
3
|
|
|
|
|
12
|
return $self->_get_value( 'logger', @_ ); |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item C<< costmodel >> |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=cut |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub costmodel { |
162
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
163
|
0
|
|
|
|
|
0
|
return $self->_get_value( 'costmodel', @_ ); |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=item C<< requested_variables >> |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=cut |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub requested_variables { |
171
|
153
|
|
|
153
|
1
|
269
|
my $self = shift; |
172
|
153
|
|
|
|
|
449
|
return $self->_get_value( 'requested_variables', @_ ); |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item C<< optimize >> |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=cut |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub optimize { |
180
|
27
|
|
|
27
|
1
|
48
|
my $self = shift; |
181
|
27
|
|
|
|
|
78
|
return $self->_get_value( 'optimize', @_ ); |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item C<< strict_errors >> |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub strict_errors { |
189
|
5
|
|
|
5
|
1
|
8
|
my $self = shift; |
190
|
5
|
|
|
|
|
15
|
return $self->_get_value( 'strict_errors', @_ ); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=item C<< optimistic_threshold_time >> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=cut |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
sub optimistic_threshold_time { |
198
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
199
|
0
|
|
|
|
|
0
|
return $self->_get_value( 'optimistic_threshold_time', @_ ); |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=item C<< delegate >> |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=cut |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub delegate { |
207
|
600
|
|
|
600
|
1
|
840
|
my $self = shift; |
208
|
600
|
|
|
|
|
1404
|
return $self->_get_value( 'delegate', @_ ); |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
sub _get_value { |
212
|
4075
|
|
|
4075
|
|
5295
|
my $self = shift; |
213
|
4075
|
|
|
|
|
5415
|
my $key = shift; |
214
|
4075
|
50
|
|
|
|
8694
|
if (@_) { |
215
|
0
|
|
|
|
|
0
|
$self->[0]{ $key } = shift; |
216
|
0
|
|
|
|
|
0
|
return $self->[0]{ $key }; |
217
|
|
|
|
|
|
|
} |
218
|
4075
|
|
|
|
|
4897
|
foreach my $i (0 .. $#{ $self }) { |
|
4075
|
|
|
|
|
9917
|
|
219
|
4075
|
50
|
|
|
|
10524
|
if (exists($self->[ $i ]{ $key })) { |
220
|
4075
|
|
|
|
|
14718
|
return $self->[ $i ]{ $key }; |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
} |
223
|
0
|
|
|
|
|
|
return; |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
1; |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
__END__ |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=back |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=head1 AUTHOR |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
Gregory Todd Williams <gwilliams@cpan.org> |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=cut |