Changeset - 5945e32d992d
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 12 years ago 2013-06-16 06:48:37
drewp@bigasterisk.com
making json patch representation speedup from like 2500ms to 350ms
Ignore-this: 49fcb5698c6c505dcb73fca55880c239
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/rdfdb/rdflibpatch.py
Show inline comments
 
@@ -64,7 +64,7 @@ def graphFromNQuad(text):
 
from rdflib.plugins.serializers.nt import _xmlcharref_encode
 
def serializeQuad(g):
 
    """replacement for graph.serialize(format='nquads')"""
 
    out = ""
 
    out = []
 
    for s,p,o,c in g.quads((None,None,None)):
 
        if isinstance(c, Graph):
 
            # still not sure why this is Graph sometimes,
 
@@ -72,11 +72,11 @@ def serializeQuad(g):
 
            c = c.identifier
 
        if '[' in c.n3():
 
            import ipdb;ipdb.set_trace()
 
        out += u"%s %s %s %s .\n" % (s.n3(),
 
        out.append(u"%s %s %s %s .\n" % (s.n3(),
 
                                     p.n3(),
 
                                     _xmlcharref_encode(o.n3()),
 
                                     c.n3())
 
    return out
 
                                     c.n3()))
 
    return ''.join(out)
 

	
 
def inContext(graph, newContext):
 
    """
0 comments (0 inline, 0 general)