w3c / microdata-rdf

Specification of the extraction/transformation of Microdata content to RDF
15 stars 9 forks source link

Extract literal from @value of data element #8

Closed gkellogg closed 9 years ago

gkellogg commented 9 years ago

The HTMLdata element is used specifically to provide metadata using the value of the @value attribute [1]. As this attribute is intended to be machine-readable, a datatyped value may result.

Depending on the lexical form of the value of the @value attribute:

  1. if the value has the lexical form of an xsd:integer, value is a literal with datatype xsd:integer
  2. if the value has the lexical form of an xsd:float, value is a literal with datatype xsd:float
  3. if the value has the lexical form of an xsd:double, value is a literal with datatype xsd:double
  4. Otherwise, value is a Plain Literal without language or datatype.

The follow markup:

<data itemprop="integer" value="1">1cm</data>
<data itemprop="float" value="1.1">1.1cm</data>
<data itemprop="double" value="1.1e1">1.1<sup>1</sup>cm</data>
<data itemprop="plain" value="foo">foo</data>

would generate the following:

[
  <http://example/integer > "1"^^xsd:integer;
  <http://example/float> "1.1"^^xsd:float;
  <http://example/double> "1.1e1"^^xsd:double;
  <http://example/plain> "foo";
] .
iherman commented 9 years ago

With the caveat described in Issue #9, I am fine with this.