W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > June 2010

[rdfaapi] setMapping() should be avaiable at the top level

From: Mark Birbeck <mark.birbeck@webbackplane.com>
Date: Sat, 12 Jun 2010 16:49:10 +0100
Message-ID: <AANLkTilyV8Txcd9YNUC3XHwmyszfXkZNCVBXanRMKU4o@mail.gmail.com>
To: RDFa WG <public-rdfa-wg@w3.org>
Since mappings can be used in functions that are defined to be used by
'entry-level' programmers, such as getItemsByType():

  var people = document.getItemsByType("foaf:Person");

then it makes sense that programmers should be able to set those
mappings from an 'entry-level' interface.

So, instead of this:

  document.data.context.setMapping("foaf", "http://xmlns.com/foaf/0.1/");

programmers should be able to do this:

  document.setMapping("foaf", "http://xmlns.com/foaf/0.1/");

A full example would therefore be:

  document.setMapping("foaf", "http://xmlns.com/foaf/0.1/");

  var people = document.getItemsByType("foaf:Person");

(This is probably best achieved by moving the default DataContext
object to the document object, but the 'how' is a separate



Mark Birbeck, webBackplane



webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)
Received on Saturday, 12 June 2010 15:49:44 UTC

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