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
Specify pathing into a CID vs to a CID #250
Comments
2022-11-22 triage conversation:
|
2022-11-29 triage conversation:
|
@alanshaw raised a different problem with paths and links that we should roll up into a pathing spec:
How do I path to "Hello World!" from "bafyreidb7fynlo5246wst4tyl3wucfoskujuuq4523srgc73c6xlvnah2i"?
I think this is a case of not having a path "spec" meaning we have edge cases that are neither specified nor implemented for. We also have behaviours different between JS and Go around these edges (and likely Rust too soon). So a spec should clear it up. Backward compatibility will be a challenge though, but maybe we solve that by saying there is "unixfs pathing" and "ipld pathing" which have slightly different semantics. |
I still kinda like how |
@aschmahmann wondering if you have any input on this? We're considering working this into a spec change but you're likely to have opinions that would be useful input. |
Thanks @rvagg for the tag. My main 2c here is that this seems clever, but that while clever can be good it can also end up as a source of confusion for people. For the sake of comparison, given that for IPLD paths we need some "escaping" to deal with things like ADLs/lenses, (byte) ranges, unfriendly characters, etc. what's the advantage of having To some extent this is stylistic would we prefer elegant but perhaps confusing vs a more brute approach? Perhaps with the right error messages and UX in tooling elegant is ok, but sometimes the brute way is the way to go. |
I'm not sure what to think about blocks that are only links. I could see defining The only uses I can think of off the top of my head are:
|
2023-01-24 maintainer conversation: |
Right now when you have a structure like
{foo: Link}
Pathing into it with/foo
could either mean "get the value at foo (the link)" or "get the data pointed at by foo".I think we should standardize around using
/foo
to mean "get the link" and/foo/
to mean "traverse into the link".This applies to IPLD Patch, to IPLD URLs, and to traversal in general.
One question this raises is what to do when
foo
isn't a Link and someone tries to do/foo/
.Another question is how this would look when translated into path segments. Would it result in a path segment that's an empty string?
cc @rvagg on thoughts. Might be useful to formalize somewhere and make sure the JS and Go (and Rust) implementations are aligned.
The text was updated successfully, but these errors were encountered: