PREFIX : SELECT ?a ?v ?w WHERE OPTIONAL (?a :q ?w) # Unfortunately, ?a is bound as we exit the optional # Optionals last in a group but then nesting (?a :p ?v)