URI Templates: RFC6570

Looks like this RFC is gaining traction for doing things like URI
templating, which was proposed in ISSUE-108:

https://github.com/json-ld/json-ld.org/issues/108

While we've decided to back-burner this issue for now, one could still
overlay a templating mechanism on top of JSON-LD using
terms in the context and the URI Template spec to produce "resolved"
URLs in JSON-LD documents. For example, you could do something like this:

// URI templates used in this data
var jsonLdWithUriTemplates = { ... };

// terms defined in this data that are meant to be used to expand
// the URI template variables
var context = { ... };

// all URIs in the 1st param are expanded using the context provided
var resolved =
  jsonld.resolveUriTemplates(jsonLdWithUriTemplates, context);

More here... they have 7 fully conforming implementations:

http://tools.ietf.org/html/rfc6570

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
Founder/CEO - Digital Bazaar, Inc.
blog: PaySwarm Website for Developers Launched
http://digitalbazaar.com/2012/02/22/new-payswarm-alpha/

Received on Wednesday, 20 June 2012 03:36:06 UTC