Re: Extending Sparql with New Keywords

2018-02-07 Thread Andy Seaborne
It should also run using cygwin. What yuo can do is directly edit the arq.jj file (its the intermediate output of the process and is the javacc file), and run javacc yourself as given in the "grammar" script. javacc -OUTPUT_DIRECTORY=$DIR -JDK_VERSION=1.7 "${FILE}" The setting of $DIR is a

Re: Extending Sparql with New Keywords

2018-02-07 Thread Jean-Marc Vanel
Hi As a thesis student , it is good to have some background knowledge on parsers and compilers; here is THE classic book on the subject: https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools

Re: Extending Sparql with New Keywords

2018-02-07 Thread Rob Vesse
You run the grammar script directly at a shell prompt, this requires a *nix OS, it is not supported under Windows i.e. > ./grammar It then automatically applies the C pre-processor to the master.jj file to generate the other .jj files and then calls javacc over those to generate the Java

Re: Extending Sparql with New Keywords

2018-02-07 Thread Berkin Özdemir Bengisu
Thanks a lot for all the help! I am considering adding some decision keywords such as USING or BASED ON, then define my functions according to the tokens after those keywords. Could you please explain the "preprocessing the master.jj using grammar script" part a bit more detailed? I was unable

Re: Extending Sparql with New Keywords

2018-02-06 Thread Rob Vesse
This is entirely possible but it is not at all trivial. We have been doing this for several years to add several extensions to the language. The extent of the necessary changes Will vary depending on what your extensions are intended to do. To start with the grammar. You can find the input

Re: Extending Sparql with New Keywords

2018-02-06 Thread Andy Seaborne
Hi, The parser is in jena-arq/Grammar/master.jj You are right it is run separately - there is a script to run it : jena-arq/Grammar/grammar. The script also cleans up the output java to remove warnings. In master.jj, you will find it has multiple parsers, controlled by cpp processing

Re: Extending Sparql with New Keywords

2018-02-05 Thread Berkin Özdemir Bengisu
This is actually a part of my master thesis, I will also extend the processor and add my own functions according to the keywords. Basically my aim is to form a new language by extending sparql 1.1. 2018-02-05 23:55 GMT+02:00 Martynas Jusevičius : > Berkin, > > unless

Re: Extending Sparql with New Keywords

2018-02-05 Thread Martynas Jusevičius
Berkin, unless this is some kind of exercise, is this really a good idea? What would be the adoption rate of your new language? All SPARQL 1.1 processors will report errors in your extended syntax. On Mon, Feb 5, 2018 at 9:42 PM, Berkin Özdemir Bengisu < berkinozdemirbeng...@gmail.com> wrote: >

Extending Sparql with New Keywords

2018-02-05 Thread Berkin Özdemir Bengisu
Hello, I am using jena 3.6.0 and I would like to extend the sparql 1.1 grammar with some new keywords. Could you please help me what would be the best way to start with? - As I understood, the grammar is generated by javaCC but I was unable to find any documentation or any main classes that