abstract query