[whatwg] Proposal: allow itemid to record multiple identifiers for an item

Ian Hickson ian at hixie.ch
Tue Dec 4 20:18:54 PST 2012


On Tue, 4 Dec 2012, Ed Summers wrote:
> 
> Over on a schema.org related list [1] there has been a discussion about 
> making identifiers for bibliographic items (books, articles, etc) 
> available in microdata using itemid. The use case is well described in 
> the dev edition, with this example [2]:
> 
> <dl itemscope
>     itemtype="http://vocab.example.net/book"
>     itemid="urn:isbn:0-330-34032-8">
>  <dt>Title
>  <dd itemprop="title">The Reality Dysfunction
>  <dt>Author
>  <dd itemprop="author">Peter F. Hamilton
>  <dt>Publication date
>  <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
> </dl>
> 
> Our use case is when a publisher wants to record multiple identifiers 
> for an item. For example The Reality Dysfunction also has an OCLC number 
> 225870439, which can be expressed as a URI, info:oclcnum/225870439.

When a property isn't the sole unique identifier for an item, just use a 
property instead of itemid="", as in:

 <div itemscope itemtype="http://vocab.example.net/book">
  <meta itemprop="id" content="isbn 0-330-34032-8">
  <meta itemprop="id" content="oclcnum 225870439">
  <dl>
   <dt>Title
   <dd itemprop="title">The Reality Dysfunction
   <dt>Author
   <dd itemprop="author">Peter F. Hamilton
   <dt>Publication date
   <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
  </dl>
 </div>

...or, if continuing to use URLs makes more sense:

 <div itemscope itemtype="http://vocab.example.net/book">
  <link itemprop="id" href="urn:isbn:0-330-34032-8">
  <link itemprop="id" href="info:oclcnum/225870439">
  <dl>
   <dt>Title
   <dd itemprop="title">The Reality Dysfunction
   <dt>Author
   <dd itemprop="author">Peter F. Hamilton
   <dt>Publication date
   <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>
  </dl>
 </div>


> One alternative to using itemid would be to define an oclcnum itemprop 
> to the relevant schema.org types. This solution is a bit unwieldy 
> because there are so many identifier types in the bibliographic world. I 
> imagine the same is similar in other domains.

That's another possibility, yes. If having a large numbmer of properties 
is not practical for some reason, then having one property use a common 
syntax that can express all the identifier types (e.g. URLs, or the "type 
number" syntax in the first example above) can work too.


> Another solution would be to come up with some generic identifier 
> mechanism, but I feel like this would then duplicate what itemid is 
> already doing.

That's fine. itemid="" is intended just for the very specific case of 
there being a specific unique identifier that is globally used as the key 
by which a particular vocabulary's items are identified; if there's no 
such key, or there are many keys and none are more important than the 
others, then it's better to just use a property.

Honestly, itemid="" isn't really intended to be a particularly widely used 
feature. This is reflected by the way the spec only has one example that 
uses itemid="", and that example's purpose is to demonstrate itemid="". 
It's really just a shorthand for a property (though not one whose name can 
be specified in itemprop=""), and if it doesn't quite fit, it's fine to 
ignore it and use something else.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list