alps-io / spec

ALPS Specification documents.
59 stars 13 forks source link

Resource Type as URL and ID #79

Open smizell opened 8 years ago

smizell commented 8 years ago

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>
mamund commented 8 years ago

yep - this is a spec bug, i think. the value of RT SHOULD be a valid URL pointer to an existing descriptor ID. for in-doc pointers, you MAY use hash values ("#contact") for external pointers you MUST use either a relative URL ("/profiles/users#contact") or absolute URLs (" http://api.example.org/profiles/users#contact").

happy to discuss further, but if we're all cool w/ this, feel free to work up a PR for this one. ​

filip26 commented 3 years ago

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.