Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into issue_rdflib-json…
Browse files Browse the repository at this point in the history
…ld_85
  • Loading branch information
datadavev committed Aug 9, 2020
2 parents 0a2b4fc + c050f27 commit c75d181
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/sphinx-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==3.0.4
sphinx==3.1.2
sphinxcontrib-apidoc
git+https://github.com/gniezen/n3pygments.git
2 changes: 1 addition & 1 deletion examples/conjunctive_graphs.py
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
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")))
6 changes: 3 additions & 3 deletions rdflib/namespace.py
Original file line number Diff line number Diff line change
@@ -489,8 +489,8 @@ def term(self, name):
"relatedMatch",
],
)
SOSA = Namespace("http://www.w3.org/ns/ssn/")
SSN = Namespace("http://www.w3.org/ns/sosa/")
SSN = Namespace("http://www.w3.org/ns/ssn/")
SOSA = Namespace("http://www.w3.org/ns/sosa/")
TIME = Namespace("http://www.w3.org/2006/time#")
VOID = Namespace("http://rdfs.org/ns/void#")
XMLNS = Namespace("http://www.w3.org/XML/1998/namespace")
@@ -804,7 +804,7 @@ def absolutize(self, uri, defrag=1):
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
19 changes: 19 additions & 0 deletions test/test_issue801.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit c75d181

Please sign in to comment.