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

Re: RDF API - Element Subject?

From: Alex Milowski <alex@milowski.com>
Date: Wed, 23 May 2012 13:55:28 -0700
Message-ID: <CABp3FNKwFP=j2EM=voX_6Qex4Ta6RM3FhW=Mo5xiY0PwWMvPMA@mail.gmail.com>
To: W3C RDFWA WG <public-rdfa-wg@w3.org>
...and if you have a 1-1 relationship between an element and a single
subject, you could just have a "subject" property:

   document.getElementsByType("schema:Person")[0].subject

i.e. the subject of the first schema:Person typed element in the document.

On Wed, May 23, 2012 at 1:48 PM, Alex Milowski <alex@milowski.com> wrote:
> 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



-- 
--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:55:59 GMT

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