ljos / sparql-mode

A SPARQL mode for emacs
GNU General Public License v3.0
62 stars 23 forks source link

sparql-update-mode, tarql-mode; syntax checking with flycheck #70

Open VladimirAlexiev opened 2 years ago

VladimirAlexiev commented 2 years ago

@ljos thanks for your very excellent mode! I also use it for writing SPARQL UPDATEs and TARQL tabular conversions.

Could you make 2 more derived modes: sparql-update-mode (ext *.ru), tarql-mode (ext *.tarql)?

So the only thing that I'm missing is syntax checking.

Output examples:

qparse --query foo.rq
Encountered " <DELETE_WHERE> "delete where "" at line 5, column 1.
qparse --query bar.rq
Lexical error at line 2, column 11.  Encountered: " " (32), after : "z"
qparse --query baz.rq
Line 2, column 17: Unresolved prefixed name: ...

update --update foo.ru
org.apache.jena.query.QueryParseException: Variable used when already in-scope: ?upd in ((AGG ?.0 MAX(?new)) AS ?upd)
update --update bar.ru
org.apache.jena.query.QueryParseException: Encountered " "." ". "" at line 6, column 67.

tarql foo.tarql
Error parsing SPARQL query: Encountered " <DELETE_WHERE> "delete where "" at line 5, column 1.
tarql bar.tarql
Error parsing SPARQL query: Lexical error at line 1, column 1.  Encountered: "\u0016" (22), after : ""
tarql baz.tarql
Error parsing SPARQL query: Line 2, column 17: Unresolved prefixed name: ...