Re: N3.js 0.2.0: now with browser support

On 05.12.13 12:27, Ruben Verborgh wrote:

Hi Claus, hi Ruben,

>> Sorry if I missed a relevant part of the discussion, but would it
>> be possible to re-use and extend an existing SPARQL parser?

Good question and as I missed those classes during my studies I am not
really sure if I write complete BS now so I just give it a try:

The whole SPARQL parser idea I had for two reasons:

- I never wrote a parser or had a look at how it's done according to the
CS classes. So I thought I need to do it once up to some point at least
- I was pretty sure that at least Matteo would be interested in it and
the work could be re-used by others like Austin (I talked about that
subject once with him on IRC)

Then I stumbled over a video from Crockford:

https://www.youtube.com/watch?v=9e_oEE72d3U

Where he claims writing parsers is easy with TDOP :)

As mentioned his description is here, which I found a bit confusing:

http://javascript.crockford.com/tdop/tdop.html

These two articles implement it in Python and explain it a bit better IMHO:

http://effbot.org/zone/simple-top-down-parsing.htm

http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing/

The lexer is slowly getting ahead, the bigger challenge will be a TDOP
based implementation of the SPARQL syntax.

Now my question is am I completely on the wrong track here and should we
stick to parser generators and describe the syntax simply in EBNF as
Antonio & Austin probably do?

> I don't know to what extent the "Turtle" inside SPARQL graphs
> is/should be compatible with the latest Turtle CR (with of course the
> exception of variables). However, if it is/should be, I see parsing
> Turtle as a subproblem of parsing SPARQL. And since passing Turtle CR
> spec suite has been non-trivial for many parser authors (including
> myself), I wonder how easy it is to create SPARQL parsers.
> 
> If the "Turtle" used by SPARQL is not supposed to be CR-compatible,
> this argument is void of course.

From what I know this should not be much different if at all.

regards

Adrian

-- 
Adrian Gschwend
@ netlabs.org

ktk [a t] netlabs.org
-------
Open Source Project
http://www.netlabs.org

Received on Thursday, 5 December 2013 15:24:36 UTC