(require 'flycheck)
(flycheck-define-checker sparql-syntax
"A SPARQL syntax checker using ARQ qparse. See URL https://jena.apache.org/documentation/query/cmds.html."
:command ("qparse.bat" "--query" source)
:error-patterns
((error line-start "Encountered \"" (message) "\" at line " line ", column " column "." line-end)
(error line-start "Lexical error at line " line ", column " column "." (+ space) "Encountered: " (message) line-end))
:modes sparql-mode)
(add-to-list 'flycheck-checkers 'sparql-syntax)
(add-hook 'sparql-mode-hook 'flycheck-mode)
https://github.com/ljos/sparql-mode/issues/70 asks for similar modes sparql-update-mode and tarql-mode but haven't been implemented yet. The validation sort of works for such files, but not quite.
I use these to associate various extensions to SPARQL mode:
SPARQL validation with
flycheck
using jenaqparse
from https://github.com/ljos/sparql-mode/issues/29:https://github.com/ljos/sparql-mode/issues/70 asks for similar modes
sparql-update-mode
andtarql-mode
but haven't been implemented yet. The validation sort of works for such files, but not quite.