% Usage:
% \usepackage{wdqs}
% or, if you need to squeeze the code together a bit:
% \usepackage[scaled]{wdqs}
% You can also select the font with the inconsolata, dejavu or vera options (default: dejavu)
% And then:
% \lstset{language=[wdqs]sparql}


% The WDQS font-family list is: Menlo (Apple, proprietary), Monaco (Apple, proprietary), Consolas (Windows, proprietary), Courier New (Windows, proprietary), monospace (generic)
% There are several choices to approximate them:
% - Bitstream Vera, upon which Menlo is based.
% - Deja Vu, a modification of Bitstream Vera upon which Menlo is also based.
% - Inconsolata, which approximates Consolas.
% The default choice is Deja Vu.
% Additionally, all three fonts accept a [scaled] option, which this package passes along to them.



% SPARQL dialect that uses keywordstyle for ?variables and keywordstyle[2] for actual keywords
  keywords={}, % clear keywords
  keywordsprefix=?, % everything that starts with ? is a "keyword" (even, unfortunately, in comments)
        isIRI,isURI,isBLANK,isLITERAL,REGEX,true,false}, % add the regular keywords, but as [2]
  morekeywords=[2]{SERVICE}, % extra keywords not in the original listings sparql language
  alsoletter={:?}, % : in wd:Q42 and ? in ?person are both part of the identifier and should be colored
  basicstyle=\ttfamily % select Inconsolata

% colors from WDQS CSS
\definecolor{sparql_comment}{HTML}{aa5500} % CSS class cm-comment
\definecolor{sparql_keyword}{HTML}{770088} % CSS class cm-keyword
\definecolor{sparql_atom}{HTML}{221199} % CSS class cm-atom
\definecolor{sparql_variable}{HTML}{0055aa} % CSS class cm-variable-2
\definecolor{sparql_string}{HTML}{aa1111} % CSS class cm-string

% SPARQL dialect that uses the WDQS syntax highlighting colors