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

update ipld spec with new link fmt #101

Merged
merged 2 commits into from
Jun 4, 2016
Merged

update ipld spec with new link fmt #101

merged 2 commits into from
Jun 4, 2016

Conversation

jbenet
Copy link
Member

@jbenet jbenet commented May 22, 2016

This changes the spec to update the link fmt. Please review it carefully and suggest changes. This was a great simplification. thanks everyone.

See:

@dignifiedquire
Copy link
Member

There is still a paragraph referencing @link:

As a consequence of using the @link path component to denote cross-object traversals, this becomes a reserved path component and makes it impossible to access arbitrary @link keys that are not otherwise merkle-links. Escaping can be used to render access to those keys possible if so desired.

@dignifiedquire
Copy link
Member

The section on Escaping Algorithm still refers to @link


If an application wants to use the `@link` key for other purposes, the application itself is responsible to escape the keys in the IPLD object so that the application keys do not conflict with the `@link` key. When discussing application specific paths, it may be worth escaping all keys starting with `@` in case future versions of IPLD make use of other keys.
**Object with pseudo "link object" at `files/cat.jpg` and actual link at `files/cat.jpg/link`**
Copy link
Member

@dignifiedquire dignifiedquire May 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be new to me and problematic when building it into the resolver. I was under the impression key like "link" would not have a special meaning, but with this you are effectively giving them one.
Also this seems ambiguous to me, consider this object:

{
  "files": {
    "cat.jpg": {
      "coolLink": {"/": "/ipfs/Qm..AAA"},
      "link": {"/": "/ipfs/QmBBB"},
      "mode": 0755
    }
  }
}

then how should files/cat.jpg be resolved? Objects are not inherently ordered in JavaScript so we can not guarantee the same resolution if we say first come, first serve.

Copy link
Member Author

@jbenet jbenet May 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dignifiedquire no, there's nothing special going on. the link keyword here is not special at all, it just shows how someone might model a data structure that requires associating properties with a link. Ex:

> ipld get .../files/cat.jpg
 {
  "coolLink": {"/": "/ipfs/Qm..AAA"},
  "link": {"/": "/ipfs/QmBBB"},
  "mode": 0755
}

> ipld get .../files/cat.jpg/coolLink/
<resolves through coolLink>

> ipld get .../files/cat.jpg/link/
<resolves through link>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay great, then I just misunderstood

@jbenet
Copy link
Member Author

jbenet commented May 22, 2016

@dignifiedquire thanks, removed those @link refs.

@jbenet jbenet merged commit 9b0fe3b into master Jun 4, 2016
@jbenet jbenet deleted the new-link-fmt branch June 4, 2016 00:31
@jbenet jbenet removed the status/in-progress In progress label Jun 4, 2016
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

Successfully merging this pull request may close these issues.

2 participants