kasei / perlrdf

Deprecated in favor of the Attean package
26 stars 25 forks source link

can't generate execution plan for optional property named 'aggregate' #101

Closed jbenton-adc closed 10 years ago

jbenton-adc commented 10 years ago

data:

@prefix :       <http://www.example.com/ns/test#> .
@prefix ex:     <http://www.example.com/ns#> .

:s ex:aggregate "var1" .

failing query:

PREFIX ex: <http://www.example.com/ns#>

SELECT ?a 
WHERE {
   OPTIONAL { ?s ex:aggregate ?a } 
}

error message: Query didn't produce a valid execution plan

script:

use RDF::Trine;
use RDF::Trine::Parser;
use RDF::Query;
use Path::Class;
use URI::file;

my $dataFile      = file(shift);
my $queryFile      = file(shift);

my $manifestUri = URI::file->new_abs("$dataFile");
my $model       = RDF::Trine::Model->temporary_model;
RDF::Trine::Parser->parse_url_into_model( $manifestUri, $model, canonicalize => 1 ); 

my $queryStr = $queryFile->slurp(); 

my $query = RDF::Query->new($queryStr);
my $qss   = $query->execute($model);
$query = undef;
while($qs = $qss->next()) {
   foreach my $varName (sort keys %{$qs}) {
      printf("%s : %s\n", $varName, ((defined $qs->{$varName}) ? $qs->{$varName}->value : "undef"));
   }
   print "\n";
}

If I change 'aggregate' to 'aggregat' then the query works.

kasei commented 10 years ago

What a strange bug! I can confirm it locally and am looking into it. Thanks.

kasei commented 10 years ago

I believe commit ae3f558 should fix the problem. Can you confirm that?

jbenton-adc commented 10 years ago

I will give it a try and let you know how it works.

From: Gregory Todd Williams [mailto:notifications@github.com] Sent: Thursday, April 03, 2014 1:15 PM To: kasei/perlrdf Cc: Jeff Benton Subject: Re: [perlrdf] can't generate execution plan for optional property named 'aggregate' (#101)

I believe commit ae3f558https://github.com/kasei/perlrdf/commit/ae3f558 should fix the problem. Can you confirm that?

— Reply to this email directly or view it on GitHubhttps://github.com/kasei/perlrdf/issues/101#issuecomment-39485520.

jbenton-adc commented 10 years ago

I have confirmed that fixes the problem.

From: Gregory Todd Williams [mailto:notifications@github.com] Sent: Thursday, April 03, 2014 1:15 PM To: kasei/perlrdf Cc: Jeff Benton Subject: Re: [perlrdf] can't generate execution plan for optional property named 'aggregate' (#101)

I believe commit ae3f558https://github.com/kasei/perlrdf/commit/ae3f558 should fix the problem. Can you confirm that?

— Reply to this email directly or view it on GitHubhttps://github.com/kasei/perlrdf/issues/101#issuecomment-39485520.

kasei commented 10 years ago

Thanks. The change will be included in the next release.