Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uri.relativize #466

Open
bblfish opened this issue Sep 18, 2022 · 2 comments
Open

Uri.relativize #466

bblfish opened this issue Sep 18, 2022 · 2 comments
Assignees

Comments

@bblfish
Copy link

bblfish commented Sep 18, 2022

Description
The equivalent of java.net.URI.relativize(uri: URI)

It should work with relative URLs applied to relative URLs as well as absolute Urls applied to absolute ones.

Url("https://bblfish.net/people/")
     .relativize("https://bblfish.net/people/henry/card#me") 
     == Url("henry/card#me")

There could also be a slightly more advanced version that could follow through parent hierarchies, perhaps something like

Url("https://bblfish.net/people/henry/")
     .relativize2("https://bblfish.net/people/tini/pix/cat.jpg") 
     == Url("../henry/pix/cat.jpg")
@bblfish
Copy link
Author

bblfish commented Sep 21, 2022

Note: I have a PR that builds on lemon labs URI and test suites here. (Btw. Java URL normalization don't replace default ports I noticed...)

https://github.com/banana-rdf/banana-rdf/pull/379/files#diff-9ab8031fc5aa2672acd07b807d370de6760feeef2b23864f63e10c8de8365c40

@bblfish bblfish closed this as completed Sep 21, 2022
@bblfish
Copy link
Author

bblfish commented Sep 21, 2022

Oops, I don't know why I closed this...

@bblfish bblfish reopened this Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants