GNOME Bugzilla – Bug 583209
Syntax Highlighting for the Standard SPARQL Query Language
Last modified: 2009-11-30 19:19:10 UTC
SPARQL has been a W3C Recommendation since 15 January 2008 and should be included as a highlighting mode along with SQL. More information about the SPARQL syntax can be found here: http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/
Created attachment 134935 [details] SPARQL Syntax for language-spec 1.0 Blogged about it here: http://jamesrdf.blogspot.com/2009/04/in-searching-for-highlighting-mode-for.html
this file seems to use the old and outdated 1.0 format. While still supported for backward compatibility, we do not ship any .lang with this format anymore. The new lang format is more expressive and powerful: see http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-tutorial.html http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-reference.html also, please if needed, submit a request for a specific mime type to bugs.freedestop.org
Created attachment 134964 [details] SPARQL Syntax for language-spec 2.0 Converted spec file to version 2.0
Created attachment 135034 [details] SPARQL Syntax for language-spec 2.0 Updated the IRI regex expression.
Created attachment 135092 [details] SPARQL Syntax for language-spec 2.0 Fix the backslashes in the IRI regex
the file looks good to me except for one minor thing, would be great if you could organize the file in a different way: http://git.gnome.org/cgit/gtksourceview/tree/gtksourceview/language-specs/csharp.lang there are several context and then the lang context that includes the other ones. In this way it is easier to check if something is wrong in the future.
Created attachment 148761 [details] SPARQL Syntax for language-spec 2.0 Change the layout, updated syntax to a SPARQL 1.1 Draft, and added more standard vocabularies. Note that the mimetype is application/sparql-query and the file extension is *.rq http://www.w3.org/TR/rdf-sparql-query/#mediaType
Also if it is possible would be great if you could attach a test file no more than 10 lines so we can include it in our test script.
About the file I've just had a quick look and it is really good but I'd like to see some minor changes: - Please Add one empty line between contexts - <style id="namespace" _name="namespace" map-to="def:builtin"/> <- I'd put the first char in capital letter - and about the regexes I'd put them in several lines so they aren't so long and they are easier to look at. Thanks a lot for the file.
Created attachment 148762 [details] SPARQL Syntax for language-spec 2.0 Wrap regex on multiple lines, change _name attributes to initcap, and add a blank lines around <definiations>
Created attachment 148763 [details] Sample SPARQL file
Thank you for it, I've just pushed the language file.