# RE: Test cases

From: Geoff Chappell <geoff@sover.net>
Date: Sat, 11 Jun 2005 09:51:40 -0400
To: <andy.seaborne@hp.com>

Message-ID: <001a01c56e8c\$b2736170\$6501a8c0@gsclaptop>
```

> -----Original Message-----
> From: Seaborne, Andy [mailto:andy.seaborne@hp.com]
> Sent: Wednesday, June 08, 2005 8:24 AM
> To: Geoff Chappell
> Subject: Re: Test cases
>
>
>
> Geoff Chappell wrote:
> > OK, the first is the test OPTIONAL-FILTER.
> >
> Geoff,
>
> I agree with the rewriting in logical terms but I think it needs to take
> into
> account when variables are being bound.
>
> OPTIONAL
>          { ?book x:price ?price .
>            FILTER ?price < 15 .
>          } .
>
> means that the FILTER is applied when "?book x:price ?price" matches.
> When
> rewriting, that additional piece of information needs to be catered for as
> well.
>   I think this is covered by requiring S, a group solution, to be a
> solution of
> the OPTIONAL within the group.

But isn't it a solution? I get the interpretation you're shooting for, but I
don't see how you get there from your current definitions. Maybe I'm just
being dense -- if so can you point out why the following is not a solution:

?book=:book1
?title="TITLE 1"
?price=

For it to be a solution, it must be a solution to both parts of the group
pattern.

It's clearly a solution to the first since:

{:book1 dc:title "TITLE 1"}

is a subgraph of the dataset's default graph.

As for the second... isn't any substitution a solution of an optional
pattern? i.e. optional A is defined as A or not A - how can anything fail?
For that matter, why isn't:

?book=:book1
?title="TITLE 1"
?price=:book2

a valid solution? It seems like it should be by the current definitions but
it's not a solution we'd like to see (in the same sense that solutions
derived from treating optional A as A or true aren't really helpful).

So the question is what are valid substitutions (or how do you distinguish
between the valid, but unhelpful solutions)? The only scheme I've been able
to come up with is to convert the query to nnf and treat any variable not
mentioned in a basic pattern as unbound. But that gets me e.g. to the
solution I posted earlier that you disagree with (note that the result
really doesn't depend upon whether filter is treated as a distinct pattern
or as the rhs of a constrained pattern).

Best,

Geoff

```
Received on Saturday, 11 June 2005 13:51:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:06 UTC