Check query context