Skip to content

Instantly share code, notes, and snippets.

@pfrazee
Last active April 19, 2018 20:39
Show Gist options
  • Save pfrazee/f6030e59d335e73a3bcec77ca725b20d to your computer and use it in GitHub Desktop.
Save pfrazee/f6030e59d335e73a3bcec77ca725b20d to your computer and use it in GitHub Desktop.
@Treora
Copy link

Treora commented Apr 5, 2018

I may have missed the context, but am curious whether you are trying to have the links defined in dat.json be equivalent to Web Links as used in http headers (rfc8288)? Should one be able to convert between the two in either direction?

Some notes regarding making a consistent mapping with web links:

  • Is the context (the resource the link 'points from') always the root URI of the dat? Can one also define the anchor attribute to create a link from another resource? Might be a nice future addition, as it allows specifying links from resources within the dat (though you may also want to be able to define them in subfolders etc.).
  • Links may have multiple rels. This should not be a problem, as this is equivalent to multiple links, so in approach #2 you would simply duplicate the link for each rel.
  • This CoRE draft is all about mapping web links to json and cbor, so it may be worth borrowing their approach. Their json example looks equivalent to approach #1.
  • This article mentions a few other approaches for embedding links in json. Not all approaches seem to care about creating a consistent mapping with web links though.

@pfrazee
Copy link
Author

pfrazee commented Apr 19, 2018

Good feedback all, appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment