Improving RDF support in pygments syntax highlighter

Skip to first unread message

elf Pavlik

Nov 2, 2020, 6:05:43 PM11/2/20
to rdflib-dev


I came across bug in pygments highlighting of Turtle. I don't work with python but I managed to put together a PR which hopefully will fix that issue:

Pygments has lexers for SPARQL, Turtle and ShExC. They have quite a bit of duplication and Turtle appears to be written before other two.

I just wanted give shout out to RDFlib community to see if someone would be interested in improving RDF support in pygments. It is used by and growing number of W3C groups uses it for drafting specs and notes.


Nicholas Car

Dec 27, 2020, 8:37:39 PM12/27/20
Hi elf,

Thanks for identifying and fixing that Pygments bug. I'm aware of the other two lexers for SPARQL & ShEx (at least the ShEx one was written by Harold Solbrig who is on this list I think). 

What do you suggest we could do to "improve RDF support in pygments"? Are you after someone from RDFlib to check syntax highlighting created by the Turtle and other lexers or are you after downstream use of Pygments within RDFlib?



You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit


kind regards
Dr Nicholas Car
Data Systems Architect at SURROUND Australia Pty Ltd
Address  Level 9, Nishi Building,
                  2 Phillip Law Street
                  New Acton Canberra 2601
Phone     +61 477 560 177 
Email       nichol...@surroundaustralia.comWebsite

Enhancing Intelligence Within Organisations

delivering evidence that connects decisions to outcomes

Australian-National-University-Logo-1 – ANU Centre for Water and Landscape  Dynamics

Dr Nicholas Car
Adj. Senior Lecturer

Research School of Computer Science

The Australian National University
Canberra ACT Australia 

Reply all
Reply to author
0 new messages