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
 
@@ -68,13 +68,16 @@ class CurrentStateGraphApi(object):
 
        Prefix URIRef like http://example.com/r- will return
 
        http://example.com/r-1 if that uri is not a subject in the graph,
 
        or else http://example.com/r-2, etc
 
        """
 
        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
 

	
 
        
 
def contextsForStatementNoWildcards(g, triple):
 
    if None in triple:
 
        raise NotImplementedError("no wildcards")
0 comments (0 inline, 0 general)