The field types boolean, decimal, float and integer should have their XML datatype outputed along with their property attribute. Here is an example of output for a price:

<span property="commerce:amount" datatype="xsd:decimal">11.99</span>

Comments

scor’s picture

Issue tags: +RDF, +RDFa

forgot the proper tagging

Anonymous’s picture

StatusFileSize
new2.62 KB

- For integer, decimal, float, and boolean type fields, adds the datatype to the bundle's mapping in the database when the field is added to the bundle. Because there is no xsd:integer, xsd:decimal is used.

- In rdfa_attributes, makes sure that a predicate is assigned because datatypes should only be output if the data is the subject of a triple.

- Moves the datatype assignment out of the callback conditional because a callback value is not necessary for datatyping.

scor’s picture

Status: Active » Needs work

Thanks Lin for getting started with this issue :)

xsd:decimal exists and should be used here. see http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#dtype_interp for a list of XSD datatypes valid in RDFS.
EDIT: I meant xsd:integer exists and should be used here.

yched’s picture

Component: field system » rdf.module

Shouldn't this go in the "rdf.module" component ? Feel free to bump back if not.

scor’s picture

@yched: good point. Originally I thought field.module should declare what datatype each field should be mapped to, but we'll do that directly in rdf.module now.

Anonymous’s picture

StatusFileSize
new2.62 KB

Ah, it turns out I was just looking at the primitive datatypes and didn't make it down to the derived datatypes.

Fixed and rerolled.

Anonymous’s picture

StatusFileSize
new2.62 KB

or this, rather (using integer instead of unsignedInt)

Anonymous’s picture

StatusFileSize
new5.01 KB

This now has a test.

Test currently creates a field instance with a type randomly chosen the 4 field types that have datatypes associated with them.

I placed the test function in the RDFa Markup test, but this could easily be moved to another test or its own by copying out the setup information below the comment and the function.

Anonymous’s picture

StatusFileSize
new5.23 KB

Rerolled to test all 4 fields each time and move the function to its own test.

scor’s picture

Project: Drupal core » RDF CCK
Version: 7.x-dev » 6.x-2.x-dev
Component: rdf.module » Code

In fact we don't need that in core since the UI will be in contrib.