Turtle (RDF Syntax)
Turtle (Terse RDF Triple Language) is a compact, human-readable syntax for RDF graphs, standardized as a W3C recommendation in February 2014. It is a superset of N-Triples and a subset of Notation3, uses the .ttl file extension and text/turtle media type, and shares syntax with the SPARQL query language.
Turtle, short for Terse RDF Triple Language, is a textual syntax for serializing RDF graphs. It was originally designed by Dave Beckett as a friendlier alternative to RDF/XML and became a W3C recommendation on February 25, 2014. The standard file extension is `.ttl`, the registered media type is `text/turtle`, and documents are required to be UTF-8. A Turtle document is a sequence of triples written as subject, predicate, object separated by whitespace and terminated by a period. URIs are written between angle brackets or, more commonly, as compact CURIEs after a `@prefix` declaration that binds a short alias to a base URI. Literals are written in quotes, with an optional `^^xsd:datatype` suffix or `@lang` tag. Several abbreviations shorten common cases: a semicolon repeats the subject for additional predicates, a comma repeats both subject and predicate for additional objects, and square brackets introduce blank nodes inline. Turtle sits at a useful point in the family of RDF formats. It is a strict superset of N-Triples, the minimal line-based format used for streaming and diffing, and a strict subset of Notation3 (N3), which adds features beyond the RDF model such as rules and quoted formulas. SPARQL adopted Turtle's triple syntax for its WHERE patterns, so the same prefix declarations and compact URIs read the same way in queries and data. In practice Turtle is the format most often used when humans need to read, write, or review RDF directly, such as authoring ontologies, fixtures for tests, or examples in specifications. Production datasets are still commonly distributed in N-Triples or JSON-LD, but Turtle is the lingua franca of the Linked Data and RDF tutorial and documentation ecosystem.