Fixed select class query to work with OpenRDF