| 1 | # RDF::Query::Parser::RDQL | ||||||||||
| 2 | # ----------------------------------------------------------------------------- | ||||||||||
| 3 | |||||||||||
| 4 | =head1 NAME | ||||||||||
| 5 | |||||||||||
| 6 | RDF::Query::Parser::RDQL - An RDQL parser for RDF::Query | ||||||||||
| 7 | |||||||||||
| 8 | =head1 VERSION | ||||||||||
| 9 | |||||||||||
| 10 | This document describes RDF::Query::Parser::RDQL version 2.919. | ||||||||||
| 11 | |||||||||||
| 12 | =cut | ||||||||||
| 13 | |||||||||||
| 14 | package RDF::Query::Parser::RDQL; | ||||||||||
| 15 | |||||||||||
| 16 | 35 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 35 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 35 | ▶ | no warnings 'redefine'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 35 | ▶ | use base qw(RDF::Query::Parser); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | 35 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 35 | ▶ | use Parse::RecDescent; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 35 | ▶ | use Carp qw(carp croak confess); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 35 | ▶ | use RDF::Query::Error qw(:try); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 35 | ▶ | use Scalar::Util qw(blessed); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | |||||||||||
| 27 | ###################################################################### | ||||||||||
| 28 | |||||||||||
| 29 | 35 | our ($VERSION, $lang, $languri); | |||||||||
| 30 | 35 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 35 | $::RD_TRACE = undef; | |||||||||
| 32 | 35 | $::RD_HINT = undef; | |||||||||
| 33 | 35 | $VERSION = '2.919'; | |||||||||
| 34 | 35 | $lang = 'rdql'; | |||||||||
| 35 | 35 | $languri = 'http://jena.hpl.hp.com/2003/07/query/RDQL'; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 35 | our($RDQL_GRAMMAR); | |||||||||
| 39 | 35 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 40 | 35 | our $RDQL_GRAMMAR = <<'END'; | |||||||||
| 41 | query: 'SELECT' variable(s) SourceClause(?) 'WHERE' triplepattern(s) constraints(?) OptOrderBy(?) prefixes(?) | ||||||||||
| 42 | { | ||||||||||
| 43 | my $triples = RDF::Query::Algebra::GroupGraphPattern->new( @{ $item[5] } ); | ||||||||||
| 44 | my $filter = ($item[6][0] || []); | ||||||||||
| 45 | |||||||||||
| 46 | if (scalar(@$filter)) { | ||||||||||
| 47 | $triples = RDF::Query::Parser->new_filter( $filter, $triples ); | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | $return = { | ||||||||||
| 51 | method => 'SELECT', | ||||||||||
| 52 | variables => $item[2], | ||||||||||
| 53 | sources => $item[3][0], | ||||||||||
| 54 | triples => [ $triples ], | ||||||||||
| 55 | namespaces => (scalar(@{$item[8]}) ? $item[8][0] : {}) | ||||||||||
| 56 | }; | ||||||||||
| 57 | if (@{ $item[7] }) { | ||||||||||
| 58 | $return->{options}{orderby} = $item[9][0]; | ||||||||||
| 59 | } | ||||||||||
| 60 | } | ||||||||||
| 61 | prefixes: 'USING' namespaces { $return = $item[2] } | ||||||||||
| 62 | OptOrderBy: 'ORDER BY' orderbyvariable(s) { $return = $item[2] } | ||||||||||
| 63 | orderbyvariable: variable { $return = ['ASC', $item[1]] } | ||||||||||
| 64 | | /ASC|DESC/i '[' variable ']' { $return = [uc($item[1]), $item[3]] } | ||||||||||
| 65 | SourceClause: ('SOURCE' | 'FROM') Source(s) { $return = $item[2] } | ||||||||||
| 66 | Source: URI { $return = [$item[1]] } | ||||||||||
| 67 | variable: '?' identifier { $return = RDF::Query::Parser->new_variable($item[2]) } | ||||||||||
| 68 | triplepattern: '(' VarUri VarUri VarUriConst ')' { $return = RDF::Query::Parser::RDQL::Triple->new(@item[2,3,4]) } | ||||||||||
| 69 | constraints: 'AND' Expression OptExpression(s?) { | ||||||||||
| 70 | if (scalar(@{ $item[3] })) { | ||||||||||
| 71 | my ($op, $expr) = @{ $item[3][0] }; | ||||||||||
| 72 | $return = RDF::Query::Parser->new_function_expression( $op, $item[2], $expr ); | ||||||||||
| 73 | } else { | ||||||||||
| 74 | $return = $item[2]; | ||||||||||
| 75 | } | ||||||||||
| 76 | } | ||||||||||
| 77 | OptExpression: (',' | 'AND') Expression { | ||||||||||
| 78 | $return = [ 'sparql:logical-and', $item[2] ]; | ||||||||||
| 79 | } | ||||||||||
| 80 | Expression: CondOrExpr { | ||||||||||
| 81 | $return = $item[1] | ||||||||||
| 82 | } | ||||||||||
| 83 | CondOrExpr: CondAndExpr CondOrExprOrPart(?) { | ||||||||||
| 84 | if (scalar(@{ $item[2] })) { | ||||||||||
| 85 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 86 | $return = RDF::Query::Parser->new_function_expression( $op, $item[1], $expr ); | ||||||||||
| 87 | } else { | ||||||||||
| 88 | $return = $item[1]; | ||||||||||
| 89 | } | ||||||||||
| 90 | } | ||||||||||
| 91 | CondOrExprOrPart: '||' CondAndExpr { $return = [ 'sparql:logical-or', $item[2] ] } | ||||||||||
| 92 | CondAndExpr: ValueLogical CondAndExprAndPart(?) { | ||||||||||
| 93 | if (scalar(@{ $item[2] })) { | ||||||||||
| 94 | $return = RDF::Query::Parser->new_function_expression( 'sparql:logical-and', $item[1], $item[2][0][1] ); | ||||||||||
| 95 | } else { | ||||||||||
| 96 | $return = $item[1]; | ||||||||||
| 97 | } | ||||||||||
| 98 | } | ||||||||||
| 99 | CondAndExprAndPart: '&&' ValueLogical { $return = [ @item[1,2] ] } | ||||||||||
| 100 | ValueLogical: StringEqualityExpression { $return = $item[1] } | ||||||||||
| 101 | StringEqualityExpression: NumericalLogical StrEqExprPart(s?) { | ||||||||||
| 102 | if (scalar(@{ $item[2] })) { | ||||||||||
| 103 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 104 | if ($op eq '~~') { | ||||||||||
| 105 | $return = RDF::Query::Parser->new_function_expression( 'sparql:regex', $item[1], $expr ); | ||||||||||
| 106 | } else { | ||||||||||
| 107 | $return = RDF::Query::Parser->new_binary_expression( $op, $item[1], $expr ); | ||||||||||
| 108 | } | ||||||||||
| 109 | } else { | ||||||||||
| 110 | $return = $item[1]; | ||||||||||
| 111 | } | ||||||||||
| 112 | } | ||||||||||
| 113 | StrEqExprPart: ('==' | '!=' | '=~' | '~~') NumericalLogical { $return = [ @item[1,2] ] } | ||||||||||
| 114 | NumericalLogical: InclusiveOrExpression { $return = $item[1] } | ||||||||||
| 115 | InclusiveOrExpression: ExclusiveOrExpression InclusiveOrExprPart(s?) { | ||||||||||
| 116 | if (scalar(@{ $item[2] })) { | ||||||||||
| 117 | $return = [ $item[2][0][0], $item[1], $item[2][0][1] ]; | ||||||||||
| 118 | } else { | ||||||||||
| 119 | $return = $item[1]; | ||||||||||
| 120 | } | ||||||||||
| 121 | } | ||||||||||
| 122 | InclusiveOrExprPart: '|' ExclusiveOrExpression { $return = [ @item[1,2] ] } | ||||||||||
| 123 | ExclusiveOrExpression: AndExpression ExclusiveOrExprPart(s?) { | ||||||||||
| 124 | if (scalar(@{ $item[2] })) { | ||||||||||
| 125 | $return = [ $item[2][0][0], $item[1], map { $_->[1] } @{ $item[2] } ]; | ||||||||||
| 126 | } else { | ||||||||||
| 127 | $return = $item[1]; | ||||||||||
| 128 | } | ||||||||||
| 129 | } | ||||||||||
| 130 | ExclusiveOrExprPart: '^' AndExpression { $return = [ @item[1,2] ] } | ||||||||||
| 131 | AndExpression: ArithmeticCondition AndExprPart(s?) { | ||||||||||
| 132 | if (scalar(@{ $item[2] })) { | ||||||||||
| 133 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 134 | $return = RDF::Query::Parser->new_binary_expression( $op, $item[1], $expr ); | ||||||||||
| 135 | } else { | ||||||||||
| 136 | $return = $item[1]; | ||||||||||
| 137 | } | ||||||||||
| 138 | } | ||||||||||
| 139 | AndExprPart: '&' ArithmeticCondition { $return = [ @item[1,2] ] } | ||||||||||
| 140 | ArithmeticCondition: EqualityExpression { $return = $item[1]; } | ||||||||||
| 141 | EqualityExpression: RelationalExpression EqualityExprPart(?) { | ||||||||||
| 142 | if (scalar(@{ $item[2] })) { | ||||||||||
| 143 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 144 | $return = RDF::Query::Parser->new_binary_expression( $op, $item[1], $expr ); | ||||||||||
| 145 | } else { | ||||||||||
| 146 | $return = $item[1]; | ||||||||||
| 147 | } | ||||||||||
| 148 | } | ||||||||||
| 149 | EqualityExprPart: /(==|!=)/ RelationalExpression { $return = [ @item[1,2] ] } | ||||||||||
| 150 | RelationalExpression: NumericExpression RelationalExprPart(?) { | ||||||||||
| 151 | if (scalar(@{ $item[2] })) { | ||||||||||
| 152 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 153 | $return = RDF::Query::Parser->new_binary_expression( $op, $item[1], $expr ); | ||||||||||
| 154 | } else { | ||||||||||
| 155 | $return = $item[1]; | ||||||||||
| 156 | } | ||||||||||
| 157 | } | ||||||||||
| 158 | RelationalExprPart: /(<|>|<=|>=)/ NumericExpression { $return = [ @item[1,2] ] } | ||||||||||
| 159 | NumericExpression: MultiplicativeExpression NumericExprPart(s?) { | ||||||||||
| 160 | if (scalar(@{ $item[2] })) { | ||||||||||
| 161 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 162 | $return = RDF::Query::Parser->new_binary_expression( $op, $item[1], $expr ); | ||||||||||
| 163 | } else { | ||||||||||
| 164 | $return = $item[1]; | ||||||||||
| 165 | } | ||||||||||
| 166 | } | ||||||||||
| 167 | NumericExprPart: /([-+])/ MultiplicativeExpression { $return = [ @item[1,2] ] } | ||||||||||
| 168 | MultiplicativeExpression: UnaryExpression MultExprPart(s?) { | ||||||||||
| 169 | if (scalar(@{ $item[2] })) { | ||||||||||
| 170 | my ($op, $expr) = @{ $item[2][0] }; | ||||||||||
| 171 | $return = RDF::Query::Parser->new_binary_expression( $op, $item[1], $expr ); | ||||||||||
| 172 | } else { | ||||||||||
| 173 | $return = $item[1]; | ||||||||||
| 174 | } | ||||||||||
| 175 | } | ||||||||||
| 176 | MultExprPart: /([\/*])/ UnaryExpression { $return = [ @item[1,2] ] } | ||||||||||
| 177 | UnaryExpression: UnaryExprNotPlusMinus { $return = $item[1] } | ||||||||||
| 178 | | /([-+])/ UnaryExpression { $return = [ @item[1,2] ] } | ||||||||||
| 179 | UnaryExprNotPlusMinus: /([~!])/ UnaryExpression { $return = [ @item[1,2] ] } | ||||||||||
| 180 | | PrimaryExpression { $return = $item[1] } | ||||||||||
| 181 | PrimaryExpression: (VarUriConst | FunctionCall) { $return = $item[1] } | ||||||||||
| 182 | | '(' Expression ')' { | ||||||||||
| 183 | $return = $item[2]; | ||||||||||
| 184 | } | ||||||||||
| 185 | FunctionCall: identifier '(' ArgList ')' { $return = [ 'function', map { @{ $_ } } @item[1,3] ] } | ||||||||||
| 186 | ArgList: VarUriConst MoreArg(s) { $return = [ $item[1], @{ $item[2] } ] } | ||||||||||
| 187 | |||||||||||
| 188 | |||||||||||
| 189 | |||||||||||
| 190 | |||||||||||
| 191 | MoreArg: "," VarUriConst { $return = $item[2] } | ||||||||||
| 192 | Literal: (URI | CONST) { $return = $item[1] } | ||||||||||
| 193 | URL: qURI { $return = $item[1] } | ||||||||||
| 194 | VarUri: (variable | URI) { $return = $item[1] } | ||||||||||
| 195 | VarUriConst: (variable | CONST | URI) { $return = $item[1] } | ||||||||||
| 196 | namespaces: namespace morenamespace(s?) { $return = { map { %{ $_ } } ($item[1], @{ $item[2] }) } } | ||||||||||
| 197 | morenamespace: OptComma namespace { $return = $item[2] } | ||||||||||
| 198 | namespace: identifier 'FOR' qURI { $return = {@item[1,3]} } | ||||||||||
| 199 | OptComma: ',' | '' | ||||||||||
| 200 | identifier: /(([a-zA-Z0-9_.-])+)/ { $return = $1 } | ||||||||||
| 201 | URI: qURI { $return = RDF::Query::Parser->new_uri( $item[1] ) } | ||||||||||
| 202 | | QName { $return = RDF::Query::Parser::RDQL::URI->new( $item[1] ) } | ||||||||||
| 203 | qURI: '<' /[A-Za-z0-9_.!~*'()%;\/?:@&=+,#\$-]+/ '>' { $return = $item[2] } | ||||||||||
| 204 | QName: identifier ':' /([^ \t<>()]+)/ { $return = [@item[1,3]] } | ||||||||||
| 205 | CONST: Text { $return = RDF::Query::Parser->new_literal($item[1]) } | ||||||||||
| 206 | | Number { $return = RDF::Query::Parser->new_literal($item[1], undef, ($item[1] =~ /[.]/ ? 'http://www.w3.org/2001/XMLSchema#float' : 'http://www.w3.org/2001/XMLSchema#integer')) } | ||||||||||
| 207 | Number: /([0-9]+(\.[0-9]+)?)/ { $return = $item[1] } | ||||||||||
| 208 | Text: dQText | sQText | Pattern { $return = $item[1] } | ||||||||||
| 209 | sQText: "'" /([^']+)/ '"' { $return = $item[2] } | ||||||||||
| 210 | dQText: '"' /([^"]+)/ '"' { $return = $item[2] } | ||||||||||
| 211 | Pattern: '/' /([^\/]+(?:\\.[^\/]*)*)/ '/' { $return = $item[2] } | ||||||||||
| 212 | END | ||||||||||
| 213 | } | ||||||||||
| 214 | |||||||||||
| 215 | ###################################################################### | ||||||||||
| 216 | |||||||||||
| 217 | =head1 METHODS | ||||||||||
| 218 | |||||||||||
| 219 | =over 4 | ||||||||||
| 220 | |||||||||||
| 221 | =item C<new ( $query_object ) > | ||||||||||
| 222 | |||||||||||
| 223 | Returns a new RDF::Query object. | ||||||||||
| 224 | |||||||||||
| 225 | =cut | ||||||||||
| 226 | |||||||||||
| 227 | 35 | { my $parser; | |||||||||
| 228 | 18 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 229 | 18 | my $class = shift; | |||||||||
| 230 | 18 | ▶ | unless ($parser) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 231 | 5 | $parser = new Parse::RecDescent ($RDQL_GRAMMAR); | |||||||||
| 232 | } | ||||||||||
| 233 | 18 | my $self = bless( { | |||||||||
| 234 | parser => $parser | ||||||||||
| 235 | }, $class ); | ||||||||||
| 236 | 18 | return $self; | |||||||||
| 237 | } } | ||||||||||
| 238 | |||||||||||
| 239 | =item C<parse ( $query ) > | ||||||||||
| 240 | |||||||||||
| 241 | Parses the supplied RDQL query string, returning a parse tree. | ||||||||||
| 242 | |||||||||||
| 243 | =cut | ||||||||||
| 244 | |||||||||||
| 245 | 35 | ▶ | sub parse { | ||||||||
|
Subroutine
parse: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 246 | 18 | my $self = shift; | |||||||||
| 247 | 18 | my $query = shift; | |||||||||
| 248 | 18 | my $parser = $self->parser; | |||||||||
| 249 | 18 | my $parsed = $parser->query( $query ); | |||||||||
| 250 | |||||||||||
| 251 | 18 | ▶ | if ($parsed) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 252 | 17 | my $pattern = $parsed->{triples}[0]; | |||||||||
| 253 | 17 | ▶ | if (blessed($pattern)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 254 | 17 | my $ns = $parsed->{namespaces}; | |||||||||
| 255 | 17 | $pattern = $self->_fixup_pattern( $pattern, $ns ); | |||||||||
| 256 | 17 | my $fixed = $pattern->qualify_uris( $ns ); | |||||||||
| 257 | 17 | $parsed->{triples}[0] = $fixed; | |||||||||
| 258 | } | ||||||||||
| 259 | 17 | $pattern = RDF::Query::Algebra::Project->new( $parsed->{triples}[0], $parsed->{variables} ); | |||||||||
| 260 | 17 | $parsed->{triples}[0] = $pattern; | |||||||||
| 261 | |||||||||||
| 262 | |||||||||||
| 263 | 17 | return $parsed; | |||||||||
| 264 | } else { | ||||||||||
| 265 | 1 | return $self->fail( "Failed to parse: '$query'" ); | |||||||||
| 266 | } | ||||||||||
| 267 | } | ||||||||||
| 268 | |||||||||||
| 269 | 17 | ▶ | sub _fixup_pattern { | ||||||||
|
Subroutine
_fixup_pattern: called CC=3 SCAR=11.0
| |||||||||||
| 270 | 17 | my $self = shift; | |||||||||
| 271 | 17 | my $pattern = shift; | |||||||||
| 272 | 17 | my $ns = shift; | |||||||||
| 273 | |||||||||||
| 274 | 17 | my @uris = $pattern->subpatterns_of_type('RDF::Query::Parser::RDQL::URI'); | |||||||||
| 275 | 17 | foreach my $u (@uris) { | |||||||||
| 276 | 27 | my $ns = $ns->{ $u->[0] }; | |||||||||
| 277 | 27 | my $uri = join('', $ns, $u->[1]); | |||||||||
| 278 | 27 | @{ $u } = ( 'URI', $uri ); | |||||||||
| 279 | 27 | bless($u, 'RDF::Query::Node::Resource'); # evil | |||||||||
| 280 | } | ||||||||||
| 281 | |||||||||||
| 282 | 17 | my @triples = $pattern->subpatterns_of_type('RDF::Query::Parser::RDQL::Triple'); | |||||||||
| 283 | 17 | foreach my $t (@triples) { | |||||||||
| 284 | 25 | bless($t, 'RDF::Query::Algebra::Triple'); # evil | |||||||||
| 285 | } | ||||||||||
| 286 | 17 | return $pattern; | |||||||||
| 287 | } | ||||||||||
| 288 | |||||||||||
| 289 | 23 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=4 SCAR=14.0
| |||||||||||
| 290 | 23 | my $self = $_[0]; | |||||||||
| 291 | 23 | ▶ | throw RDF::Query::Error::MethodInvocationError unless (blessed($self)); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 292 | |||||||||||
| 293 | 23 | my $class = ref($_[0]); | |||||||||
| 294 | 23 | our $AUTOLOAD; | |||||||||
| 295 | 23 | ▶ | return if ($AUTOLOAD =~ /DESTROY$/); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 296 | 5 | my $method = $AUTOLOAD; | |||||||||
| 297 | 5 | $method =~ s/^.*://; | |||||||||
| 298 | |||||||||||
| 299 | 5 | ▶ | if (exists($self->{ $method })) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 300 | 35 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 301 | 18 | ▶ | *$AUTOLOAD = sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 302 | 18 | my $self = shift; | |||||||||
| 303 | 18 | my $class = ref($self); | |||||||||
| 304 | 18 | return $self->{ $method }; | |||||||||
| 305 | 5 | }; | |||||||||
| 306 | 5 | goto &$method; | |||||||||
| 307 | } else { | ||||||||||
| 308 | 0 | throw RDF::Query::Error::MethodError ( -text => qq[Can't locate object method "$method" via package $class] ); | |||||||||
| 309 | } | ||||||||||
| 310 | } | ||||||||||
| 311 | |||||||||||
| 312 | |||||||||||
| 313 | package RDF::Query::Parser::RDQL::URI; | ||||||||||
| 314 | |||||||||||
| 315 | 35 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 316 | 35 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 317 | 35 | ▶ | use base qw(RDF::Query::Algebra); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 318 | |||||||||||
| 319 | 27 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||
| 320 | 27 | my $class = shift; | |||||||||
| 321 | 27 | my $data = shift; | |||||||||
| 322 | 27 | my ($ns, $local) = @{ $data }; | |||||||||
| 323 | 27 | return bless([$ns, $local], $class); | |||||||||
| 324 | } | ||||||||||
| 325 | |||||||||||
| 326 | 27 | ▶ | sub construct_args { | ||||||||
|
Subroutine
construct_args: called CC=1 SCAR=0.0
| |||||||||||
| 327 | 27 | my $self = shift; | |||||||||
| 328 | 27 | return [ @$self ]; | |||||||||
| 329 | } | ||||||||||
| 330 | |||||||||||
| 331 | package RDF::Query::Parser::RDQL::Triple; | ||||||||||
| 332 | |||||||||||
| 333 | 35 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 334 | 35 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 335 | 35 | ▶ | use base qw(RDF::Query::Algebra); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 336 | |||||||||||
| 337 | 25 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||
| 338 | 25 | my $class = shift; | |||||||||
| 339 | 25 | my @nodes = @_; | |||||||||
| 340 | 25 | return bless([@nodes], $class); | |||||||||
| 341 | } | ||||||||||
| 342 | |||||||||||
| 343 | 50 | ▶ | sub construct_args { | ||||||||
|
Subroutine
construct_args: called CC=1 SCAR=0.0
| |||||||||||
| 344 | 50 | my $self = shift; | |||||||||
| 345 | 50 | return @$self; | |||||||||
| 346 | } | ||||||||||
| 347 | |||||||||||
| 348 | 35 | 1; | |||||||||
| 349 | |||||||||||
| 350 | __END__ | ||||||||||