Some questions regarding the N3 Grammar

Over the past month or so Jos DeRoo and myself have been closely examining 
the n3 grammar in connection with some work we are doing using proof based 
engines and Euler. 
We encountered the following points in the context of developing a javacc 
(actually jjtree)  based parser for n3 and a thorough review of  a 
collection of n3 tests. 
 The main issues we have encountered are:

1.  dtlang 

   Is it deliberate that the grammar specifies that language strings be 
all lower case?  Many of the test cases we have been working with include 
annotations of the form @en-US
  (aside : Apart from the inconsistency with the test data we tend to lean 
towards the more retrictive form ... ) 

2.  typed variables   ?x^^type:b

The grammar currently does not allow typed variables - only typed 
literals.   This is of much more concern to us as we need to make use of 
such variables in queries. 

3.  ?x^^?b 

Again, we need to make such queries  and it turns out are using the 
notation in Euler.

4.  language and type    "abc"@fr-us^^a:b

Once again, these come up in some of the queries -  e.g.  locale specific 
notations for integers .

 I will also take the opportunity to ask the following:

5.  The issue  "@keywords affects tokenizing" is listed under the 
outstanding issues in n3.n3.  While there are mechanisms in javacc to 
allow you to affect the tokenizing
in this way, it is  harder to get at them automatically ( we have not done 
so yet) and it does contaminate an otherwise clean separation between 
syntax and semantics.
What is the current thinking on this?     (Except for this, we are 
approaching the point where we can automatically generate our jjtree 
grammar from n3.n3., especially if
we are lazy and do two passes (one to repair key words first.)) 

The real problem is not with  key words like "a" that maintain  the same 
syntactic role. Rather is is the changes like "of" that trigger an 
entirely different parse tree. 
I am also concerned that while there is a mechanism to transform the "of" 
into "@of"  interpretation,  this can happen anywhere in the source file 
which is oakay,
but then I'd kind of expect to be able to undo it.

I understand the desire to have a locale like localization of the key 
words but this does leave things in an untidy state so any feedback would 
be most welcome.
(pointers to appropriate discussion would be most welcome)

Thanks in advance.

Stan Devitt
Agfa Healthcare.

Received on Friday, 15 April 2005 06:25:28 UTC