Repository: RDFLib/rdflib

Issue:
Problem with prefixes created for URIs containing %20
The result of runnig this code
```python
from rdflib import Namespace, Graph, BNode, Literal

graph = Graph()
namespace = Namespace('http://example.org/')
graph.bind('', namespace)
node = BNode()

graph.add((node, namespace['first%20name'], Literal('John')))
print(graph.serialize(format='turtle').decode())
```
is
```
@prefix : <http://example.org/> .
@prefix ns1: <http://example.org/first%20> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[] ns1:name "John" .
```
I expect that triple would be displayed as 
```
[] :first%20name "John" .
```


Discussion:

Patch:
diff --git a/rdflib/namespace.py b/rdflib/namespace.py
index 78f71c22..9f09763c 100644
--- a/rdflib/namespace.py
+++ b/rdflib/namespace.py
@@ -618,7 +618,7 @@ class NamespaceManager(object):
 NAME_START_CATEGORIES = ["Ll", "Lu", "Lo", "Lt", "Nl"]
 SPLIT_START_CATEGORIES = NAME_START_CATEGORIES + ['Nd']
 NAME_CATEGORIES = NAME_START_CATEGORIES + ["Mc", "Me", "Mn", "Lm", "Nd"]
-ALLOWED_NAME_CHARS = [u"\u00B7", u"\u0387", u"-", u".", u"_", u":"]
+ALLOWED_NAME_CHARS = [u"\u00B7", u"\u0387", u"-", u".", u"_", u":", u"%"]
 
 
 # http://www.w3.org/TR/REC-xml-names/#NT-NCName


Test patch:
diff --git a/test/test_issue801.py b/test/test_issue801.py
new file mode 100644
index 00000000..ae27f346
--- /dev/null
+++ b/test/test_issue801.py
@@ -0,0 +1,19 @@
+"""
+Issue 801 - Problem with prefixes created for URIs containing %20
+"""
+from rdflib import Namespace, Graph, BNode, Literal
+import unittest
+
+class TestIssue801(unittest.TestCase):
+
+    def test_issue_801(self):
+        g = Graph()
+        example = Namespace('http://example.org/')
+        g.bind('', example)
+        node = BNode()
+        g.add((node, example['first%20name'], Literal('John')))
+        self.assertEqual(g.serialize(format="turtle").decode().split("\n")[-3],
+                '[] :first%20name "John" .')
+
+if __name__ == "__main__":
+    unittest.main()