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

Composability #93

Open
chrysn opened this issue Dec 6, 2024 · 1 comment
Open

Composability #93

chrysn opened this issue Dec 6, 2024 · 1 comment

Comments

@chrysn
Copy link
Member

chrysn commented Dec 6, 2024

We discussed composability of CRIs.

While there are dozens of ways to embed a URI in another URI, there's one straightforward way for CRIs:

For something that's vaguely URI template-ish http://compare-texts.example.com/{first}/{second}/?html:

[e'http', ["compare-texts", "example", "com"], [cri'urn:document1', cri'https://example.net/doc2'], ["html"]]

expands to

[e'http', ["compare-texts", "example", "com"], ["urn:document1", "https://example.net/doc2"], ["html"]]

or eventually

http://compare-texts.example.com/urn:document1/https:%2F%2Fexample.net%2Fdoc2/?html

(but can be well-usable in the top form)

Spinning off there, this would indicate that CRI templates are way easier to do – possibly with less flexibility thatn URI templates, but then also easier to use. A possible expression is using packed: [e'http', ["compare-texts", "example", "com"], [simple(0), simple(1)], ["html"]].

@chrysn
Copy link
Member Author

chrysn commented Dec 6, 2024

A caveat is that composability of this style only works when there are no constraints on the characters permissible in a component, and there is no normalization on that component.

Personally I'd love if there was a straightforward way to put a URI into the authority component (no matter whether inner URI is than a DID, a nih or any other identifier), but those strings are subject to lowercasing, can't have inner dots (not sure about other characters) and (in some implementations) severe length limits.

Also, this doesn't work easily for the fragment (like I've used in single page web apps): only one string can be expanded into that.

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

1 participant