It wont make it quicker, but:

for t in graph:
        ...

looks nicer :)

- Gunnar

Matt Chaput wrote:
> Here's a little tip for anyone as newbie as me...
> 
> Serializing a database-backed store to XML is extremely slow because of 
> the vast number of SQL queries the serializer generates.
> 
> I find that if I copy the contents of the database store into an 
> in-memory store first, the serialization takes a couple of seconds 
> instead of several minutes. Of course, it doesn't help if you've got 
> billions of triples, but... if you don't, it's much faster.
> 
> I'm using "for t in graph.triples((None, None, None)):" to iter over 
> every triple in the source graph and adding t to the memory copy... I 
> wonder if there's a more efficient method...
> 
> Cheers,
> 
> Matt
> 
> 
> _______________________________________________
> Dev mailing list
> [email protected]
> http://rdflib.net/mailman/listinfo/dev

-- 
Gunnar Aastrand Grimnes
gunnar.grimnes [AT] dfki.de

DFKI GmbH
Knowledge Management
Erwin-Schroedinger-Strasse
D-67663 Kaiserslautern
Germany

Office: +49 631 205 3438
Mobile: +49 177 277 4397


_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev

Reply via email to