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

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" .
```

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()

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose pytest
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
charset-normalizer==3.4.1
doctest-ignore-unicode==0.1.2
exceptiongroup==1.2.2
flake8==7.2.0
html5lib==1.1
idna==3.10
iniconfig==2.1.0
isodate==0.7.2
mccabe==0.7.0
nose==1.3.7
packaging==24.2
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.2
pyparsing==3.2.3
pytest==8.3.5
-e git+https://github.com/RDFLib/rdflib.git@a3245fb1fac921a5d8e07bce80914c42f5399b32#egg=rdflib
requests==2.32.3
six==1.17.0
tomli==2.2.1
urllib3==2.3.0
webencodings==0.5.1

name: rdflib
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - doctest-ignore-unicode==0.1.2
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - html5lib==1.1
      - idna==3.10
      - iniconfig==2.1.0
      - isodate==0.7.2
      - mccabe==0.7.0
      - nose==1.3.7
      - packaging==24.2
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.2
      - pyparsing==3.2.3
      - pytest==8.3.5
      - requests==2.32.3
      - six==1.17.0
      - tomli==2.2.1
      - urllib3==2.3.0
      - webencodings==0.5.1
prefix: /opt/conda/envs/rdflib

test/test_issue801.py::TestIssue801::test_issue_801
rdflib/namespace.py
rdflib/namespace.py