line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::Algebra::Copy |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Algebra::Copy - Algebra class for COPY operations |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Algebra::Copy version 2.916. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package RDF::Query::Algebra::Copy; |
15
|
|
|
|
|
|
|
|
16
|
36
|
|
|
36
|
|
178
|
use strict; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
910
|
|
17
|
36
|
|
|
36
|
|
176
|
use warnings; |
|
36
|
|
|
|
|
70
|
|
|
36
|
|
|
|
|
915
|
|
18
|
36
|
|
|
36
|
|
174
|
no warnings 'redefine'; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
1125
|
|
19
|
36
|
|
|
36
|
|
177
|
use base qw(RDF::Query::Algebra); |
|
36
|
|
|
|
|
64
|
|
|
36
|
|
|
|
|
2528
|
|
20
|
|
|
|
|
|
|
|
21
|
36
|
|
|
36
|
|
186
|
use Data::Dumper; |
|
36
|
|
|
|
|
84
|
|
|
36
|
|
|
|
|
1639
|
|
22
|
36
|
|
|
36
|
|
197
|
use Log::Log4perl; |
|
36
|
|
|
|
|
75
|
|
|
36
|
|
|
|
|
276
|
|
23
|
36
|
|
|
36
|
|
1583
|
use Scalar::Util qw(refaddr); |
|
36
|
|
|
|
|
78
|
|
|
36
|
|
|
|
|
1768
|
|
24
|
36
|
|
|
36
|
|
205
|
use Carp qw(carp croak confess); |
|
36
|
|
|
|
|
75
|
|
|
36
|
|
|
|
|
2200
|
|
25
|
36
|
|
|
36
|
|
181
|
use Scalar::Util qw(blessed reftype refaddr); |
|
36
|
|
|
|
|
78
|
|
|
36
|
|
|
|
|
2037
|
|
26
|
36
|
|
|
36
|
|
187
|
use Time::HiRes qw(gettimeofday tv_interval); |
|
36
|
|
|
|
|
82
|
|
|
36
|
|
|
|
|
231
|
|
27
|
36
|
|
|
36
|
|
3829
|
use RDF::Trine::Iterator qw(smap sgrep swatch); |
|
36
|
|
|
|
|
80
|
|
|
36
|
|
|
|
|
3309
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
###################################################################### |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our ($VERSION); |
32
|
|
|
|
|
|
|
my %TRIPLE_LABELS; |
33
|
|
|
|
|
|
|
my @node_methods = qw(subject predicate object); |
34
|
|
|
|
|
|
|
BEGIN { |
35
|
36
|
|
|
36
|
|
17344
|
$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 ( $from, $to, $silent )> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns a new COPY structure. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
56
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
57
|
0
|
|
|
|
|
|
my $from = shift; |
58
|
0
|
|
|
|
|
|
my $to = shift; |
59
|
0
|
|
0
|
|
|
|
my $silent = shift || 0; |
60
|
0
|
|
|
|
|
|
return bless([$from, $to, $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
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
72
|
0
|
|
|
|
|
|
return ($self->from, $self->to, $self->silent); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item C<< as_sparql >> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Returns the SPARQL string for this algebra expression. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub as_sparql { |
82
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
83
|
0
|
|
|
|
|
|
my $context = shift; |
84
|
0
|
|
|
|
|
|
my $indent = shift; |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
my $from = $self->from; |
87
|
0
|
|
|
|
|
|
my $to = $self->to; |
88
|
0
|
|
|
|
|
|
for ($from, $to) { |
89
|
0
|
0
|
|
|
|
|
if ($_->isa('RDF::Trine::Node::Nil')) { |
90
|
0
|
|
|
|
|
|
$_ = 'DEFAULT'; |
91
|
|
|
|
|
|
|
} else { |
92
|
0
|
|
|
|
|
|
$_ = '<' . $_->uri_value . '>'; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
0
|
0
|
|
|
|
|
my $string = sprintf( "COPY %s%s TO %s", ($self->silent ? 'SILENT ' : ''), $from, $to ); |
97
|
0
|
|
|
|
|
|
return $string; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item C<< sse >> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Returns the SSE string for this algebra expression. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub sse { |
107
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
108
|
0
|
|
|
|
|
|
my $context = shift; |
109
|
0
|
|
|
|
|
|
my $indent = shift; |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
my $from = $self->from; |
112
|
0
|
|
|
|
|
|
my $to = $self->to; |
113
|
0
|
|
|
|
|
|
for ($from, $to) { |
114
|
0
|
0
|
|
|
|
|
if ($_->isa('RDF::Trine::Node::Nil')) { |
115
|
0
|
|
|
|
|
|
$_ = 'DEFAULT'; |
116
|
|
|
|
|
|
|
} else { |
117
|
0
|
|
|
|
|
|
$_ = '<' . $_->uri_value . '>'; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
} |
120
|
0
|
0
|
|
|
|
|
my $string = sprintf( "(copy%s %s %s)", ($self->silent ? '-silent' : ''), $from, $to ); |
121
|
0
|
|
|
|
|
|
return $string; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item C<< referenced_blanks >> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Returns a list of the blank node names used in this algebra expression. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=cut |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub referenced_blanks { |
131
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
132
|
0
|
|
|
|
|
|
return; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item C<< referenced_variables >> |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub referenced_variables { |
140
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
141
|
0
|
|
|
|
|
|
return; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item C<< from >> |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=cut |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub from { |
149
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
150
|
0
|
|
|
|
|
|
return $self->[0]; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item C<< to >> |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=cut |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub to { |
158
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
159
|
0
|
|
|
|
|
|
return $self->[1]; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=item C<< silent >> |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub silent { |
167
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
168
|
0
|
|
|
|
|
|
return $self->[2]; |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
1; |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
__END__ |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=back |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=head1 AUTHOR |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Gregory Todd Williams <gwilliams@cpan.org> |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=cut |