Add query fn, returns query string as map or lookup