line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::Expression::Nary |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Expression::Nary - Class for n-ary expressions |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Expression::Nary version 2.916. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package RDF::Query::Expression::Nary; |
15
|
|
|
|
|
|
|
|
16
|
36
|
|
|
36
|
|
204
|
use strict; |
|
36
|
|
|
|
|
64
|
|
|
36
|
|
|
|
|
1003
|
|
17
|
36
|
|
|
36
|
|
170
|
use warnings; |
|
36
|
|
|
|
|
60
|
|
|
36
|
|
|
|
|
903
|
|
18
|
36
|
|
|
36
|
|
168
|
no warnings 'redefine'; |
|
36
|
|
|
|
|
61
|
|
|
36
|
|
|
|
|
1096
|
|
19
|
36
|
|
|
36
|
|
182
|
use base qw(RDF::Query::Expression); |
|
36
|
|
|
|
|
67
|
|
|
36
|
|
|
|
|
2545
|
|
20
|
|
|
|
|
|
|
|
21
|
36
|
|
|
36
|
|
228
|
use Data::Dumper; |
|
36
|
|
|
|
|
59
|
|
|
36
|
|
|
|
|
1814
|
|
22
|
36
|
|
|
36
|
|
179
|
use Scalar::Util qw(blessed); |
|
36
|
|
|
|
|
68
|
|
|
36
|
|
|
|
|
1645
|
|
23
|
36
|
|
|
36
|
|
179
|
use Carp qw(carp croak confess); |
|
36
|
|
|
|
|
63
|
|
|
36
|
|
|
|
|
2766
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
###################################################################### |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our ($VERSION); |
28
|
|
|
|
|
|
|
BEGIN { |
29
|
36
|
|
|
36
|
|
6651
|
$VERSION = '2.916'; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
###################################################################### |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 METHODS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Beyond the methods documented below, this class inherits methods from the |
37
|
|
|
|
|
|
|
L<RDF::Query::Expression> class. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over 4 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item C<< sse >> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Returns the SSE string for this algebra expression. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub sse { |
50
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
my $context = shift; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
return sprintf( |
54
|
|
|
|
|
|
|
'(%s %s)', |
55
|
|
|
|
|
|
|
$self->op, |
56
|
0
|
|
|
|
|
|
join(' ', map { $_->sse( $context ) } $self->operands), |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item C<< as_sparql >> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Returns the SPARQL string for this algebra expression. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub as_sparql { |
67
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
68
|
0
|
|
|
|
|
|
my $context = shift; |
69
|
0
|
|
|
|
|
|
my $indent = shift; |
70
|
0
|
|
|
|
|
|
my $op = $self->op; |
71
|
0
|
|
|
|
|
|
my @args = map { $_->as_sparql( $context, $indent ) } $self->operands; |
|
0
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
return join(" $op ", @args); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Gregory Todd Williams <gwilliams@cpan.org> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |