W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2004

Test cases for disjunction discussion from f2f3 bristol

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Date: Fri, 17 Sep 2004 10:18:20 +0100 (BST)
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-ID: <Pine.LNX.4.58.0409171017300.14699@hoth.ilrt.bris.ac.uk>

Test Data
  @prefix ex: <http://example.org/ns#>
  @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  ex:ABC ex:ABC ex:ABC .
  ex:ABC rdf:type ex:Engineer .

Queries

1.  Disjunction
SELECT *
WHERE
  (?person rdf:type ex:Engineer) OR 
  (?person rdf:type ex:Manager)

=>
  ?person
  <http://example.org/ns#ABC>

2. Using optionals instead
SELECT *
WHERE
  OPTIONAL (?person rdf:type ex:Engineer)
  OPTIONAL (?person rdf:type ex:Manager)

=>
  ?person
  <http://example.org/ns#ABC>

3. Value Disjunction
SELECT *
WHERE
  (?person rdf:type ?person)
AND 
  (?person = ex:Engineer) OR (?person = ex:Manager)

=>
  ?person
  <http://example.org/ns#ABC>

4. Want at least one of them with the constraint

ASK
  OPTIONAL (?person rdf:type ex:Engineer)
  OPTIONAL (?person rdf:type ex:Manager)
  (?person ex:age ?age)
AND
  ?age >20

=>
  YES

5. Re-expression of 4 using value disjunction
ASK
  (?person ex:age ?age)
  (?person rdf:type ?type)
AND
  (?type = ex:Engineer OR ?type = ex:Manager) AND
  ?age > 20

=>
  YES


6. What does this mean?
SELECT ?x
WHERE
  OPTIONAL (?x ?x ?x)

=>
  ?x
  <http://example.org/ns#ABC>
(says AndyS)
Received on Friday, 17 September 2004 09:18:56 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:20 GMT