Query/Algebra/Load.pm

filter: Statementstmt 83.1% 64 / 77 Branchbran 37.5% 3 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.4% 19 / 21 Podpod 100% 9 / 9 totaltotal 82.6% 95 / 115 CC 5 SCAR 9.6
CC
5
Cov
79%
as_sparql
12.0
sse
3.0
referenced_blanks
2.0
CRAP 2.6
« Query/Functions.pm ↑ Summary Query/Node/Variable.pm »
1 # RDF::Query::Algebra::Load
2 # -----------------------------------------------------------------------------
3  
4 =head1 NAME
5  
6 RDF::Query::Algebra::Load - Algebra class for LOAD operations
7  
8 =head1 VERSION
9  
10 This document describes RDF::Query::Algebra::Load version 2.919.
11  
12 =cut
13  
14 package RDF::Query::Algebra::Load;
15  
16 36 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 36 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 36 ▶no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 36 ▶use base qw(RDF::Query::Algebra);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 36 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 36 ▶use Log::Log4perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 36 ▶use Scalar::Util qw(refaddr);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 36 ▶use Carp qw(carp croak confess);
Subroutine BEGIN: called CC=1 SCAR=0.0
25 36 ▶use Scalar::Util qw(blessed reftype refaddr);
Subroutine BEGIN: called CC=1 SCAR=0.0
26 36 ▶use Time::HiRes qw(gettimeofday tv_interval);
Subroutine BEGIN: called CC=1 SCAR=0.0
27 36 ▶use RDF::Trine::Iterator qw(smap sgrep swatch);
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 ######################################################################
30  
31 36 our ($VERSION);
32 36 my %TRIPLE_LABELS;
33 36 my @node_methods = qw(subject predicate object);
34 36 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
35 36 $VERSION = '2.919';
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 ( $url )>
50  
51 Returns a new LOAD structure.
52  
53 =cut
54  
55 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
56 2 my $class = shift;
57 2 my $url = shift;
58 2 my $graph = shift;
59 2 my $silent = shift;
60 2 return bless([$url, $graph, $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 1 ▶sub construct_args {
Subroutine construct_args: called CC=1 SCAR=0.0
Pod documented
71 1 my $self = shift;
72 1 return ($self->url, $self->graph, $self->silent);
73 }
74  
75 =item C<< sse >>
76  
77 Returns the SSE string for this algebra expression.
78  
79 =cut
80  
81 2 ▶sub sse {
Subroutine sse: called CC=3 SCAR=11.0
Pod documented
82 2 my $self = shift;
83 2 my $context = shift;
84 2 my $indent = shift;
85
86 2 my $url = $self->url;
87 2 my $graph = $self->graph;
88 2 my $string;
89 2 ▶ my $s = $self->silent ? "SILENT " : '';
Branch: 1 branch
BranchTrueFalseTotal
$self->silent ? : 0 2 2
90 2 ▶ if ($graph) {
Branch: 1 branch
BranchTrueFalseTotal
if ($graph) { } 1 1 2
91 1 $string = sprintf(
92 "(load %s<%s> <%s>)",
93 $s,
94 $url->uri_value,
95 $graph->uri_value,
96 );
97 } else {
98 1 $string = sprintf(
99 "(load %s<%s>)",
100 $s,
101 $url->uri_value,
102 );
103 }
104 2 return $string;
105 }
106  
107 =item C<< as_sparql >>
108  
109 Returns the SPARQL string for this algebra expression.
110  
111 =cut
112  
113 0 ▶sub as_sparql {
Subroutine as_sparql: not called CC=3 SCAR=24.8
Pod documented
114 0 my $self = shift;
115 0 my $context = shift;
116 0 my $indent = shift;
117
118 0 my $url = $self->url;
119 0 my $graph = $self->graph;
120 0 ▶ my $s = $self->silent ? "SILENT " : '';
Branch: 1 branch
BranchTrueFalseTotal
$self->silent ? : 0 0 0
121 0 my $string;
122 0 ▶ if ($graph) {
Branch: 1 branch
BranchTrueFalseTotal
if ($graph) { } 0 0 0
123 0 $string = sprintf(
124 "LOAD %s<%s> INTO GRAPH <%s>",
125 $s,
126 $url->uri_value,
127 $graph->uri_value,
128 );
129 } else {
130 0 $string = sprintf(
131 "LOAD %s<%s>",
132 $s,
133 $url->uri_value,
134 );
135 }
136 0 return $string;
137 }
138  
139 =item C<< referenced_blanks >>
140  
141 Returns a list of the blank node names used in this algebra expression.
142  
143 =cut
144  
145 0 ▶sub referenced_blanks {
Subroutine referenced_blanks: not called CC=1 SCAR=6.9
Pod documented
146 0 my $self = shift;
147 0 return;
148 }
149  
150 =item C<< referenced_variables >>
151  
152 =cut
153  
154 1 ▶sub referenced_variables {
Subroutine referenced_variables: called CC=1 SCAR=0.0
Pod documented
155 1 my $self = shift;
156 1 return;
157 }
158  
159 =item C<< url >>
160  
161 =cut
162  
163 3 ▶sub url {
Subroutine url: called CC=1 SCAR=0.0
Pod documented
164 3 my $self = shift;
165 3 return $self->[0];
166 }
167  
168 =item C<< graph >>
169  
170 =cut
171  
172 3 ▶sub graph {
Subroutine graph: called CC=1 SCAR=0.0
Pod documented
173 3 my $self = shift;
174 3 return $self->[1];
175 }
176  
177 =item C<< silent >>
178  
179 =cut
180  
181 3 ▶sub silent {
Subroutine silent: called CC=1 SCAR=0.0
Pod documented
182 3 my $self = shift;
183 3 return $self->[2];
184 }
185  
186 36 1;
187  
188 __END__
« Query/Functions.pm ↑ Summary Query/Node/Variable.pm »