Skip to content

Commit

Permalink
Fix #68 and support use of opaque base uris
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RickMoynihan committed Feb 16, 2022
1 parent ed51193 commit 03efa9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/csv2rdf/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 03efa9b

Please sign in to comment.