[Mulgara-general] SPARQL question

Paul Gearon gearon at ieee.org
Tue Dec 2 01:51:16 UTC 2008


On Mon, Dec 1, 2008 at 5:40 PM, Alex Hall <alexhall at revelytix.com> wrote:
> Paul Gearon wrote:
> I took a quick look at this.  The problem appears to be that the
> TuplesContext.isBound() method, used to evaluate the FILTER(!isBound), calls
> LeftJoin.getRawColumnValue().  This method bypasses the evaluation of the inner
> FILTER ( (?sup != owl:Thing) && (?sup != rdfs:Class) ), which is only done in
> LeftJoin.getColumnValue().  It seems that the solution would be to change
> isBount() to test the "filtered" column value, but I'm not very familiar with
> that part of the code.

OK, I'll need to get my head into this space again to follow it.  :-}
Thanks for chasing it down though.

> In a more general sense, I don't really understand the difference between "raw"
> and "filtered" column values.  It seems that filtering should be applied on a
> row-by-row basis, not a column-by-column basis.  LeftJoin appears to be the only
> class that is evaluating these differently.  I would think that if the
> right-hand side of an optional join is filtered out in normal evaluation, then
> it's not valid for filters outside the join to ever access the values that it
> would have been bound to.  Paul, am I incorrect?  My instinct is that the inner
> filter should be pushed down into the right-hand-side of the optional join, not
> evaluated as part of the join itself.

Ah, you'd THINK that, wouldn't you?  That's what *I* thought as well.
However, read:
  http://www.w3.org/TR/rdf-sparql-query/#convertGraphPattern
This describes the transformation sequence needed to evaluate SPARQL.
Initially I thought I could use the TQL query engine as it was, but it
kept missing corner cases. It wasn't until I followed this
transformation sequence carefully (including filtered joins) that it
all started to come together.  I thought I could make the filter a
wrapper around the join, but the semantics are a little different.

This isn't to say that I got the implementation right, but the
operation itself is required.

Paul



More information about the Mulgara-general mailing list