Hi Nic, Not sure about the quality of these, and they are not exactly EBNF, but there is:
- https://github.com/antlr/grammars-v4/blob/master/sparql/Sparql.g4 - https://github.com/rollxx/antlr-sparql-grammar They may be easy to convert to EBNF. Iwan Aucamp On Wed, Jul 6, 2022 at 4:07 AM Nicholas Car <n...@kurrawong.net> wrote: > Dear RDFlibbers, > > Does anyone have either a plain EBNF grammar for SPARQL or a Lark Python > grammar file for it? > > I am trying to build up a canonical more modern PEG for SPARQL to perhaps > slot in to RDFLib. > > I see W3C EBNF SPARQL grammars out there, e.g. > https://github.com/dundalek/GrammKit/blob/master/examples/sparql.ebnf, > but not 'pure' EBNF and I can't find a Lark implementation. > > If I really can't find one, I'm going to have to either convert the W3C > EBNF to plain EBNF and use something like Tatsu ( > https://pypi.org/project/TatSu/) or convert straight to a Lark Python > grammar and use Lark as I need a Python SPARQL grammar checker. > > Any other suggestions for SPARQL grammar use in Python welcome! > > Thanks, Nick > > -- > http://github.com/RDFLib > --- > You received this message because you are subscribed to the Google Groups > "rdflib-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rdflib-dev+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rdflib-dev/HwfN2AUiWR1-5X5X2JGX4NmRvCIJxO6AYOdnTsk7hHYw2n0nzy4TjrKlyDyWBQQ4f7f74aqDk0uKnrRc2-xqQdl-jQNHWD7kdbfN3HStMvY%3D%40kurrawong.net > <https://groups.google.com/d/msgid/rdflib-dev/HwfN2AUiWR1-5X5X2JGX4NmRvCIJxO6AYOdnTsk7hHYw2n0nzy4TjrKlyDyWBQQ4f7f74aqDk0uKnrRc2-xqQdl-jQNHWD7kdbfN3HStMvY%3D%40kurrawong.net?utm_medium=email&utm_source=footer> > . > -- http://github.com/RDFLib --- You received this message because you are subscribed to the Google Groups "rdflib-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/CAGjV75DvjN%3DDZFaQRr3VqQPfPBsG_Z10zCim6KwM55jFrfoWew%40mail.gmail.com.