W3C home > Mailing lists > Public > public-vocabs@w3.org > March 2014

schema.org Roles design

From: Dan Brickley <danbri@google.com>
Date: Wed, 26 Mar 2014 16:37:39 +0000
Message-ID: <CAK-qy=5Zgn7_DGorgq=xs4Mmo+J6z==NqZAPqTgJwNnm3m1ygA@mail.gmail.com>
To: W3C Web Schemas Task Force <public-vocabs@w3.org>
At schema.org we have been working on a design for describing roles
and contributions.

I've just posted a discussion draft in the WebSchemas wiki. Please take a look:

Roles in Schema.org
https://www.w3.org/wiki/WebSchemas/RolesPattern ->

>From the wiki, "For example, when we say that a Person was an actor in
a Movie, we might want to mention their characterName too. When we say
that a SportsTeam has a Person as an athlete, we might want to mention
the position that they play, or the time period in which they
fulfilled that role.".

I freely acknowledge that PDF isn't the best way to share markup/code
snippets and will copy those into Wiki. However we wanted to get the
draft out asap.

Here's a quick example extracted from the doc, expressed in JSON-LD.
We want to elaborate on a basic description, so here is the mostasic
version first, followed by the Role-based richer version:

 "@context": "http://schema.org/",
 "@type": "AmericanFootballTeam",
 "name": "San Francisco 49ers",
 "athlete": {
   "@type": "Person",
   "name": "Joe Montana"

Extended version using Role:

   "@context": "http://schema.org/",
   "@type": "AmericanFootballTeam",
   "name": "San Francisco 49ers",
   "hasRole": {
       "@type": "AmericanFootballRole",
       "@id": "role321",
       "startDate": "1979",
       "endDate": "1992",
       "position": "Quarterback",
       "athlete": {
               "@type": "Person",
               "name": "Joe Montana",
               "hasRole": "role321"

Effectively we interpose a new node in the graph. Instead of

SanFrancisco49ers ---athlete---> JoeMontana

We have

SanFrancisco49ers --hasRole---> [role321] --athlete---> JoeMontana.

There are a few nearby designs that may be worth discussion here. If
we wanted to make things simpler for publishers, we could remove the
hasRole reference from JoeMontana back to the Role. However this also
makes it harder for consuming applications to understand Role-based
modeling across all domains. Another approach would be to use
different property names for relating the 'subject' and 'predicate'
entities. The appendix in the full proposal document elaborates on
some of these options. I should also note for those of you using the
JSON-LD playground or other generic tools that the above markup needs
some tweaks, since schema.org doesn't yet publish a @context file.
Again, the document has details of a workaround.

Please take a look. This is quite an important spec for schema.org as
it has impact across all domains, so it is important to find the right
balance between ease of adoption for publishers, expressivity, ease of
processing etc.


Received on Wednesday, 26 March 2014 16:38:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:29:38 UTC