From 03efa9b9dee02564f464c4132fdcf848a242ad53 Mon Sep 17 00:00:00 2001 From: Rick Moynihan Date: Wed, 16 Feb 2022 16:10:34 +0000 Subject: [PATCH] Fix #68 and support use of opaque base uris e.g. this is neccessary to support working with csvw inside a zip file jar:file:///some/path.zip!/inside/zip/metadata.json Though that usecase also requires some additional extensions to csv2rdf protocols. --- src/csv2rdf/util.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/csv2rdf/util.clj b/src/csv2rdf/util.clj index 3e9ad31..cdd8893 100644 --- a/src/csv2rdf/util.clj +++ b/src/csv2rdf/util.clj @@ -17,7 +17,9 @@ (defn set-fragment "Sets the fragment on a URI to the given value." [^URI uri fragment] - (URI. (.getScheme uri) (.getUserInfo uri) (.getHost uri) (.getPort uri) (.getPath uri) (.getQuery uri) fragment)) + (if (.isOpaque uri) + (URI. (.getScheme uri) (.getSchemeSpecificPart uri) fragment) + (URI. (.getScheme uri) (.getUserInfo uri) (.getHost uri) (.getPort uri) (.getPath uri) (.getQuery uri) fragment))) (defn remove-fragment "Sets the fragment on a URI to nil."