| 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.919. | ||||||||||||
| 11 | |||||||||||||
| 12 | =cut | ||||||||||||
| 13 | |||||||||||||
| 14 | package RDF::Query::Algebra::Copy; | ||||||||||||
| 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 ( $from, $to, $silent )> | ||||||||||||
| 50 | |||||||||||||
| 51 | Returns a new COPY structure. | ||||||||||||
| 52 | |||||||||||||
| 53 | =cut | ||||||||||||
| 54 | |||||||||||||
| 55 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 56 | 0 | my $class = shift; | |||||||||||
| 57 | 0 | my $from = shift; | |||||||||||
| 58 | 0 | my $to = shift; | |||||||||||
| 59 | 0 | ▶ | my $silent = shift || 0; | ||||||||||
|
Condition0%0/2
shift() || 0
MC/DC0%0/1
shift() || 0
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 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 | 0 | ▶ | sub construct_args { | ||||||||||
|
Subroutine
construct_args: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 71 | 0 | 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 | 0 | ▶ | sub as_sparql { | ||||||||||
|
Subroutine
as_sparql: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 82 | 0 | 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 | ▶ | if ($_->isa('RDF::Trine::Node::Nil')) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 90 | 0 | $_ = 'DEFAULT'; | |||||||||||
| 91 | } else { | ||||||||||||
| 92 | 0 | $_ = '<' . $_->uri_value . '>'; | |||||||||||
| 93 | } | ||||||||||||
| 94 | } | ||||||||||||
| 95 | |||||||||||||
| 96 | 0 | ▶ | my $string = sprintf( "COPY %s%s TO %s", ($self->silent ? 'SILENT ' : ''), $from, $to ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 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 | 0 | ▶ | sub sse { | ||||||||||
|
Subroutine
sse: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 107 | 0 | 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 | ▶ | if ($_->isa('RDF::Trine::Node::Nil')) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 115 | 0 | $_ = 'DEFAULT'; | |||||||||||
| 116 | } else { | ||||||||||||
| 117 | 0 | $_ = '<' . $_->uri_value . '>'; | |||||||||||
| 118 | } | ||||||||||||
| 119 | } | ||||||||||||
| 120 | 0 | ▶ | my $string = sprintf( "(copy%s %s %s)", ($self->silent ? '-silent' : ''), $from, $to ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 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 | 0 | ▶ | sub referenced_blanks { | ||||||||||
|
Subroutine
referenced_blanks: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 131 | 0 | my $self = shift; | |||||||||||
| 132 | 0 | return; | |||||||||||
| 133 | } | ||||||||||||
| 134 | |||||||||||||
| 135 | =item C<< referenced_variables >> | ||||||||||||
| 136 | |||||||||||||
| 137 | =cut | ||||||||||||
| 138 | |||||||||||||
| 139 | 0 | ▶ | sub referenced_variables { | ||||||||||
|
Subroutine
referenced_variables: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 140 | 0 | my $self = shift; | |||||||||||
| 141 | 0 | return; | |||||||||||
| 142 | } | ||||||||||||
| 143 | |||||||||||||
| 144 | =item C<< from >> | ||||||||||||
| 145 | |||||||||||||
| 146 | =cut | ||||||||||||
| 147 | |||||||||||||
| 148 | 0 | ▶ | sub from { | ||||||||||
|
Subroutine
from: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 149 | 0 | my $self = shift; | |||||||||||
| 150 | 0 | return $self->[0]; | |||||||||||
| 151 | } | ||||||||||||
| 152 | |||||||||||||
| 153 | =item C<< to >> | ||||||||||||
| 154 | |||||||||||||
| 155 | =cut | ||||||||||||
| 156 | |||||||||||||
| 157 | 0 | ▶ | sub to { | ||||||||||
|
Subroutine
to: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 158 | 0 | my $self = shift; | |||||||||||
| 159 | 0 | return $self->[1]; | |||||||||||
| 160 | } | ||||||||||||
| 161 | |||||||||||||
| 162 | =item C<< silent >> | ||||||||||||
| 163 | |||||||||||||
| 164 | =cut | ||||||||||||
| 165 | |||||||||||||
| 166 | 0 | ▶ | sub silent { | ||||||||||
|
Subroutine
silent: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 167 | 0 | my $self = shift; | |||||||||||
| 168 | 0 | return $self->[2]; | |||||||||||
| 169 | } | ||||||||||||
| 170 | |||||||||||||
| 171 | 36 | 1; | |||||||||||
| 172 | |||||||||||||
| 173 | __END__ | ||||||||||||