 ( aql-query
   ( select "label1" ( function "to-upper" string (property string "root" subject) ) )
   ( select "label4" ( function "concatenate" string) )
   ( select "label2" ( property any "root" object ) )
   ( select "label3" ( property any "root" predicate ) )
   ( criterion ( comp-eq ( property string "root" subject ) ( literal string "xyzzyz\n\"" ) ) ) 
   ( criterion ( or ( and )
                    (comp-ne ( property string "root" subject ) ( literal string "xyzzy'za\n\"" ) )
                    ( comp-eq ( property string "root" object ) ( literal string "x2" ) )
                    ( comp-eq ( property string "root" subject ) ( literal string "x3" ) ) )) 
   ( join left "optional1" ( comp-eq ( property any "root" object ) (property any "optional1" subject ) ) )
   ( join inner "optional2" ( comp-eq ( property reference "root" object ) (property reference "optional2" subject ) ) )

) 
