fixed query for compatibility with sesame 2.6.9
adapted to work with sesame 2.6.9