You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since there is no proper/applicable SPARQL query builder solution available for Python, SPARQL query modification in RDFProxy currently has to rely on regexes. Obviously, this is a huge pain.
A much more stable, reliable and sane approach of doing dynamic query modification would be to modify a parse tree instead of strings. So it would be really nice if somebody (me) came up with a parser capable of dynamic parse tree modification. RDFLib's SPARQL parser is built with pyparsing, so this is likely not an option.
The text was updated successfully, but these errors were encountered:
lu-pl
added
the
refactor
Implementation changes that preserve external interfaces and the behavior of the software.
label
Jan 24, 2025
I am of the opinion that a lark parser would be a good solution, lark has neat Transformer and Visitor abstractions for operations on the parse tree and is generally really powerful. Also, lark's grammar syntax is very close to EBNF.
larql is an attempt to create a Lark parser for SPARQL 1.1. It tests against w3c rdf-tests, currently 1/3 of the tests are failing, almost all of them concern Update Requests. Working on it.
update: the remaining failing tests are often about SPARQL semantics, not its syntax. So larql will probably have to provide a thin-ish wrapper for semantic pre- and post processing of parsed queries.
Since there is no proper/applicable SPARQL query builder solution available for Python, SPARQL query modification in RDFProxy currently has to rely on regexes. Obviously, this is a huge pain.
A much more stable, reliable and sane approach of doing dynamic query modification would be to modify a parse tree instead of strings. So it would be really nice if somebody (me) came up with a parser capable of dynamic parse tree modification. RDFLib's SPARQL parser is built with
pyparsing
, so this is likely not an option.The text was updated successfully, but these errors were encountered: