# HG changeset patch # User Drew Perttula # Date 2017-05-24 08:29:01 # Node ID e05656f000703bc1a50ac3bdefbd10b0456bf9fd # Parent e993c5e1df1a27a16927c4e02fa36e660d1227d0 rdfdb graph.sequentialUri won't reuse ids even if you haven't used them in stmts yet Ignore-this: cb556ba9836041ef1ba7778081ced7a1 diff --git a/light9/rdfdb/currentstategraphapi.py b/light9/rdfdb/currentstategraphapi.py --- a/light9/rdfdb/currentstategraphapi.py +++ b/light9/rdfdb/currentstategraphapi.py @@ -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