line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::Algebra::Clear |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Algebra::Clear - Algebra class for CLEAR operations |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Algebra::Clear version 2.916. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package RDF::Query::Algebra::Clear; |
15
|
|
|
|
|
|
|
|
16
|
36
|
|
|
36
|
|
178
|
use strict; |
|
36
|
|
|
|
|
73
|
|
|
36
|
|
|
|
|
878
|
|
17
|
36
|
|
|
36
|
|
174
|
use warnings; |
|
36
|
|
|
|
|
63
|
|
|
36
|
|
|
|
|
914
|
|
18
|
36
|
|
|
36
|
|
172
|
no warnings 'redefine'; |
|
36
|
|
|
|
|
67
|
|
|
36
|
|
|
|
|
1160
|
|
19
|
36
|
|
|
36
|
|
180
|
use base qw(RDF::Query::Algebra); |
|
36
|
|
|
|
|
57
|
|
|
36
|
|
|
|
|
2568
|
|
20
|
|
|
|
|
|
|
|
21
|
36
|
|
|
36
|
|
207
|
use Data::Dumper; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
1612
|
|
22
|
36
|
|
|
36
|
|
185
|
use Log::Log4perl; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
258
|
|
23
|
36
|
|
|
36
|
|
1577
|
use Scalar::Util qw(refaddr); |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
1714
|
|
24
|
36
|
|
|
36
|
|
176
|
use Carp qw(carp croak confess); |
|
36
|
|
|
|
|
71
|
|
|
36
|
|
|
|
|
2031
|
|
25
|
36
|
|
|
36
|
|
193
|
use Scalar::Util qw(blessed reftype refaddr); |
|
36
|
|
|
|
|
71
|
|
|
36
|
|
|
|
|
1847
|
|
26
|
36
|
|
|
36
|
|
181
|
use Time::HiRes qw(gettimeofday tv_interval); |
|
36
|
|
|
|
|
66
|
|
|
36
|
|
|
|
|
228
|
|
27
|
36
|
|
|
36
|
|
3807
|
use RDF::Trine::Iterator qw(smap sgrep swatch); |
|
36
|
|
|
|
|
76
|
|
|
36
|
|
|
|
|
3241
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
###################################################################### |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our ($VERSION); |
32
|
|
|
|
|
|
|
my %TRIPLE_LABELS; |
33
|
|
|
|
|
|
|
my @node_methods = qw(subject predicate object); |
34
|
|
|
|
|
|
|
BEGIN { |
35
|
36
|
|
|
36
|
|
19650
|
$VERSION = '2.916'; |
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 ( $graph [, $silent] )> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns a new CLEAR structure. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
56
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
57
|
0
|
|
|
|
|
|
my $graph = shift; |
58
|
0
|
|
|
|
|
|
my $silent = shift; |
59
|
0
|
0
|
|
|
|
|
unless ($graph) { |
60
|
0
|
|
|
|
|
|
throw RDF::Query::Error::MethodInvocationError -text => "A graph argument is required in RDF::Query::Algebra::Clear->new"; |
61
|
0
|
|
|
|
|
|
$graph = RDF::Trine::Node::Nil->new; |
62
|
|
|
|
|
|
|
} |
63
|
0
|
|
|
|
|
|
return bless([$graph, $silent], $class); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item C<< construct_args >> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Returns a list of arguments that, passed to this class' constructor, |
69
|
|
|
|
|
|
|
will produce a clone of this algebra pattern. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub construct_args { |
74
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
75
|
0
|
|
|
|
|
|
return ($self->graph, $self->silent); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item C<< as_sparql >> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Returns the SPARQL string for this algebra expression. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub as_sparql { |
85
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
86
|
0
|
|
|
|
|
|
my $context = shift; |
87
|
0
|
|
|
|
|
|
my $indent = shift; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $graph = $self->graph; |
90
|
0
|
|
|
|
|
|
my $string; |
91
|
0
|
0
|
|
|
|
|
if ($graph->is_nil) { |
|
|
0
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
$string = "CLEAR DEFAULT"; |
93
|
|
|
|
|
|
|
} elsif ($graph->uri_value =~ m'^tag:gwilliams@cpan[.]org,2010-01-01:RT:(NAMED|ALL)$') { |
94
|
0
|
|
|
|
|
|
$string = "CLEAR $1"; |
95
|
|
|
|
|
|
|
} else { |
96
|
0
|
0
|
|
|
|
|
$string = ($graph->is_nil) |
97
|
|
|
|
|
|
|
? 'CLEAR GRAPH DEFAULT' |
98
|
|
|
|
|
|
|
: sprintf( "CLEAR GRAPH <%s>", $graph->uri_value ); |
99
|
|
|
|
|
|
|
} |
100
|
0
|
|
|
|
|
|
return $string; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item C<< sse >> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Returns the SSE string for this algebra expression. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub sse { |
110
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
111
|
0
|
|
|
|
|
|
my $context = shift; |
112
|
0
|
|
|
|
|
|
my $indent = shift; |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my $graph = $self->graph; |
115
|
0
|
|
|
|
|
|
my $string; |
116
|
0
|
0
|
|
|
|
|
if ($graph->is_nil) { |
|
|
0
|
|
|
|
|
|
117
|
0
|
|
|
|
|
|
$string = "(clear default)"; |
118
|
|
|
|
|
|
|
} elsif ($graph->uri_value =~ m'^tag:gwilliams@cpan[.]org,2010-01-01:RT:(NAMED|ALL)$') { |
119
|
0
|
|
|
|
|
|
$string = "(clear " . lc($1) . ")"; |
120
|
|
|
|
|
|
|
} else { |
121
|
0
|
0
|
|
|
|
|
$string = ($graph->is_nil) |
122
|
|
|
|
|
|
|
? '(clear default)' |
123
|
|
|
|
|
|
|
: sprintf( "(clear <%s>)", $graph->uri_value ); |
124
|
|
|
|
|
|
|
} |
125
|
0
|
|
|
|
|
|
return $string; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item C<< referenced_blanks >> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Returns a list of the blank node names used in this algebra expression. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub referenced_blanks { |
135
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
136
|
0
|
|
|
|
|
|
return; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item C<< referenced_variables >> |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub referenced_variables { |
144
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
145
|
0
|
|
|
|
|
|
return; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item C<< graph >> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=cut |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub graph { |
153
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
154
|
0
|
|
|
|
|
|
return $self->[0]; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item C<< silent >> |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=cut |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub silent { |
162
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
163
|
0
|
|
|
|
|
|
return $self->[1]; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
1; |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
__END__ |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=back |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 AUTHOR |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Gregory Todd Williams <gwilliams@cpan.org> |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=cut |