sample query involving disjunction

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

query

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