W3C home > Mailing lists > Public > public-cwm-talk@w3.org > January to March 2005

@keywords: Notation3 Pre-Processor

From: Sean B. Palmer <sean+cwm@infomesh.net>
Date: Fri, 14 Jan 2005 11:52:26 +0000
Message-ID: <41E7B27A.6020406@infomesh.net>
To: Tim Berners-Lee <timbl@w3.org>, Yosi Scharf <syosi@mit.edu>
CC: public-cwm-talk@w3.org

Hi,

I've written an @keywords pre-processor that tokenizes whilst still
supporting both langcodes and buffered input:

    http://inamidst.com/n3p/n3pp.py
    - Notation3 Pre-Processor

I tested it by running it against the n3p test-suite; in its default
mode it simply spits out @keywords-less N3 with all keywords made
explicit using the "@" decorator. Hence the following:

    $ ./runtest ../n3proc.py input
    [...] Passes: 66; Failures: 0

    $ ./runtest -- ../n3pp.py input \| \
       ../n3proc.py --baseURI=input /dev/stdin
    [...] Passes: 66; Failures: 0

Sidenote: n3pp.py doesn't remove the @keywords declarations entirely, it
merely reduces them to "@keywords ." each time. That's so that
"@keywords . p q r ." won't get output as something that N3 processors
can't handle at the moment. Were pre-processing to become vogue, N3
processors could assume that barenames are always QNames, since they
always will be in normalized N3.

Thanks,

-- 
Sean B. Palmer, http://inamidst.com/sbp/
Received on Friday, 14 January 2005 11:53:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:01 GMT