Generating query substitutions | Synapse