- From: Benjamin Adrian <benjamin.adrian@dfki.de>
- Date: Tue, 27 Apr 2010 10:51:45 +0200
- To: Toby Inkster <tai@g5n.co.uk>
- CC: public-rdfa-wg@w3.org
Hi Toby, I really like this idea. From my point of view, we should make it so. Ben Toby Inkster schrieb: > This is a proposal to create a superclass of blank nodes and URI > references; and provide some extra methods and attributes on this > superclass to make the current Projection interface unneeded. > > For want of a better term, I'll call this superclass "Resource" as > it's analogous to an rdfs:Resource. > > interface Resource { > readonly attribute DOMString value; > readonly attribute Node element; > readonly attribute Sequence[URI] properties; > [NameGetter] Sequence[any] get (in DOMString name); > } > > The rdfa.extractObject/rdfa.project method would no longer be needed. > > Given a page containing: > > <a vocab="http://xmlns.com/foaf/0.1/" > about="#me" typeof="Person" > rel="homepage" href="http://example.net/" > property="name" content="Joe Bloggs"> > <span property="http://purl.org/dc/terms/title" > >Joe's World of Fun</span> > </a> > > A script could do something like this: > > >>> joe = new URI("#me"); > >>> joe = new Resource("#me"); /* either works */ > >>> name = joe['http://xmlns.com/foaf/0.1/name'][0]; > >>> /* name is a PlainLiteral object */ > >>> print(name); > Joe Bloggs > >>> page = joe['http://xmlns.com/foaf/0.1/homepage'][0]; > >>> /* page is a URI object, hence also a Resource object */ > >>> title = page['http://purl.org/dc/terms/title'][0]; > >>> print(title); > Joe's World of Fun > > -- __________________________________________ Benjamin Adrian Email : benjamin.adrian@dfki.de WWW : http://www.dfki.uni-kl.de/~adrian/ Tel.: +49631 20575 145 __________________________________________ Deutsches Forschungszentrum für Künstliche Intelligenz GmbH Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern Geschäftsführung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes Amtsgericht Kaiserslautern, HRB 2313 __________________________________________
Received on Tuesday, 27 April 2010 08:52:22 UTC