Hello Mikael.

On 9/27/06, Mikael Högqvist <[EMAIL PROTECTED]> wrote:
> Hi,
> I have been playing around with filter in SPARQL and found a small bug
> in sparql-p. A test case is attached.
> I looked at sparql.py and found that in SPARLQ.queryObject() the
> algorithm expands the top-level patterns first and applies the global
> constraints (in this case BOUND(?date)) on the respective result
> nodes. After that, the optional patterns are expanded on the bindings
> from each top-level pattern. But, since here the constraint says that
> ?date must be bound, the optional patterns are never expanded
> (self.clash == True for both result nodes). The BOUND constraint
> should be applied after the OPTIONAL clause. Please let me know if
> anyone has an idea how to fix this?

I've been working in this part of the implementation for some time to
figure out what exactly it's doing wrong in evaluating global
constraints in combination with OPTIONAL constraints.  Unfortunately,
Ivan is really the only person with a direct  insight (I've CC'd him -
though I know he's rather busy), however I think you are on the right
track.

With regards to your question, I think (not really having looked at
that code in a few weeks) that main problem is that the sparql-p
expansion tree applies it's constraints as it expands the tree, so in
order to apply the bound constraint after the OPTIONAL clause, you
would have to apply the global constraints after expansion.  The
downside is that you will have a larger dataset to apply the
constraints over and the expansion will include much more of the
dataset.

Just some thoughts..

>
> Cheers,
> Mikael
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://rdflib.net/mailman/listinfo/dev
>
>
>
>

_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev

Reply via email to