SPARQL Syntax Coloring and Errors
As the Good Doctor’s students have probably never even heard of RDF in their entire life, I thought it would be nice to provide a little help for them. That and I’ve wanted to tinker with Eclipse’s syntax coloring for a while now (probably the real reason). Voila:

You’ll also notice that the solutions at the bottom can be sorted now. This is a great benefit because when the ORDER BY clause is used in a SPARQL query, all the solutions are collected before they can be sorted and finally displayed, which can take quite a long time. But when you sort on a column instead, the solutions are sorted as they arrive.
Rather than throw an exception when a bad query is executed, I thought it would be nice to provide a little feedback here as well:

(Don’t strain your eyes, the error is a missing semicolon on the tenth line.)
Originally I tried underlining just the part that is incorrect, but the ARQ SPARQL parser returns inconsistent line and column numbers. So I just settled on underlining the entire query. When an ORDER BY clause is used, the query is underlined with a yellow squiggle with hover text that suggests clicking a column header instead (the query is still executed, however).
Technorati Tags:
Filed in 

