alps-io/spec

Resource Type as URL and ID

Opened this issue · 2 comments

I've seen rt used as a URL, but I see in the docs it may match the id of another descriptor. Should the spec provide clarity on this? Is this meant to allow the user to use it how they wish?

If it's desired to make this specific, one option I see is to make it a resolvable URL like href, which means you can reference other descriptors in the same document with a fragment just like you do with href.

This is what the example from the docs would look like:

<alps version="1.0">
  <doc format="text">A contact list.</doc>

  <!-- a hypermedia control for returning contacts -->
  <descriptor id="collection" type="safe" rt="#contact">
    <doc>
      A simple link/form for getting a list of contacts.
    </doc>
    <descriptor id="nameSearch" type="semantic">
      <doc>Input for a search form.</doc>
    </descriptor>
  </descriptor>

  <!--  a contact: one or more of these may be returned -->
  <descriptor id="contact" type="semantic">
    <descriptor id="item" type="safe">
      <doc>A link to an individual contact.</doc>
    </descriptor>
    <descriptor id="fullName" type="semantic" />
    <descriptor id="email"    type="semantic" />
    <descriptor id="phone"    type="semantic" />
  </descriptor>
</alps>

Is there any reason to use URL and not URI/IRI? I would prefer:

  * 'rt' value MUST be valid IRI

It solves the issue, and also allows to use 'well-know' IRI as a definitive identifier.

btw. what about adding a label errata? it would be easier to search later.