added a function to get the public query term object