Algae - logic-enabled query processor


(ask '(
  (http://...#ancestor ?person ?ancestor)
):collect '(?person ?ancestor)) 

returns all statements (triples) in the database where http://...#ancestor is the predicate;

from the previous example, returns both billy and pa statements.

(ask '(
  (http://...#ancestor http://...#billy ?ancestor)
):collect '(?ancestor)) 

returns only 'pa'.

(namespace '(g http://.../genealogy#)
 fwrule (head '((g::ancestor ?a ?b)
                (g::ancestor ?b ?c))
         body '((g::ancestor ?a ?c)))

 ask '(
  (http://...#ancestor http://...#billy ?ancestor)
):collect '(?ancestor))

returns both 'pa' and 'grandpa'.