# An optional and an fixed pattern PREFIX : # This generates the right answer regardlesseh of planning order SELECT * WHERE { :x :p ?v . OPTIONAL {:y :q ?v } }