metadata ?! _links vs links

89 views
Skip to first unread message

Andrei Neculau

unread,
Sep 26, 2012, 8:01:17 AM9/26/12
to api-...@googlegroups.com
what would you consider resource metadata ? what would you mark with the _ prefix, and for what reason (maybe you would mark something that is not metadata)?

more specifically, are links metadata ?
why mark them as _links like HAL (Collection+JSON, Siren don't)?

Mike Kelly

unread,
Sep 26, 2012, 9:00:01 AM9/26/12
to api-...@googlegroups.com
The main reason for the underscore prefixes in HAL is so that the
properties that are reserved by HAL are visually distinct.

Cheers,
M

Andrei Neculau

unread,
Sep 26, 2012, 9:25:28 AM9/26/12
to api-...@googlegroups.com
Thanks, Mike. Is that the main and the only reason?

Mike Kelly

unread,
Sep 26, 2012, 9:34:09 AM9/26/12
to api-...@googlegroups.com
Theoretically it reduces the chance of collisions.. there may be
others I just can't think of right now.

Is there a specific reason you bring this up or just curious?

On Wed, Sep 26, 2012 at 2:25 PM, Andrei Neculau
<andrei....@gmail.com> wrote:
> Thanks, Mike. Is that the main and the only reason?
>
>
> On Wednesday, September 26, 2012 3:00:04 PM UTC+2, Mike Kelly wrote:
>>
>> On Wed, Sep 26, 2012 at 1:01 PM, Andrei Neculau
>> <andrei....@gmail.com> wrote:
>> > what would you consider resource metadata ? what would you mark with the
>> > _
>> > prefix, and for what reason (maybe you would mark something that is not
>> > metadata)?
>> >
>> > more specifically, are links metadata ?
>> > why mark them as _links like HAL (Collection+JSON, Siren don't)?
>>
>> The main reason for the underscore prefixes in HAL is so that the
>> properties that are reserved by HAL are visually distinct.
>>
>> Cheers,
>> M
>
> --
> You received this message because you are subscribed to the Google Groups
> "API Craft" group.
> To unsubscribe from this group, send email to
> api-craft+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/api-craft?hl=en.
>
>



--
Mike

http://twitter.com/mikekelly85
http://github.com/mikekelly
http://linkedin.com/in/mikekelly123

Andrei Neculau

unread,
Sep 26, 2012, 9:56:19 AM9/26/12
to api-...@googlegroups.com
It's a general question.
I have some structures which are now defined as having "links".
And gut/habit driven I was going to rename to "_links", thinking it's metadata, and as you say it will lower down the chances of name collisions.
But then I started thinking "what is metadata actually?", and ended up reading that the term is rather ambiguous, making it tough to make a clear distinction.

Felipe S.

unread,
Sep 26, 2012, 3:13:47 PM9/26/12
to api-...@googlegroups.com
I wouldn't consider "links" to be metadata at all.To me they are an integral part of the application/representation.
Think of it this way: with MP3 the metadata is stuff like 'Artists', 'Album' or 'Release year'. Leave it out and you can still listen to the track.
If you leave out the "links" in representations, you client can't navigate or retrieve further resources and hence the application "state machine" is stuck.

Obviously it depends on how important the links are in your application. 

Felipe
Reply all
Reply to author
Forward
0 new messages