next up previous contents
Next: Direct property Up: Body Previous: Non oriented Path   Contents

Boolean expression

By default, a list of triples is a conjunction. The OR and AND operators are also available and parenthesis enable to combine conjunctions and disjunctions in a query.

The syntax of boolean OR is the following :

?x rdf:type c:Organisation
or
?x rdf:type c:Person

Parenthesis can be used to delimit subexpressions :

?doc c:author ?x
(?x rdf:type c:Organisation
 or
?x rdf:type c:Person)

AND has precedence on OR.

Example :

A B or C D <=> (A and B) or (C and D)

As the query processor is the conceptual graphs projection (without or), we generate several queries by distributing OR over AND to produce the disjunctive normal form. All the queries are processed by projection and the final result is the union of all the results.

For example :

A (B or C)  -> 

  A and B
or
  A and C



Olivier Corby 2005-07-01