ISSUE-53: DataParser Upgrades [RDFa 1.1 API]

ISSUE-53: DataParser Upgrades [RDFa 1.1 API]

http://www.w3.org/2010/02/rdfa/track/issues/53

Raised by: Nathan Rixham
On product: RDFa 1.1 API

In line with the proposals in ISSUE-51, this issue primarily allows parsers to keep a light memory footprint, which often needed, especially on mobile devices.

Web IDL:

[NoInterfaceObject]
[Constructor, Constructor(in DataContext context)]
interface DataParser {
    boolean parse (in any toparse, in DataStore store, in optional RDFTripleCallback filter);
    boolean process (in any toparse, in DataProcessor processor, in optional RDFTripleCallback filter);
};

[NoInterfaceObject Callback]
interface DataProcessor {
    void process (RDFTriple triple);
}; 

Changes:
DataParser looses the Callback extended attribute

DataParser.parse gains an optional filter which allows only triples matching a given filter to be added to the store.

DataParser.process is added which rather than adding triples to a store, executes a given callback on each triple, thus allowing say all telephone numbers in a document to be highlighted without storing any data / increasing memory usage, this method also has the optional `filter` property functioning the same as that on DataParser.parse.

DataParser gains a constructor parameter which accepts a DataContext, as parsers require access to TypedLiteral conversion functions, and to the create*** methods.

A new DataProcessor Callback interface is added with only one parameter, triple (to keep things light).

Received on Thursday, 28 October 2010 01:19:10 UTC