So What about Activity Templates to support AOA?

28 views
Skip to first unread message

cappelaere

unread,
Sep 16, 2012, 8:00:21 PM9/16/12
to activity...@googlegroups.com
Just wanted to share some thoughts with this group after REST FEST 2012.
http://www.slideshare.net/cappelaere/building-tomorrows-web-services
I would really appreciate some feedback and get this going.
Many thanks,
Pat.

Martin Atkins

unread,
Sep 17, 2012, 2:21:55 PM9/17/12
to activity...@googlegroups.com
I was initially confused because we talked about a different kind of
"activity template" a while back that was focused on providing
presentational information to help convert a machine-readable activity
into a human-readable activity.

However, your proposal seems more like a mechanism to tell a machine "If
you want to do this kind of activity, this is how to do it."

For example: "If you want to post a photo, send a POST request to this
endpoint with the photo encoded as multipart/form-data in the entity body".

(In other words, something like WSDL or WADL but with a common
vocabulary across providers using Activity Streams rather than having
each provider bring its own vocabulary of possible actions.)

Did I understand correctly?

If so, this does seem like an interesting avenue of inquiry, using
activity streams as a vocabulary for describing activities that *could*
be performed

I don't really have anything specific to add on this subject right now,
since it's the first time I've encountered anything like this, it
definitely seems interesting.


Pat Cappelaere

unread,
Sep 17, 2012, 3:12:09 PM9/17/12
to activity...@googlegroups.com
Martin,

Yes… very close. Activity streams are really good at capturing activities that have been completed.
Users execute sequences of activities to achieve goals. Once they are done, they like to share that with their friends.
We have solved that problem with activity stream. Thank you to this Community.

But User-Agents will eventually broker this work on the user's behalf (IPhone SIRI example)
So how can we define activities that could be performed by agents for users on a particular web site.
How can agents discover those capabilities in advance?

Depending on the domain, it may be a matter of defining verb/object types. A common vocabulary is emerging but may need extensions.

Facebook is trying hard in that area but I do not want to be limited to Facebook Apps.

So are we talking about an Activity Discovery Document? (similar to the Google API Service Discovery Document?)
How should that Activity be described to be helpful?
What about constraints? (Cost, duration…)


Thanks for taking the time and showing interest. This could lead to a new generation of API.

Pat.
> --
> You received this message because you are subscribed to the Google Groups "Activity Streams" group.
> To post to this group, send email to activity...@googlegroups.com.
> To unsubscribe from this group, send email to activity-strea...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/activity-streams?hl=en.
>

Laurent-Walter Goix

unread,
Sep 18, 2012, 4:10:40 AM9/18/12
to activity...@googlegroups.com


Il giorno lunedì 17 settembre 2012 20:21:59 UTC+2, Martin Atkins ha scritto:

I was initially confused because we talked about a different kind of
"activity template" a while back that was focused on providing
presentational information to help convert a machine-readable activity
into a human-readable activity.

I am actually curious about this one...could you point me to some link where this was discussed already? any update on this topic?

thanks
walter

Pat Cappelaere

unread,
Sep 18, 2012, 8:12:14 AM9/18/12
to activity...@googlegroups.com
Walter,

The closest example may be Facebook Open Graph key concepts http://developers.facebook.com/docs/opengraph/keyconcepts/
where they talk about defining objects and actions.
But they have a close system.

Pat.

--
You received this message because you are subscribed to the Google Groups "Activity Streams" group.
To view this discussion on the web visit https://groups.google.com/d/msg/activity-streams/-/nDeSZuJDRxEJ.

Martin Atkins

unread,
Sep 18, 2012, 1:40:55 PM9/18/12
to activity...@googlegroups.com
On 09/18/2012 01:10 AM, Laurent-Walter Goix wrote:
The best thing I could find in a few minutes searching was this earlier
post of mine:
https://groups.google.com/d/msg/activity-streams/iF3jsbIxgQk/Ibh7F0cJLBkJ

IIRC it was discussed in some more detail at one or more of our
face-to-face meetups, but ultimately we didn't do anything about it.

I did a small experimental implementation which now exists only in a
long-forgotten branch of a long-forgotten project:

https://github.com/markpasc/giraffe/blob/less-old/giraffe/defaultmessages.xml
(this was, of course, back when Activity Streams was an Atom extension,
rather than a JSON vocabulary, so it's XML rather than JSON.)

It was modeled partially after Facebook's "template bundles" concept:
https://developers.facebook.com/blog/post/114/

But of course Facebook has removed this feature from its platform in the
mean time.


James M Snell

unread,
Sep 18, 2012, 1:44:06 PM9/18/12
to activity...@googlegroups.com
Templates are definitely something that would be interesting. It starts to become extremely complicated, however, when we factor in extensibility in object types and verbs... not to mention all the various actor/verb/object/target combinations and localization factors. It's definitely not a trivial exercise by any stretch of the imagination. 

One possible reference point: take a look at the Verb Definitions draft I wrote last spring.


- James

--
You received this message because you are subscribed to the Google Groups "Activity Streams" group.
To post to this group, send email to activity-streams@googlegroups.com.
To unsubscribe from this group, send email to activity-streams+unsubscribe@googlegroups.com.

Pat Cappelaere

unread,
Sep 18, 2012, 3:30:29 PM9/18/12
to activity...@googlegroups.com
What I find interesting is the opportunity for an evolvable API to match a user's needs.
If we can capture a user activity stream, then my service ought to be able to publish its capability in terms that users can understand and search for.  

Let's say I am a RESTBucks and I want to sell some branded coffee.

A customer wants to buy some coffee.  Her user-agent (SIRI) sends a query out for services that can sell coffee in the immediate vicinity:

{buy} {coffee} {close to my current location} // {verb}, {object}, {target}

but it could also have been:
{*} {coffee} {close to my current location} // which may include consuming on premises for instance…


Queries come back, user finally decides that paying $5 for a cup of RESTBucks is what she wants, so she decides to go to the shop and buy it there.  (there was another RESTkin donuts coffee at $2.50… but … )
Story goes out: Eileen bought coffee at RESTBucks in Columbia, MD

Another customer specified a different verb (degustate) or a specialized product (frappuccino),  as the owner of RESTBucks I could tune my ontology to match that or have my users ask for my products by name… (evolvability).  There is some kind of decoupling here.

So how would those queries be expressed for discoverability?  SPARQL, FQL?
or simple triplets?

How would a service expose those potential activities?  How much information would need to be encapsulated to make this work automagically?  Is it a matter of simply adding a few optional constraints (cost, duration…)?

Activity execution then becomes a simple POST.
Activity search may be a simple GET.

If we all use the same ontology, we ought to be able to do something like this.  If you use a different ontology, I should be able to query it and see if I can match somehow…

This is not an easy problem but I am sure we can make some progress towards it.
Thanks again.
Pat.



To post to this group, send email to activity...@googlegroups.com.
To unsubscribe from this group, send email to activity-strea...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages