Added logging to RDFQuery. Regarding #886.