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

Re: schema.org Roles design

From: Gregg Kellogg <gregg@greggkellogg.net>
Date: Wed, 26 Mar 2014 14:42:45 -0700
Cc: Jarno van Driel <jarno@quantumspork.nl>, Jason Douglas <jasondouglas@google.com>, Guha <guha@google.com>, W3C Web Schemas Task Force <public-vocabs@w3.org>
Message-Id: <CFD73B63-6E1B-4ED0-836D-61ABC46B13EF@greggkellogg.net>
To: Dan Brickley <danbri@google.com>
On Mar 26, 2014, at 2:22 PM, Dan Brickley <danbri@google.com> wrote:

> On 26 March 2014 20:59, Jarno van Driel <jarno@quantumspork.nl> wrote:
>> Well if @id has the same role as 'itemref' then could there also please be
>> some info explaining how that works, because to be honest, I sort of
>> understand the proposal but am confused about @id/itemid. e.g. to me it
>> seems @id functions the same way as @resource does in RDFa, or at least
>> that's how I read it.
> The following are all similar in RDF-based languages - they identify
> the entities being described:
> RDF/XML: about= (for subjects, i.e. the thing that has the property),
> resource= (for objects, i.e. a thing that is a value of some property)
> RDFa 1.0: about= (for subjects), resource= (for objects),
> http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014/#rdfa-attributes
> RDFa 1.1: about= (for subjects), resource= (for objects),
> http://www.w3.org/TR/rdfa-syntax/#A-about
> http://www.w3.org/TR/rdfa-syntax/#A-resource
> RDFa 1.1 Lite ... doesn't make this distinction; resource= works for
> either . http://www.w3.org/TR/rdfa-lite/#resource

Because nothing in RDFa can be simple, either @about or @resource may be used to set the subject. RDFa Lite recommends just using @resource. @about is historical, but necessary for more complicated markup. Formally, @about sets the current subject and @resource the current object, but in sub-elements, the previous object becomes the default current subject. (Trust me, stick with RDFa Lite so your head doesn't explode!)

> JSON-LD: @id http://www.w3.org/TR/json-ld/#node-identifiers
> Microdata: itemid=
> http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#global-identifiers-for-items

In The Microdata to RDF note, @itemid specifically sets the current subject. In JSON-LD, @id also sets the current subject. So, for all practical purposes @resource == @itemid == @id.

> Most of these also have a way of using less-than-global local
> identifiers too, as a way of joining up a graph structure from
> different trees of markup. Microdata's itemref can also sometimes be
> used for that purpose but as already discussed it is a different kind
> of mechanism.

RDFa and JSON-LD allow an identifier to be a blank node, which has meaning only within a document. Microdata's content model doesn't allow this. If @itemid is skipped, a blank node is implicitly created and used in either the subject or object position when generating triples, depending on if the element with @itemscope is contained under another scoped element or contains other scopes. You can't create a true graph with blank nodes in microdata, but you can do so in RDFa or JSON-LD using something like _:bnode0.

You can also use fragment identifiers, which also have local scope, and these work in all three syntaxes.

>> Wouldn't the Person linking back to the AmericanFootballRole create an infinite loop?
> This is no more problematic than someone being their mother's son.
> These languages are all oriented towards describing relationships; it
> is natural that sometimes there will be loops.

+1 graphs commonly have loops; my sister and I are siblings of each other, for example.


> Dan
Received on Wednesday, 26 March 2014 21:43:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:49:25 UTC