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

RDF API - Element Subject?

From: Alex Milowski <alex@milowski.com>
Date: Wed, 23 May 2012 13:48:51 -0700
Message-ID: <CABp3FN+Yi17M9pyH_jwQQ4O86rU2NoXM6BSuYS4R6BXfqDWVsw@mail.gmail.com>
To: W3C RDFWA WG <public-rdfa-wg@w3.org>
You can easily get elements by type:

   document.getElementByType("schema:Person");

but once you have an element retrieved as such, deriving the subject
isn't so easy.

I just added to my client API implementation:

   document.getElementSubject(element)

which will return the subject associated with that origin in the
document.  This works well for my implementation as I trace all
subject origins.

I could just as easily added a projection constructor:

   document.getProjectionByType("schema:Person");

and that would return the project along with the subject.  But, as the
projection doesn't have the subject origin (which can be multiple
elements), it does allow you to process documents where you select
elements by type and then use the subject to get additional
properties.

I believe that, according to the RDFa 1.1 Sequence algorithm, a
element will only have a single subject associated with it.

-- 
--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 Wednesday, 23 May 2012 20:49:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 23 May 2012 20:49:23 GMT