« Rewrite Rule Engine | Main | OINK Dashboard Widget »


On Datatypes in Wilbur

One of the features I built into Wilbur but haven't used all that much is mapping of XSD datatypes to Common Lisp data. In my previous post I used a typed literal:


To turn this into something Common Lisp can handle, we say

(literal-value *)

and (assuming that * was bound to the particular literal) it returns


which is the universal time representation of that particular timestamp. Parsing and conversion of the data values is done only once, and cached with the literal (since literals are immutable in Wilbur).

Wilbur now handles all the basic XSD datatypes. The method literal-value->string is the mapping in the opposite direction. For example, to create the above literal, one could say:

(db-make-literal *db*
                 (literal-value->string !xsd:dateTime 3352995745)
                 :datatype !xsd:dateTime)

Similarily, evaluating

(db-make-literal *db*
                 (literal-value->string !xsd:integer 13)
                 :datatype !xsd:integer)

would return


Posted by ora at 18:53