Re: data consistency tests with UNSAID and OPTIONAL

On Tue, Dec 21, 2004 at 10:21:36AM -0500, Eric Prud'hommeaux wrote:
> 2004-12-21T14:56:01Z <SimonR> EricP suggests that constraint-checking
> 			      is a need for UNSAID; SteveH says this
> 			      can be done with OPTIONAL.
> 2004-12-21T14:56:55Z <ericP> s/constraint-checking/consistency checking/
> Persuant to that I dreamed up a quick screw case (actually, it was the
> first case I thought of):

To clarify, I was thinking of the particular case Eric mentioned (finding
people without a known email address IIRC), which can be dome with
something like:

	SELECT ?person
	WHERE [ (?person :email ?email) ]
	AND !dawg:bound(?email)

The UNSAID version would be

	SELECT ?person
	WHERE UNSAID (?person :email ?email)

This is a question I've seen (find instances with no known value for some
property), and as its handled ala optionals commonly in SQL, e.g.

	SELECT People.person
	FROM People LEFT JOIN Email ON People.person = Email.person
	WHERE Email.address IS NULL

I think this is reasonable. There are nasty cases like "find all the
people with exactly one known email address", but those aren't any more
pleasent with UNSAID:

	SELECT ?person
	WHERE (?person :email ?e1)
	      UNSAID (?person :email ?e2)
	AND ?e1 != ?e2

If its even valid. Yuk.

- Steve

Received on Tuesday, 21 December 2004 16:04:10 UTC