Skip to content

Commit 7cdd668

Browse files
committed
Removed colon from ALLOWED_NAME_CHARS as including it resulted in URN identifiers not getting split at all and thus leading to compute_qname being unable to compute the qnames of URNs. This change did not break any current tests, and allowed the previously added 2 tests to pass (note: as a quick fix is_cname already excludes colon from ALLOWED_NAME_CHARS as it causes issues there too #663 , so as far as I can tell there really is no reason for colon to be included)
1 parent 843be47 commit 7cdd668

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rdflib/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ def absolutize(self, uri, defrag=1):
897897
NAME_START_CATEGORIES = ["Ll", "Lu", "Lo", "Lt", "Nl"]
898898
SPLIT_START_CATEGORIES = NAME_START_CATEGORIES + ["Nd"]
899899
NAME_CATEGORIES = NAME_START_CATEGORIES + ["Mc", "Me", "Mn", "Lm", "Nd"]
900-
ALLOWED_NAME_CHARS = ["\u00B7", "\u0387", "-", ".", "_", ":", "%"]
900+
ALLOWED_NAME_CHARS = ["\u00B7", "\u0387", "-", ".", "_", "%"]
901901

902902

903903
# http://www.w3.org/TR/REC-xml-names/#NT-NCName
@@ -914,7 +914,7 @@ def is_ncname(name):
914914
for i in range(1, len(name)):
915915
c = name[i]
916916
if not category(c) in NAME_CATEGORIES:
917-
if c != ":" and c in ALLOWED_NAME_CHARS:
917+
if c in ALLOWED_NAME_CHARS:
918918
continue
919919
return 0
920920
# if in compatibility area

0 commit comments

Comments
 (0)