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

sample query involving disjunction

From: Rob Shearer <Rob.Shearer@networkinference.com>
Date: Fri, 17 Sep 2004 02:42:37 -0700
Message-ID: <CFE388CECDDB1E43AB1F60136BEB4973028155@rome.ad.networkinference.com>
To: <public-rdf-dawg@w3.org>

A user wishes to find all the people who are either of type dog owner or own a pet who is  a dog. (In the common case of no inferencing this is a pretty realistic  query.) Some sample data:

Rob type Person
Eddie type Person
Eddie type DogOwner
Mitch type Person
Mitch hasPet Fido
Fido type  Dog


select $x
where ($x type  Person)
      (($x type DogOwner) OR
       (($x hasPet $y) ($y type Dog))

Is this query correct?
Can it be easily re-written in terms of optionals, and is the result intuitive?
Received on Friday, 17 September 2004 09:46:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:00:45 UTC