added query constructor which takes a uri