Hyperlinks as Data

29 views
Skip to first unread message

Stephen Mizell

unread,
Dec 2, 2015, 11:14:38 AM12/2/15
to Hypermedia Web
In the profile link relation specification, there is this little tidbit of information that is really useful.

...the target URI does not necessarily have to identify a
dereferencable resource (or even use a dereferencable URI scheme).
Clients can treat the occurrence of a specific URI in the same way as
an XML namespace URI and invoke specific behavior based on the
assumption that a specific profile target URI signals that a resource
representation follows a specific profile. Note that, at the same
time, it is possible for profile target URIs to use dereferencable
URIs and to use a representation (which is outside the scope of this
specification) that represents the information about the profile in a
human- or machine-readable way.

Is there a term for using links in this way? We see this with namespace URIs, profile links, and even the way RELs may be used (they can be URIs as extension relation types). But this can also be done in place of any data. For example, instead of:

{ "category": "foo" }


You could just as easily do:


You would use this URI as data itself, being able to filter by specific categories given a specific URI. The user could also resolve the URI to get more information about the category, but it is not necessary to resolve it to get all of the data needed.

Is there a term for this? It's not really a namespace or profile. It is more of using a hyperlink as data itself.

Stephen

Martynas Jusevičius

unread,
Dec 2, 2015, 11:45:39 AM12/2/15
to hyperme...@googlegroups.com
Stephen,

you could (re)use URI for the property as well:

_:thing dct:subject <http://example.com/categories/foo> .

But this way you are pointing to a document, not a category. More
likely you want a separate URI for it, for example:

_:thing dct:subject <http://example.com/categories/foo#this> .

And yes, there is a term for it. It's called the RDF data model.


Martynas
graphityhq.com
> --
> You received this message because you are subscribed to the Google Groups
> "Hypermedia Web" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hypermedia-we...@googlegroups.com.
> To post to this group, send email to hyperme...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hypermedia-web.
> For more options, visit https://groups.google.com/d/optout.

Joost Cassee

unread,
Dec 2, 2015, 11:48:15 AM12/2/15
to hyperme...@googlegroups.com
Hi Stephen,

Actually, I think using URIs in the resource state (as for example HAL
calls it) is actually very useful. I included some ideas on this in my
last hypermedia presentation [1]. Basically, the relation between the
resource and the references resource become part of the state instead
of the API wiring.

[1] http://slides.com/jcassee/hypermedia-ilt-2015#/2/9

Best,
Joost
> --
> You received this message because you are subscribed to the Google Groups
> "Hypermedia Web" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hypermedia-we...@googlegroups.com.
> To post to this group, send email to hyperme...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hypermedia-web.
> For more options, visit https://groups.google.com/d/optout.



--
Joost Cassee
+31 (0)6 14585693
https://jcassee.com

Note: I read my email about twice a day. If it's time-sensitive please
call or text me.

NB: Ik lees mijn e-mail tweemaal per dag. Als het haast heeft kun je
beter bellen of SMSen.

Mike Kelly

unread,
Dec 2, 2015, 11:50:55 AM12/2/15
to hyperme...@googlegroups.com
RDF is far more than just dereferencable relations, as is Linked Data.

The terminology used for this is often "discoverability" and "self-descriptive messages".

Fwow, this is an important affordance detailed explicitly in the hal+json specification.

Mike Kelly

unread,
Dec 2, 2015, 11:51:39 AM12/2/15
to hyperme...@googlegroups.com
Ah, you beat me to it :)

Stephen Mizell

unread,
Dec 2, 2015, 4:10:39 PM12/2/15
to hyperme...@googlegroups.com
This is very helpful. The slides of the talk were interesting as well. :) Was it recorded?

When talking with others about using hypermedia to represent application logic, we talk about the semantic meaning being in the link relations and context, not the URL or HTTP method. We work hard to not couple to specific URIs, but rather semantics defined somewhere, like in media type or profile.

But in this case I'm talking about, the actual identifier is important. For instance, when we see http://www.w3.org/1999/xhtml, we know that as the identifier for the XHTML namespace. Clients can look for that specific URI and act accordingly, which is a more discoverable pattern than saying the namespace is XHTML and having some registry for every kind of thing there is. This is true for how profiles can be used (as quoted in my first email) along with link relations (as used in HAL).

It's a hard transition to make in a discussion, to say in one minute to not couple to URIs and in another saying specific URIs are important in some contexts. While it this pattern can be found in many places, I was mostly curious if there was a term for the pattern of using a URI this way. Maybe this is use case of hyperlinking itself and I should leave it as that :)

Thanks!

Joost Cassee

unread,
Dec 3, 2015, 5:49:27 AM12/3/15
to hyperme...@googlegroups.com
Hi Stephen,

My talk was not recorded, just an informal intra-company meeting.

I am not sure this will be an answer, but I have come to find it
pretty natural to user URIs in resource state when the client is
allowed to update that URI. I think it is often better than allowing
them to manipulate some identifier that is later used to generate the
URI. However, I find it difficult to describe my thinking in an email.

As for a name for this pattern, I often just say something like "the
'pictureHref' property contains a reference (href) to (the resource
containing/representing) the picture". It is just a reference in the
resource state.

Does that help?

Best,
Joost
Reply all
Reply to author
Forward
0 new messages