Performance fix when using SPARQL repository, avoids re-querying many times.
Support instantiate when iterating over objects so to minimize round trips to
the database.