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>
Dominik,

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/"
     about="http://dbpedia.org/resource/Albert_Einstein">
 <span property="dateOfBirth" datatype="xsd:date">1879-03-14</span>
</div>

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

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

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
-- 
Jeni Tennison
http://www.jenitennison.com
Received on Tuesday, 22 November 2011 21:58:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:18 GMT