Typing of Literals in RDFa API

In a projection (or otherwise), the value of a property may be an IRI
or a typed literal.  The result value is always a string in the API.
How does a user get the type information via the API?

Not all types will map to language native data types.  Even further,
there isn't a good default in Javascript other than a string for an
IRI.  As such, how does one distinguish between an IRI and a string
valued literal?

A more heavy-weight solution would be to have get() and getAll()
return another interface (e.g. PropertyValue) that contains the type
and value pair.  A lighter weight, but possibly error prone, way would
be to have getPropertyType() and getPropertyTypes() methods.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Tuesday, 6 March 2012 21:15:28 UTC