Repository: RDFLib/rdflib

Issue:
Docstring for ClosedNamespace has a typo
The word "listen" is used instead of "listed".

Comments:

Patch:
diff --git a/docs/sphinx-requirements.txt b/docs/sphinx-requirements.txt
index cf0382e8..403eec52 100644
--- a/docs/sphinx-requirements.txt
+++ b/docs/sphinx-requirements.txt
@@ -1,3 +1,3 @@
-sphinx==3.5.3
+sphinx==3.5.4
 sphinxcontrib-apidoc
 git+https://github.com/gniezen/n3pygments.git
diff --git a/rdflib/namespace.py b/rdflib/namespace.py
index bdb0000a..3563b8c1 100644
--- a/rdflib/namespace.py
+++ b/rdflib/namespace.py
@@ -184,7 +184,7 @@ class ClosedNamespace(object):
     """
     A namespace with a closed list of members
 
-    Trying to create terms not listen is an error
+    Trying to create terms not listed is an error
     """
 
     def __init__(self, uri, terms):
@@ -897,7 +897,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 = ["\u00B7", "\u0387", "-", ".", "_", "%"]
+ALLOWED_NAME_CHARS = ["\u00B7", "\u0387", "-", ".", "_", "%", "(", ")"]
 
 
 # http://www.w3.org/TR/REC-xml-names/#NT-NCName


Test patch:
diff --git a/test/test_namespace.py b/test/test_namespace.py
index 5c73d223..3c321f8c 100644
--- a/test/test_namespace.py
+++ b/test/test_namespace.py
@@ -31,16 +31,24 @@ class NamespacePrefixTest(unittest.TestCase):
             g.compute_qname(URIRef("http://foo/bar/")),
             ("ns1", URIRef("http://foo/bar/"), ""),
         )
+
         # should compute qnames of URNs correctly as well
         self.assertEqual(
             g.compute_qname(URIRef("urn:ISSN:0167-6423")),
             ("ns5", URIRef("urn:ISSN:"), "0167-6423"),
         )
+
         self.assertEqual(
             g.compute_qname(URIRef("urn:ISSN:")),
             ("ns5", URIRef("urn:ISSN:"), ""),
         )
 
+        # should compute qnames with parenthesis correctly
+        self.assertEqual(
+            g.compute_qname(URIRef("http://foo/bar/name_with_(parenthesis)")),
+            ("ns1", URIRef("http://foo/bar/"), "name_with_(parenthesis)"),
+        )
+
     def test_reset(self):
         data = (
             "@prefix a: <http://example.org/a> .\n"
diff --git a/test/test_turtle_serialize.py b/test/test_turtle_serialize.py
index 3725bcd0..9e6f0b63 100644
--- a/test/test_turtle_serialize.py
+++ b/test/test_turtle_serialize.py
@@ -81,6 +81,7 @@ def test_turtle_namespace():
     graph.bind("RO", "http://purl.obolibrary.org/obo/RO_")
     graph.bind("RO_has_phenotype", "http://purl.obolibrary.org/obo/RO_0002200")
     graph.bind("SERIAL", "urn:ISSN:")
+    graph.bind("EX", "http://example.org/")
     graph.add(
         (
             URIRef("http://example.org"),
@@ -93,7 +94,13 @@ def test_turtle_namespace():
             URIRef("urn:ISSN:0167-6423"),
             RDFS.label,
             Literal("Science of Computer Programming"),
-
+        )
+    )
+    graph.add(
+        (
+            URIRef("http://example.org/name_with_(parenthesis)"),
+            RDFS.label,
+            Literal("URI with parenthesis"),
         )
     )
     output = [
@@ -105,6 +112,7 @@ def test_turtle_namespace():
     assert "RO_has_phenotype:" in output
     assert "GENO:0000385" in output
     assert "SERIAL:0167-6423" in output
+    assert "EX:name_with_(parenthesis)" in output
 
 
 if __name__ == "__main__":