Re: schema.org Roles design

On 26 March 2014 21:55, Aaron Bradley <aaranged@gmail.com> wrote:
> I'm baffled by @id as well.  Forget the RDFa/microdata/JSON-LD syntax
> differences for a moment, I've read the proposal but still don't know from
> whence the the @id values arise.
>
> In the PDF where does...
> @id "role321" come from? (e.g.1)
> @id "movierole_678" come from? (e.g. 2)
> @id "edurole25151" come from? (e.g. 3)
>
> Are these arbitrarily assigned by the coder?  Are these serial?  And are
> they resolvable to an IRI?
>
> And are they integral to the Role/hasRole proposal - that is, does
> everything break if they're not employed?  Am I correct in reading @ID in
> e.g. 1 ("role321") is the necessary entity referred to in order to have the
> "athlete property applied to the Role, instead of to a Team"?

They're arbitrary (in this example anyway), and serve only to allow a
reference from a subtree of the json markup back to something
described 'higher up'.
 Nothing stops them being more widely used IDs, or randomly generated.
As you say it is all about tying together the entity references.

I believe it can also be achieved with a @reverse. But I tried and I
figured it was more confusing to introduce the idea at this stage. I
am also not expert in all the representational subtleties of JSON-LD,
so I went for something 'simple' to start with. It may be we can find
a cleaner alternative.

Here is as far as I got with removing the need for an @id on the
MovieRole so that an inRole property of the Bill Murray Person could
point to the Role:

1. We imagine inRole as a link from a Thing (e.g. Person) *to* the Role.
2. We define a @reverse of that called roleIn (an ad hoc name, but
just testing here).
3. We replace write "roleIn" where "actor" was previously.
4. Yes, we now have a problem for how to represent the "actor"
relationship. Possibly JSON-LD has a way.

{
    "@context": [
        "http://schema.org/",
        {
            "roleIn": {
              "@reverse":"http://schema.org/inRole"
            }
        }
    ],
    "@type": "Movie",
    "name": "Ghostbusters",
    "hasRole": {
        "@type": "MovieRole",
        "characterName": "Dr. Peter Venkman",
        "roleIn": {
            "@type": "Person",
            "name": "Bill Murray"
        }
    }
}

I'll look into markup examples (rdfa/microdata) tomorrow. If there is
a way in JSON-LD to give a list of properties between two entities
this would be simpler (Gregg?). For e.g. I think in RDF we can just
write something like,

<span ...ghostbusters here
 <span property="actor roleIn">
   <span ...billmurray here">

or

<span ...ghostbusters here
 <span property="actor" rev="inRole">
   <span ...billmurray here

Gregg, can you help untangle this?

Dan

Received on Wednesday, 26 March 2014 22:23:02 UTC