Performance fix when using SPARQL repository, avoids re-querying many times.