This is a syntax brush I have created for the SPARQL for the Crayon Syntax Highlighter. The brush recognizes the following elements:

  1. Reserved words: such as SELECT, WHERE</li>
  2. Resources (IRI): such as <> or <Given_Name>, which are currently recognized as strings.</li>
  3. Quoted string literals: such as "Johnny"</li>
  4. Varaibles: such as $name


Use the brush name sparql to highlight SPARQL code blocks. A sample code block follows.

PREFIX a: <>
PREFIX dc: <>
PREFIX foaf: <>

# Comment!

SELECT ?given ?family
  ?annot a:annotates <> .
  ?annot dc:creator ?c .
  OPTIONAL {?c foaf:given ?given ;
               foaf:family ?family } .
  FILTER isBlank(?c)


The source code of this brush is hosted on GitHub. To install, download and unzip in the lang directory of Crayon.

cd wordpress/wp-content/plugins/crayon/lang
mv crayon-highlighter-sparql-brush-master sparql

Alternatively, you may also clone the git repository.