line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::Algebra::SubSelect |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Algebra::SubSelect - Algebra class for Subselects |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Algebra::SubSelect version 2.915_01. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package RDF::Query::Algebra::SubSelect; |
15
|
|
|
|
|
|
|
|
16
|
36
|
|
|
36
|
|
182
|
use strict; |
|
36
|
|
|
|
|
75
|
|
|
36
|
|
|
|
|
942
|
|
17
|
36
|
|
|
36
|
|
188
|
use warnings; |
|
36
|
|
|
|
|
67
|
|
|
36
|
|
|
|
|
995
|
|
18
|
36
|
|
|
36
|
|
181
|
use base qw(RDF::Query::Algebra); |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
2560
|
|
19
|
|
|
|
|
|
|
|
20
|
36
|
|
|
36
|
|
200
|
use Log::Log4perl; |
|
36
|
|
|
|
|
68
|
|
|
36
|
|
|
|
|
373
|
|
21
|
36
|
|
|
36
|
|
1695
|
use URI::Escape; |
|
36
|
|
|
|
|
67
|
|
|
36
|
|
|
|
|
2197
|
|
22
|
36
|
|
|
36
|
|
191
|
use MIME::Base64; |
|
36
|
|
|
|
|
79
|
|
|
36
|
|
|
|
|
1790
|
|
23
|
36
|
|
|
36
|
|
1538
|
use Data::Dumper; |
|
36
|
|
|
|
|
73
|
|
|
36
|
|
|
|
|
1504
|
|
24
|
36
|
|
|
36
|
|
196
|
use RDF::Query::Error; |
|
36
|
|
|
|
|
83
|
|
|
36
|
|
|
|
|
298
|
|
25
|
36
|
|
|
36
|
|
1808
|
use Carp qw(carp croak confess); |
|
36
|
|
|
|
|
70
|
|
|
36
|
|
|
|
|
1909
|
|
26
|
36
|
|
|
36
|
|
183
|
use Scalar::Util qw(blessed reftype); |
|
36
|
|
|
|
|
77
|
|
|
36
|
|
|
|
|
1767
|
|
27
|
36
|
|
|
36
|
|
195
|
use Storable qw(store_fd fd_retrieve); |
|
36
|
|
|
|
|
68
|
|
|
36
|
|
|
|
|
1853
|
|
28
|
36
|
|
|
36
|
|
204
|
use RDF::Trine::Iterator qw(sgrep smap swatch); |
|
36
|
|
|
|
|
64
|
|
|
36
|
|
|
|
|
3261
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
###################################################################### |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
our ($VERSION, $BLOOM_FILTER_ERROR_RATE); |
33
|
|
|
|
|
|
|
BEGIN { |
34
|
36
|
|
|
36
|
|
93
|
$BLOOM_FILTER_ERROR_RATE = 0.1; |
35
|
36
|
|
|
|
|
15122
|
$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 ( $query )> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns a new SubSelect structure. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
56
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
57
|
1
|
|
|
|
|
2
|
my $query = shift; |
58
|
1
|
|
|
|
|
9
|
return bless( [ $query ], $class ); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item C<< construct_args >> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns a list of arguments that, passed to this class' constructor, |
64
|
|
|
|
|
|
|
will produce a clone of this algebra pattern. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub construct_args { |
69
|
7
|
|
|
7
|
1
|
10
|
my $self = shift; |
70
|
7
|
|
|
|
|
15
|
return ($self->query); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item C<< query >> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Returns the sub-select query. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub query { |
80
|
14
|
|
|
14
|
1
|
17
|
my $self = shift; |
81
|
14
|
50
|
|
|
|
31
|
if (@_) { |
82
|
0
|
|
|
|
|
0
|
my $query = shift; |
83
|
0
|
|
|
|
|
0
|
$self->[0] = $query; |
84
|
|
|
|
|
|
|
} |
85
|
14
|
|
|
|
|
22
|
my $query = $self->[0]; |
86
|
14
|
|
|
|
|
50
|
return $query; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item C<< sse >> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Returns the SSE string for this algebra expression. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub sse { |
96
|
3
|
|
|
3
|
1
|
4
|
my $self = shift; |
97
|
3
|
|
|
|
|
5
|
my $context = shift; |
98
|
3
|
|
100
|
|
|
10
|
my $prefix = shift || ''; |
99
|
3
|
|
|
|
|
6
|
my $indent = $context->{indent}; |
100
|
|
|
|
|
|
|
|
101
|
3
|
|
|
|
|
8
|
return $self->query->sse( $context ); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item C<< as_sparql >> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Returns the SPARQL string for this algebra expression. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub as_sparql { |
111
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
112
|
2
|
|
|
|
|
3
|
my $context = shift; |
113
|
2
|
|
|
|
|
3
|
my $indent = shift; |
114
|
2
|
|
|
|
|
7
|
my $string = sprintf( |
115
|
|
|
|
|
|
|
"{ %s }", |
116
|
|
|
|
|
|
|
$self->query->as_sparql( $context, $indent ), |
117
|
|
|
|
|
|
|
); |
118
|
2
|
|
|
|
|
8
|
return $string; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item C<< as_hash >> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Returns the query as a nested set of plain data structures (no objects). |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub as_hash { |
128
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
129
|
0
|
|
|
|
|
0
|
my $context = shift; |
130
|
|
|
|
|
|
|
return { |
131
|
0
|
|
|
|
|
0
|
type => lc($self->type), |
132
|
|
|
|
|
|
|
pattern => $self->query->as_hash, |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item C<< type >> |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Returns the type of this algebra expression. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub type { |
143
|
0
|
|
|
0
|
1
|
0
|
return 'SUBSELECT'; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item C<< referenced_variables >> |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Returns a list of the variable names used in this algebra expression. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=cut |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub referenced_variables { |
153
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
154
|
0
|
|
|
|
|
0
|
my @list = $self->query->pattern->referenced_variables; |
155
|
0
|
|
|
|
|
0
|
return @list; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item C<< potentially_bound >> |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Returns a list of the variable names used in this algebra expression that will |
161
|
|
|
|
|
|
|
bind values during execution. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=cut |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub potentially_bound { |
166
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
167
|
1
|
|
|
|
|
3
|
return $self->query->pattern->potentially_bound; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=item C<< definite_variables >> |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Returns a list of the variable names that will be bound after evaluating this algebra expression. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=cut |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub definite_variables { |
177
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
178
|
0
|
|
|
|
|
|
return $self->query->pattern->definite_variables; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
1; |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
__END__ |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=back |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head1 AUTHOR |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Gregory Todd Williams <gwilliams@cpan.org> |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=cut |