Changeset - e05656f00070
[Not reviewed]
default
0 1 0
Drew Perttula - 8 years ago 2017-05-24 08:29:01
drewp@bigasterisk.com
rdfdb graph.sequentialUri won't reuse ids even if you haven't used them in stmts yet
Ignore-this: cb556ba9836041ef1ba7778081ced7a1
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/rdfdb/currentstategraphapi.py
Show inline comments
 
@@ -71,7 +71,10 @@ class CurrentStateGraphApi(object):
 
        """
 
        for i in itertools.count(1):
 
            newUri = prefix + str(i)
 
            if not list(self._graph.triples((newUri, None, None))):
 
            if not list(self._graph.triples((newUri, None, None))) and newUri not in getattr(self, '_reservedSequentials', []):
 
                if not hasattr(self, '_reservedSequentials'):
 
                    self._reservedSequentials = set()
 
                self._reservedSequentials.add(newUri)
 
                return newUri
 

	
 
        
0 comments (0 inline, 0 general)