A dQSQ query has the following format:
q@P(x) :- ancestor@P("Lois", x)
This query computes all the ancestors of "Lois", assuming the ancestor relation is defined on peer P, and that ancestor("a", "b") means that "a" is an ancestor of "b". The result of the query is added to relation q.
- q is the query name, which is actually a relation that accumules the query result.
- P is the name of the current peer.
- Constants should be quoted. ("Lois" in the above example.)
- The relation in the body of the query (ancestor in the above example) must be located on the current peer. A query such as q@P(x) :- parent@R("Lois", x) cannot be posed on peer P because the parent relation is located on peer R.