Discussion:
URI Templates in Atom links
James Abley
2010-02-26 12:20:38 UTC
Permalink
Hi,

Just curious if anyone has done this or has opinions either way; e.g.

<link href="http://example.com/path/to/{deviceType}/movie/resource"
type="video/quicktime" />

Where the client applications know to substitute the parameter
appropriately.

Versus using Media RSS or similar:

<media:group>
<media:content url="http://example.com/movie1.mov"
fileSize="15555"
type="video/quicktime"
medium="video"
isDefault="true"
expression="full"
bitrate="128"
framerate="25"
samplingrate="44.1"
channels="2"
duration="185"
height="200"
width="300"
lang="en"/>
<media:content url="http://example.com/movie2.mov"
fileSize="12345"
type="video/quicktime"
medium="video"
isDefault="true"
expression="full"
bitrate="128"
framerate="25"
samplingrate="44.1"
channels="2"
duration="185"
height="200"
width="300"
lang="en" />
</media:group>

For my domain (mobile applications) the smaller payload is quite attractive,
and I control all of the clients of the feed, since I'm writing them. One
niggle is that I don't think the URI template is a valid IRI, so validation
tools might grouse.

Cheers,

James
Joe Gregorio
2010-02-26 15:23:55 UTC
Permalink
Post by James Abley
Hi,
Just curious if anyone has done this or has opinions either way; e.g.
<link href="http://example.com/path/to/{deviceType}/movie/resource"
type="video/quicktime" />
Where the client applications know to substitute the parameter
appropriately.
<media:group>
  <media:content url="http://example.com/movie1.mov"
  fileSize="15555"
  type="video/quicktime"
  medium="video"
  isDefault="true"
  expression="full"
  bitrate="128"
  framerate="25"
  samplingrate="44.1"
  channels="2"
  duration="185"
  height="200"
  width="300"
  lang="en"/>
  <media:content url="http://example.com/movie2.mov"
  fileSize="12345"
  type="video/quicktime"
  medium="video"
  isDefault="true"
  expression="full"
  bitrate="128"
  framerate="25"
  samplingrate="44.1"
  channels="2"
  duration="185"
  height="200"
  width="300"
  lang="en" />
</media:group>
For my domain (mobile applications) the smaller payload is quite attractive,
and I control all of the clients of the feed, since I'm writing them. One
niggle is that I don't think the URI template is a valid IRI, so validation
tools might grouse.
Correct, URI Templates are not URIs, and there's explicit language in the
drafts that covers that:

URI Template expressions are not URIs: they do not identify an abstract
or physical resource, they are not parsed as URIs, and should not be used
in places where a URI would be expected unless the template expressions
will be expanded by a template processor prior to use. Distinct
field, element,
or attribute names should be used to differentiate protocol
elements that carry
a URI Template from those that expect a URI-reference.

Using URI Templates will require either creating a custom namespaced
element for your
specific case, or creating a more general namespaced 'tlink' element
that is just like
'link', but the value of href is expected to be a URI Template.

Thanks,
-joe
Post by James Abley
Cheers,
James
Jan Algermissen
2010-03-02 10:34:31 UTC
Permalink
Post by Joe Gregorio
Using URI Templates will require either creating a custom namespaced
element for your
specific case, or creating a more general namespaced 'tlink' element
that is just like
'link', but the value of href is expected to be a URI Template.
I have come across the '<tlink>-use case' almost every time I use Atom so IMO it is worth standardiziing it.

What would be the best way to do that (is there a better way than just writing up an I-D)?

(Given that there is a dependency on the URI template I-D should that one be finsihed first?)

Jan



-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting

Mail: algermissen-***@public.gmane.org
Blog: http://www.nordsc.com/blog/
Work: http://www.nordsc.com/
-----------------------------------
Julian Reschke
2010-03-02 11:05:34 UTC
Permalink
Post by Jan Algermissen
Post by Joe Gregorio
Using URI Templates will require either creating a custom namespaced
element for your
specific case, or creating a more general namespaced 'tlink' element
that is just like
'link', but the value of href is expected to be a URI Template.
+1
Post by Jan Algermissen
I have come across the '<tlink>-use case' almost every time I use Atom so IMO it is worth standardiziing it.
Indeed.
Post by Jan Algermissen
What would be the best way to do that (is there a better way than just writing up an I-D)?
I think writing an I-D is the best way.
Post by Jan Algermissen
(Given that there is a dependency on the URI template I-D should that one be finsihed first?)
They could be developed in parallel; having a spec reference the
template spec would be a good test for the usability of the template spec...

Best regards, Julian
Asbjørn Ulsberg
2010-03-03 09:11:25 UTC
Permalink
On Tue, 02 Mar 2010 11:34:31 +0100, Jan Algermissen
Post by Jan Algermissen
I have come across the '<tlink>-use case' almost every time I use Atom
so IMO it is worth standardiziing it.
With my recent thread regarding an Atom Media Repository, I have no choice
but to agree completely. :)
Post by Jan Algermissen
What would be the best way to do that (is there a better way than just writing up an I-D)?
I'd say so, yea.
Post by Jan Algermissen
(Given that there is a dependency on the URI template I-D should that
one be finsihed first?)
That just means the tlink I-D needs to await the completion of the URI
template I-D before it can reach its own completion status. I think that's
rather common in the IETF community, actually. I don't see a problem with
it, at least.
--
Asbjørn Ulsberg -=|=- asbjorn-Cn+***@public.gmane.org
«He's a loathsome offensive brute, yet I can't look away»
Loading...