Verb Definitions....

36 views
Skip to first unread message

James M Snell

unread,
May 7, 2012, 6:56:21 PM5/7/12
to activity...@googlegroups.com
Following the recent discussions around the introduction of new verbs,
I've been working up a basic format for a "verb description" ...
here's what I have currently.. consider this a strawman.. feedback is
welcome...

The verb description will itself be an activity stream object type
with the following properties:

- value = the value label for the verb
- synonyms = array of synonymous verbs
- antonyms = array of opposite verbs
- hypernyms = array of verbs for which this verb is a hyponyms
- templates = localized display template structure ... explanation below

The templates property allows the verb description to provide
localized templates for displaying the verb... it allows the templates
to be made specific to the activity "object" and a language range...
for instance...

{
"objectType": "verb",
"displayName": "Play",
"value": "play",
"hypernyms": [ "consume" ],
"templates": {
"*": {
"*": "{actor} played {object}",
"video": "{actor} watched {object}",
"audio": "{actor} listened to {object}"
},
"fr-*": {
"*": "{actor} a joué {object}",
"video": "{actor} vu {object}",
"audio": "{actor} écouté {object}"
}
}
}

Given this, we can see that:

- "play" is a hyponym of "consume"
- When the "object" has objectType=video, and the locale matches fr-*,
the display template is "{actor} vu {object}"
- When the "object" has objectType=audio, and the locale is anything
other than fr-*, the display template is "{actor} listened to
{object}"
- When the "object" has any other object type and locale matches fr-*,
the display template is "{actor} a joué {object}"

Again, this is just a strawman for now. Thoughts? Comments?

Martin Atkins

unread,
May 7, 2012, 7:07:27 PM5/7/12
to activity...@googlegroups.com
On 05/07/2012 03:56 PM, James M Snell wrote:
>
> The templates property allows the verb description to provide
> localized templates for displaying the verb... it allows the templates
> to be made specific to the activity "object" and a language range...
> for instance...
>
> {
> "objectType": "verb",
> "displayName": "Play",
> "value": "play",
> "hypernyms": [ "consume" ],
> "templates": {
> "*": {
> "*": "{actor} played {object}",
> "video": "{actor} watched {object}",
> "audio": "{actor} listened to {object}"
> },
> "fr-*": {
> "*": "{actor} a jou� {object}",
> "video": "{actor} vu {object}",
> "audio": "{actor} �cout� {object}"
> }
> }
> }
>
> Given this, we can see that:
>
> - "play" is a hyponym of "consume"
> - When the "object" has objectType=video, and the locale matches fr-*,
> the display template is "{actor} vu {object}"
> - When the "object" has objectType=audio, and the locale is anything
> other than fr-*, the display template is "{actor} listened to
> {object}"
> - When the "object" has any other object type and locale matches fr-*,
> the display template is "{actor} a jou� {object}"
>

Do you intend tho use the hypernyms as a mechanism to inherit templates?

That is, so I can define a template for some base verb and then
selectively override it in more specific verbs.

What are the use-cases for the synonyms and antonyms? The former I guess
is just an aliasing mechanism, but I'm not sure what you'd do with the
latter.

Monica Wilkinson

unread,
May 7, 2012, 7:08:52 PM5/7/12
to activity...@googlegroups.com
Cool ! Replies below

On Mon, May 7, 2012 at 3:56 PM, James M Snell <jas...@gmail.com> wrote:
Following the recent discussions around the introduction of new verbs,
I've been working up a basic format for a "verb description" ...
here's what I have currently.. consider this a strawman.. feedback is
welcome...

+1 on better verb descriptions
 

The verb description will itself be an activity stream object type
with the following properties:

- value = the value label for the verb
- synonyms = array of synonymous verbs
- antonyms = array of opposite verbs
- hypernyms = array of verbs for which this verb is a hyponyms
- templates = localized display template structure ... explanation below

