Share

RAP - RDF API for PHP

Tracker: Bugs

5 SPARQL Bug Joining Optional Results - ID: 1928579
Last Update: Comment added ( sergeyche )

In SparqlEngine.php function joinOptionalTuples, the initial logic testing
for one or more empty result sets seems wrong:

if(!$finalRes && !$res)
return array();

if(!$finalRes)
return $res;

if(!$res)
return $finalRes;

So for an optional join (where the optional results are passed in as
$finalRes), if there are no results from the left graph (in which case
there should be no optional results added), the entire optional result set
is instead returned.

Unless I'm misunderstanding something, this should read instead:

if(!$finalRes && !$res)
return array();

if(!$finalRes || !$res)
return $res;


Will Daniels ( wdaniels ) - 2008-03-29 10:45

5

Open

None

Nobody/Anonymous

SPARQL

Current SVN

Public


Comments ( 2 )




Date: 2008-08-15 17:01
Sender: sergeyche


Yes, I have the same issue. Your fix seemed to solve the problem.

I've submitted a patch - maybe it'll speed-up the process:
http://sourceforge.net/tracker/index.php?func=detail&aid=2053455&group_id=63257&atid=503363


Date: 2008-05-14 17:16
Sender: tomheath


Definitely a big with the handling of OPTIONALs - this fix seems to work
for me but haven't tested extensively.


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.