summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin van der Werff <martin.vanderwerff@tno.nl>2021-10-28 14:27:49 +0200
committerMartin van der Werff <martin.vanderwerff@tno.nl>2021-10-28 14:38:55 +0200
commit227ef70576f3d0d6d0e275ff96d33dfc7b67d7af (patch)
treed7173e77bb5d93ce7c558123ee63d6eec241b8ca
parentd9e86c932695d780bcdcdfadda150e4c1bcf72ef (diff)
downloadrdflib-227ef70576f3d0d6d0e275ff96d33dfc7b67d7af.tar.gz
Fix JSON-LD data import adds trailing slashes to IRIs (#1443)
In norm_url leave url alone if it already contains a scheme/protocol.
-rw-r--r--rdflib/plugins/shared/jsonld/util.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rdflib/plugins/shared/jsonld/util.py b/rdflib/plugins/shared/jsonld/util.py
index 49fbdab4..bd4c06aa 100644
--- a/rdflib/plugins/shared/jsonld/util.py
+++ b/rdflib/plugins/shared/jsonld/util.py
@@ -59,6 +59,8 @@ def norm_url(base, url):
>>> norm_url('http://example.org/', 'http://example.org//one')
'http://example.org//one'
"""
+ if "://" in url:
+ return url
parts = urlsplit(urljoin(base, url))
path = normpath(parts[2])
if sep != "/":