Vocabulary definition - Do affordances need to be contextualized within a resource representation definition?

26 views
Skip to first unread message

Michael Hibay

unread,
Apr 10, 2017, 3:34:19 PM4/10/17
to Hypermedia Web
Disclaimer: I don't want this to devolve into a perfect ontology discussion, as I believe a large portion of the potential power of hypermedia is the ability for clients to manage profile profile changes in a seamless way without notice being provided to clients ahead of time.  Meaning you don't need the perfect ontology to get started.

For a few months now I've been tackling the concept of hypermedia driven APIs, and how to create a generic client which is capable of consuming any profile defined within its bounds through any supported hypermedia format.  Through my research, I have come to the conclusion that affordances in a vocabulary can be part of a large pool of profile-global affordances AND are allowed to be contextualized within resource representations within a range of minimum expected affordances.

e.g.

Resource Representation: Foo
dataElement a;
dataElement b;

affordance anF;
affordance aB;

would exist as part of a larger profile (ALPS or other, in this discussion it should be irrelevant) which contains:
...
affordance anF;
affordance aB;
affordance aZ;
affordance aD;
...

The significance I place on this definition is to allow generic clients to be flexible, they require a bounded domain from which to bind actions (UI rendering, microservice processing, etc..).  To do this the consumer will need a way to view the possible semantic responses in order to create generic bindings globally, not just on the individual resource representation.  None of the research or specifications or musings I've encountered explicitly suggest this is in any way a violation of the concept, but I want to make sure there is no obvious omissions from which I'm basing my solution space.

Thanks all!

mca

unread,
Apr 10, 2017, 11:25:25 PM4/10/17
to hyperme...@googlegroups.com
Michael:

good to see your post here...

<snip>

Through my research, I have come to the conclusion that affordances in a vocabulary can be part of a large pool of profile-global affordances 
</snip>
not sure of the diff you're referring to between "affordances in a vocabulary" and "profile-global affordances"

<snip>
AND are allowed to be contextualized within resource representations within a range of minimum expected affordances.
</snip>
don't know what that means<g>.




--
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-web+unsubscribe@googlegroups.com.
To post to this group, send email to hypermedia-web@googlegroups.com.
Visit this group at https://groups.google.com/group/hypermedia-web.
For more options, visit https://groups.google.com/d/optout.

Michael Hibay

unread,
Apr 11, 2017, 10:59:18 AM4/11/17
to Hypermedia Web
To clarify the difference between 'profile global vocabulary' and the 'resource affordances' I'll craft a minimal example as a json blob over alps to increase readability.

{"profile": {
  "affordances":[
    {"name":"anF","safe":"UNSAFE"},
    {"name":"aB","safe":"UNSAFE"},
    {"name":"aD","safe":"UNSAFE"},
    {"name":"PROFILE_GLOBAL","safe":"UNSAFE"}
  ],
  "representations":[
    {"name":"Foo",
      "elements":[
        {"name":"a"},
        {"name":"b"}],
      "affordances":[
        {"name":"anF"},
        {"name":"aB"},
        {"name":"NOT_GLOBAL","safe":"UNSAFE"}
      ]
    },
    {"name":"Bar",
      "elements":[
        {"name":"c"},
        {"name":"d"}],
      "affordances":[
        {"name":"anF"},
        {"name":"aD"},
        {"name":"ANOTHER_NOT_GLOBAL","safe":"UNSAFE"}
      ]
    }
  ]
}}


As you see in the above, there are global affordances which are defined to be applicable to all representations within the profile, and there are affordances defined only in the context of an individual representation.

This would be evaluated to be effectively equivalent to the following.

{"profile": {
  "representations":[
    {"name":"Foo",
      "elements":[
        {"name":"a"},
        {"name":"b"}],
      "affordances":[
        {"name":"anF","safe":"UNSAFE"},
        {"name":"aB","safe":"UNSAFE"},
        {"name":"NOT_GLOBAL","safe":"UNSAFE"},
        {"name":"PROFILE_GLOBAL","safe":"UNSAFE"}
      ]
    },
    {"name":"Bar",
      "elements":[
        {"name":"c"},
        {"name":"d"}],
      "affordances":[
        {"name":"anF","safe":"UNSAFE"},
        {"name":"aD","safe":"UNSAFE"},
        {"name":"ANOTHER_NOT_GLOBAL","safe":"UNSAFE"},
        {"name":"PROFILE_GLOBAL","safe":"UNSAFE"}
      ]
    }
  ]
}}


However, without the global affordances, you have created a 1-1 binding which increases clarity, but greatly reduces flexibility for a generic client implementation while added redundant definitions.  That is why my suggestion and original wording described the minimum set of expected affordances.

After going through a more concrete example, this does raise the question of exclusion from global affordances at some point, which may be desirable in some instances but I don't think it would be as large a gain as creating a global affordance set.

I feel this interpretation has an appropriate level of granularity when talking about the application profile, but the examples I have seen were only dealing in resource specific affordance definition.  I don't see any particular reason why this wouldn't be a valid but as always a clear answer would be best.

I hope this is more clear, thoughts?

mca

unread,
Apr 11, 2017, 6:21:37 PM4/11/17
to hyperme...@googlegroups.com
oh,i see. this is about using nesting in ALPS document to limit the scope of descriptors.

yep, that's certainly possible. FWIW, i rarely do that<g>.

i almost always create a flat ALPS profile that lists all the possible data elements and then all the possible affordances (and any related data elements).  I also have used a "contains" pattern that i use for the @rt property. these are all just personal patterns, tho.

i think i get your point and have no problem w/ it. 

--

Michael Hibay

unread,
Apr 12, 2017, 9:02:44 AM4/12/17
to Hypermedia Web
Great.  The more specific I can be or hints I can explicitly provide a generic client the better the UX and developer experience will be.
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.
Reply all
Reply to author
Forward
0 new messages