data consistency tests with UNSAID and OPTIONAL

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):

Data: a1 b c1. 
      c1 d e. 
      a2 b c2.
      c2 b f.

UNSAID Query: SELECT ?a ?c
              WHERE ?a b ?c
              UNSAID ?c d e

Result: a2, c2

OPTIONAL Query: SELECT ?a ?c
                WHERE ?a b ?c
                OPTIONAL ?c d e

Result: a1, c1
        a2, c2

The only way to do this is to ask for a variable in place of e and use
test if ?e is equal to the URI <e>.

OPTIONAL Query: SELECT ?a ?c ?e
                WHERE ?a b ?c
                OPTIONAL ?c d ?e
                AND ?e op:URIequals <e>
-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +1.857.222.5741 (does not work in Asia)

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Tuesday, 21 December 2004 15:21:36 UTC