I would also add here commonly used object types and base the templates per object type... 

The templates property allows the verb description to provide
localized templates for displaying the verb... it allows the templates
to be made specific to the activity "object" and a language range...
for instance...

 {
  "objectType": "verb",
  "displayName": "Play",
  "value": "play",
  "hypernyms": [ "consume" ],
  "templates": {
    "*": {
      "*": "{actor} played {object}",
      "video": "{actor} watched {object}",
      "audio": "{actor} listened to {object}"
    },
    "fr-*": {
      "*": "{actor} a joué {object}",
      "video": "{actor} vu {object}",
      "audio": "{actor} écouté {object}"
    }
  }
 }

+1 on machine readable 
 

Given this, we can see that:

- "play" is a hyponym of "consume"
- When the "object" has objectType=video, and the locale matches fr-*,
the display template is "{actor} vu {object}"
- When the "object" has objectType=audio, and the locale is anything
other than fr-*, the display template is "{actor} listened to
{object}"
- When the "object" has any other object type and locale matches fr-*,
the display template is "{actor} a joué {object}"

Perfect
 

Again, this is just a strawman for now. Thoughts? Comments?


Love it lets do it. But can continue to use the yaml files to describe the verbs and obj types ?

Just imagine this in yaml
 

--
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.


James M Snell

unread,
May 7, 2012, 7:10:31 PM5/7/12
to activity...@googlegroups.com
On Mon, May 7, 2012 at 4:07 PM, Martin Atkins <ma...@degeneration.co.uk> wrote:
>[snip]
>
> Do you intend tho use the hypernyms as a mechanism to inherit templates?
>
> That is, so I can define a template for some base verb and then selectively
> override it in more specific verbs.
>

This is an open question. Short answer is: I don't know yet.

> What are the use-cases for the synonyms and antonyms? The former I guess is
> just an aliasing mechanism, but I'm not sure what you'd do with the latter.
>

Yes, synonyms is for aliases.

Antonyms may be useful to describe mutually exclusive options
presented within a UI, but I'm still working through the use cases.


- James

James M Snell

unread,
May 7, 2012, 7:19:07 PM5/7/12
to activity...@googlegroups.com
While there's no technical reason yaml couldn't be used for this, I'd
rather avoid impls from having to be able to handle two separate
syntaxes. Impls are already going to be implemented to create/parse
JSON... the yaml stuff was only ever used for our own registry
website...

that said, if folks prefer yaml over json, then we can go with that...
even if it is the wrong choice ;-P ....

- James

On Mon, May 7, 2012 at 4:08 PM, Monica Wilkinson
<monica...@gmail.com> wrote:
[snip]

Monica Wilkinson

unread,
May 7, 2012, 7:21:57 PM5/7/12
to activity...@googlegroups.com
Ah not exactly what I meant.

My point was simply that this data should be filled out when submitting a new verb to the registry which is yaml files. 

This will help developers reuse existing verbs

James M Snell

unread,
May 7, 2012, 7:25:25 PM5/7/12
to activity...@googlegroups.com
Oh! sorry... right... yeah different use cases but even then I think
we can recast our registry using the JSON format so that we're using
the same format we'd be recommending that others use.

- James

On Mon, May 7, 2012 at 4:21 PM, Monica Wilkinson

Monica Wilkinson

unread,
May 7, 2012, 8:32:11 PM5/7/12
to activity...@googlegroups.com, activity...@googlegroups.com
yaml is more human friendly so I would keep it in yaml for authors
Less typing.

For readers/apps we can provide json in addition to yaml for compatibility

James M Snell

unread,
May 8, 2012, 12:01:02 PM5/8/12
to activity...@googlegroups.com
+1 ... I'll likely write up the initial draft for the JSON syntax
today or tomorrow.

On Mon, May 7, 2012 at 5:32 PM, Monica Wilkinson
Reply all
Reply to author
Forward
0 new messages