W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > June 2005

Re: Test cases

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Wed, 15 Jun 2005 16:32:15 +0100
Message-ID: <42B049FF.50509@hp.com>
To: Geoff Chappell <geoff@sover.net>
CC: public-rdf-dawg-comments@w3.org


Let me reduce this to a simple test case to see if we are have the same
understanding of the problem:

:book :title "Title" .

       OPTIONAL { :book :title ?x }

in other words, a single optional.

Solutions: (desired)
?x = "Title"

The issue as I see it is why isn't
?x = "Junk"

a solution as well because ?x="Junk" is a solution to OPTIONAL(P).

[[Related, but different, is that any solution can be extended with other,
unrelated bindings of variables without afecting the matching.  This is a result
of the pattern composition - subpatterns may not involve all variables.]]


Geoff Chappell wrote:
>>-----Original Message-----
>>From: Seaborne, Andy [mailto:andy.seaborne@hp.com]
>>Sent: Wednesday, June 08, 2005 8:24 AM
>>To: Geoff Chappell
>>Cc: public-rdf-dawg-comments@w3.org
>>Subject: Re: Test cases
>>Geoff Chappell wrote:
>>>OK, the first is the test OPTIONAL-FILTER.
>>I agree with the rewriting in logical terms but I think it needs to take
>>account when variables are being bound.
>>         { ?book x:price ?price .
>>           FILTER ?price < 15 .
>>         } .
>>means that the FILTER is applied when "?book x:price ?price" matches.
>>rewriting, that additional piece of information needs to be catered for as
>>  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 Wednesday, 15 June 2005 15:32:25 UTC

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