Optimize ReadGraph.hasStatements(s,p) to not use getObjects(s,p)