When computing qnames, reuse namespace bindings

diff -r dddade57adcb rdflib/syntax/NamespaceManager.py
--- a/rdflib/syntax/NamespaceManager.py	Wed Jul 04 10:06:21 2007 +0200
+++ b/rdflib/syntax/NamespaceManager.py	Wed Jul 04 10:18:59 2007 +0200
@@ -59,7 +59,10 @@ class NamespaceManager(object):
             namespace = URIRef(namespace)
             prefix = self.store.prefix(namespace)
             if prefix is None:
-                prefix = "_%s" % len(list(self.store.namespaces()))
+                namespaces = dict([(unicode(n), p) for p, n in self.namespaces()])
+                try: prefix = namespaces[namespace]
+                except KeyError:
+                    prefix = "_%s" % len(list(self.store.namespaces()))
                 self.bind(prefix, namespace)
             self.__cache[uri] = (prefix, namespace, name)
         return self.__cache[uri]
