Sawzall Language spec: http://szl.googlecode.com/svn/doc/sawzall-spec.html
You might also want to take a look at Cascalog. It offers a much nicer API — just list the various predicates and it'll take care of the rest for you, e.g. to find all the guys following Emily:
(follows "emily" ?person) (gender ?person "m")
http://nathanmarz.com/blog/introducing-cascalog-a-clojure-ba...