Write triples directly to file instead of going through rdflib. This avoids storing entire graph in memory.