summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshley Sommer <ashleysommer@gmail.com>2020-08-19 12:39:27 +1000
committerAshley Sommer <ashleysommer@gmail.com>2020-08-19 12:39:27 +1000
commitc0c6630c37fc20350f69452cf77fd5642a02e2da (patch)
tree0a4d8ad14fd114273660653a006a4c1decf926e9
parent714545f8fcaeab1012495b861c1edffb955c13dd (diff)
parent89cb369113a28a24d899e0a79123fd51fe6a8119 (diff)
downloadrdflib-c0c6630c37fc20350f69452cf77fd5642a02e2da.tar.gz
Merge branch 'master' into in_memory_store
-rw-r--r--docs/sphinx-requirements.txt2
-rw-r--r--examples/conjunctive_graphs.py2
-rw-r--r--rdflib/namespace.py2
-rw-r--r--test/test_issue801.py19
4 files changed, 22 insertions, 3 deletions
diff --git a/docs/sphinx-requirements.txt b/docs/sphinx-requirements.txt
index abed60cb..c6dfb112 100644
--- a/docs/sphinx-requirements.txt
+++ b/docs/sphinx-requirements.txt
@@ -1,3 +1,3 @@
-sphinx==3.0.4
+sphinx==3.2.0
sphinxcontrib-apidoc
git+https://github.com/gniezen/n3pygments.git
diff --git a/examples/conjunctive_graphs.py b/examples/conjunctive_graphs.py
index f714d9ff..a66a3aa8 100644
--- a/examples/conjunctive_graphs.py
+++ b/examples/conjunctive_graphs.py
@@ -33,7 +33,7 @@ if __name__ == "__main__":
gmary.add((mary, ns["hasName"], Literal("Mary")))
gmary.add((mary, ns["loves"], john))
- # add a graph for Mary's facts to the Conjunctive Graph
+ # add a graph for John's facts to the Conjunctive Graph
gjohn = Graph(store=store, identifier=cjohn)
# John's graph contains his cute name
gjohn.add((john, ns["hasCuteName"], Literal("Johnny Boy")))
diff --git a/rdflib/namespace.py b/rdflib/namespace.py
index 84cbe508..27f6d9ea 100644
--- a/rdflib/namespace.py
+++ b/rdflib/namespace.py
@@ -804,7 +804,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
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()