Re: RDF API - Element Subject?

...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 UTC