Turtle was defined by Dave Beckett as a subset of Tim Berners-Lee and Dan Connolly's Notation3 (N3) language, and a superset of the minimal N-Triples format. Unlike full N3, which has an expressive power that goes much beyond RDF, Turtle can only serialize valid RDF graphs. Turtle is an alternative to RDF/XML, the original syntax and standard for writing RDF. As opposed to RDF/XML, Turtle does not rely on XML and is generally recognized as being more readable and easier to edit manually than its XML counterpart.
SPARQL, the query language for RDF, uses a syntax similar to Turtle for expressing query patterns.
In 2011, a working group of the World Wide Web Consortium (W3C) started working on an updated version of RDF, with the intention of publishing it along with a standardised version of Turtle. This Turtle specification was published as a W3C Recommendation on 25 February 2014.1
A significant proportion of RDF toolkits include Turtle parsing and serializing capability. Some examples of such toolkits are Redland, RDF4J, Jena, Python's RDFLib and JavaScript's N3.js.
The following example defines 3 prefixes ("rdf", "dc", and "ex"), and uses them in expressing a statement about the editorship of the RDF/XML document:
(Turtle examples are also valid Notation3).
The example encodes an RDF graph made of four triples, which express these facts:
Here are the triples made explicit in N-Triples notation:
The MIME type of Turtle is text/turtle. The character encoding of Turtle content is always UTF-8.2
TriG RDF syntax extends Turtle with support for named graphs.
"RDF 1.1 Turtle - Terse RDF Triple LanguageTurtle". World Wide Web Consortium (W3C). 25 February 2014. Retrieved 16 December 2015. http://www.w3.org/TR/turtle/ ↩
"MIME Media Types: text/turtle". Internet Assigned Numbers Authority (IANA). 28 March 2011. Retrieved 27 November 2011. https://www.iana.org/assignments/media-types/text/turtle ↩