W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > March 2012

Typing of Literals in RDFa API

From: Alex Milowski <alex@milowski.com>
Date: Tue, 6 Mar 2012 13:14:56 -0800
Message-ID: <CABp3FNLy0qKXax1mWR380qsO1D7+959bSCWvJ8pwrG_AC8QGTg@mail.gmail.com>
To: W3C RDFWA WG <public-rdfa-wg@w3.org>
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

Bertrand Russell in a footnote of Principles of Mathematics
Received on Tuesday, 6 March 2012 21:15:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:56 UTC