streamreasoning / CSPARQL-engine

reasoning over RDF stream made easy
Other
34 stars 23 forks source link

TimeUnit "ms" impossible #20

Open wherget opened 8 years ago

wherget commented 8 years ago

Since I'm currently knee-deep in the parser grammar, I stumbled across this bit here:

    t = <SINGLELETTERTEXT> {
        timeunit = timeunit + t.image ;
        if(!timeunit.equals("ms") && !timeunit.equals("s") && !timeunit.equals("m") && !timeunit.equals("h") && !timeunit.equals("d"))
        throw new ParseException();
    }

where

<SINGLELETTERTEXT: ["a"-"z","A"-"Z"] >

As it turns out, specifying STEP 2ms doesn't work. (ParseException: Encountered " <SINGLELETTERTEXT> "s "").

pedromj commented 8 years ago

I am experimenting with C-SPARQL and found the same issue. I have tried to check the code to try to fix it by myself but I am not familiar at all with parsers like this one. If anybody can give a hint on how to do it, please let us know. Thank you.

wherget commented 8 years ago

I did fix (at least the parser part of) this particular issue on my rework-parser branch. I haven't tried if cherry-picking the one relevant commit (07839b0) works, but it looks to me like it should. I haven't yet submitted a PR since I felt like I could improve the parser quite a bit still from what the current state on that branch is. However, we're not currently working on the CSPARQL based project that originated that branch anymore, so time for improving the parser is pretty much nonexistent.