Change the RDF generation to do in blocks so memory does not grow too much