W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > November 2011

Re: Default Vocabulary for datatype: datatypeLibrary attribute

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 22 Nov 2011 21:57:36 +0000
Cc: public-rdfa-wg@w3.org
Message-Id: <8E987890-37C0-4266-BA16-62FEEE507625@jenitennison.com>
To: Dominik Tomaszuk <ddooss@wp.pl>

On 22 Nov 2011, at 21:02, Dominik Tomaszuk wrote:
> We use only one datatype library in @datatype very often. Also in many cases it is just XML Schema Datatypes. I propose @datatypeLibrary to declare datatype vocabluary to use in @datatype. It is something like @vocab and very similar to RELAX NG datatyping [1] For instance:
> <div vocab="http://dbpedia.org/property/" datatypeLibrary="http://www.w3.org/2001/XMLSchema#" about="http://dbpedia.org/resource/Albert_Einstein">
>  <span property="dateOfBirth" datatype="date">1879-03-14</span>
> </div>
> Instead of:
> <div prefix="dbp: http://dbpedia.org/property/
> xsd: http://www.w3.org/2001/XMLSchema#" about="http://dbpedia.org/resource/Albert_Einstein">
>  <span property="dateOfBirth" datatype="xsd:date">1879-03-14</span>
> </div>

The 'xsd' prefix is automatically bound to http://www.w3.org/2001/XMLSchema# so there's no need to declare it, which makes the second example:

<div vocab="http://dbpedia.org/property/"
 <span property="dateOfBirth" datatype="xsd:date">1879-03-14</span>

(Actually if you use <time> then I believe it's

<div vocab="http://dbpedia.org/property/"
 <time property="dateOfBirth">1879-03-14</span>

because the date will be sniffed as being a date, but that's beside your point.)

Given, as you say, that most of the time datatypes are XML Schema datatypes, I think it's simpler to just rely on this built-in prefix rather than introducing a @datatypeLibrary attribute. This example shows that it can be shorter, and built-in prefixes have the advantage of never getting left behind during copy-and-paste.

My 2p.

Jeni Tennison
Received on Tuesday, 22 November 2011 21:58:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:27 UTC