Re: Default Vocabulary for datatype: datatypeLibrary attribute

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 UTC