Generate and append query from data keys that don't appear as path segments.