Changeset - 7b43bfa018bf
[Not reviewed]
default
0 1 0
Drew Perttula - 9 years ago 2016-01-26 11:37:54
drewp@bigasterisk.com
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/rdfdb/rdflibpatch.py
Show inline comments
 
@@ -56,18 +56,18 @@ def inGraph(spoc, graph):
 
    spoi = spoc[:3] + (Graph(identifier=spoc[3]),)
 
    if spoi not in graph:
 
        # this is a huge speedup, avoid many whole-graph scans
 
        return False
 
    return spoi in graph.quads()
 

	
 

	
 
# some of the following workarounds may be fixed in https://github.com/RDFLib/rdflib/issues/299
 
def graphFromQuads(q):
 
    g = ConjunctiveGraph()
 
    #g.addN(q) # no effect on nquad output
 
    for s,p,o,c in q:
 
        #g.get_context(c).add((s,p,o)) # kind of works with broken rdflib nquad serializer code
 
        #g.get_context(c).add((s,p,o)) # kind of works with broken rdflib nquad serializer code; you need this for json_ld serialize to work :(
 
        g.store.add((s,p,o), c) # no effect on nquad output
 
    return g
 

	
 
def graphFromNQuad(text):
 
    g1 = ConjunctiveGraph()
 
    g1.parse(data=text, format='nquads')
0 comments (0 inline, 0 general)