diff options
author | Amade Nemes <nemesamade@gmail.com> | 2021-03-08 14:16:03 +0100 |
---|---|---|
committer | Amade Nemes <nemesamade@gmail.com> | 2021-03-08 14:16:03 +0100 |
commit | 7cdd668607f70f3aa848d6087b0b826355c91bc1 (patch) | |
tree | 107f7fbd436a9848f1cc7cb4af4fb4ea8697f5aa | |
parent | 843be477c77ea91e07eeaff12ed46e031e310b1e (diff) | |
download | rdflib-7cdd668607f70f3aa848d6087b0b826355c91bc1.tar.gz |
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 https://github.com/RDFLib/rdflib/pull/663 , so as far as I can tell there really is no reason for colon to be included)
-rw-r--r-- | rdflib/namespace.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rdflib/namespace.py b/rdflib/namespace.py index 8228a0e0..bdb0000a 100644 --- a/rdflib/namespace.py +++ b/rdflib/namespace.py @@ -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 @@ -914,7 +914,7 @@ def is_ncname(name): for i in range(1, len(name)): c = name[i] if not category(c) in NAME_CATEGORIES: - if c != ":" and c in ALLOWED_NAME_CHARS: + if c in ALLOWED_NAME_CHARS: continue return 0 # if in compatibility area |