# Turtle (syntax)

**Turtle** (Terse RDF Triple Language) is a textual syntax for the [Resource Description Framework](https://www.edgepedia.org/resource-description-framework) (RDF), a general-purpose language for representing information on the Web, that allows an RDF graph to be written in a compact and natural text form with abbreviations for common usage patterns and datatypes.<sup>[1](https://www.w3.org/TR/turtle/)</sup> It is a W3C Recommendation dated 25 February 2014 and forms part of the RDF 1.1 document suite.<sup>[1](https://www.w3.org/TR/turtle/)</sup><sup> • </sup><sup>[2](https://www.w3.org/standards/history/rdf11-turtle/)</sup>

| Key fact | Detail |
|---|---|
| Full name | Terse RDF Triple Language; a concrete syntax for RDF<sup>[1](https://www.w3.org/TR/turtle/)</sup> |
| Standard status | W3C Recommendation, 25 February 2014, part of the RDF 1.1 suite<sup>[2](https://www.w3.org/standards/history/rdf11-turtle/)</sup> |
| Basic unit | A triple of subject, predicate, and object, terminated by a period<sup>[1](https://www.w3.org/TR/turtle/)</sup> |
| Abbreviations | Prefix directives, predicate lists with `;`, blank node property lists `[ ]`, and collections `( )`<sup>[1](https://www.w3.org/TR/turtle/)</sup> |
| Compatibility | Levels of compatibility with N-Triples and with the triple pattern syntax of SPARQL<sup>[1](https://www.w3.org/TR/turtle/)</sup> |
| Media type | `text/turtle` (also the legacy `application/x-turtle`); typical file extension `.ttl`<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC10696869/)</sup> |
| Related formats | RDF/XML, N-Triples, N-Quads, TriG, JSON-LD, TriX<sup>[4](https://rdf4j.org/about/)</sup> |

## Purpose and position among RDF formats

RDF describes information as a graph of triples, each consisting of a subject, a predicate, and an object.<sup>[1](https://www.w3.org/TR/turtle/)</sup> Turtle is one of several concrete serializations of that graph. Compared with [RDF/XML](https://www.edgepedia.org/rdf-xml), which uses an XML tree structure, Turtle is compact, human-readable text; compared with [N-Triples](https://www.edgepedia.org/n-triples), which writes one complete triple per line with no abbreviations, Turtle adds syntactic shortcuts such as prefixes.<sup>[5](https://inferensys.com/glossary/enterprise-knowledge-graphs/knowledge-representation-languages/json-ld-json-for-linked-data)</sup><sup> • </sup><sup>[6](https://travesia.mcu.es/bitstreams/201267df-468f-4d6b-9344-6cdb4d99633b/download)</sup> N-Triples is often chosen for line-based streaming or diffing, RDF/XML for older XML tooling, and JSON-LD for embedding structured data in web pages or [JavaScript](https://www.edgepedia.org/javascript) work, while Turtle is chosen when a compact, human-readable result matters.<sup>[7](https://fix42.com/tools/json-to-rdf/)</sup>

Turtle also provides levels of compatibility with the N-Triples format and with the triple pattern syntax of the SPARQL W3C Recommendation, so that N-Triples documents and SPARQL query patterns read naturally alongside Turtle data.<sup>[1](https://www.w3.org/TR/turtle/)</sup>

## Language features

**Simple triples.** The simplest statement is a sequence of subject, predicate, and object terms separated by whitespace and terminated by a period, as in `<http://example.org/#green-goblin> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> .`<sup>[1](https://www.w3.org/TR/turtle/)</sup> Comments follow a `#` that is not part of another lexical token and continue to the end of the line.<sup>[1](https://www.w3.org/TR/turtle/)</sup>

**Prefixes.** A prefixed name is a prefix label and a local part separated by a colon, turned into an IRI by concatenating the IRI associated with the prefix and the local part. The `@prefix` directive associates a prefix label with an IRI, and later directives may re-map the same label; `@base` or `BASE` sets the base IRI against which relative IRI references such as `<#green-goblin>` are resolved.<sup>[1](https://www.w3.org/TR/turtle/)</sup> The Turtle language originally permitted only the `@`-character forms; the case-insensitive `PREFIX` and `BASE` forms were added to align Turtle's syntax with SPARQL's.<sup>[1](https://www.w3.org/TR/turtle/)</sup>

**The `a` keyword.** In the predicate position of a triple, the token `a` represents the IRI `http://www.w3.org/1999/02/22-rdf-syntax-ns#type`, the RDF type property.<sup>[1](https://www.w3.org/TR/turtle/)</sup><sup> • </sup><sup>[13](https://www.w3.org/TR/rdf12-turtle/)</sup>

**Predicate lists.** When the same subject carries several predicates, a predicate list matches a series of predicates and objects separated by semicolons following one subject, expressing a series of triples that share it.<sup>[1](https://www.w3.org/TR/turtle/)</sup>

**Blank node property lists.** A bracketed `[ ... ]` structure describes an unnamed node and its properties inline, for example `[] foaf:knows [ foaf:name "Bob" ] .` The grammar allows these lists to be nested: each inner `[` establishes a new subject blank node which reverts to the outer node at the matching `]`. This is a common idiom for representing a series of properties of a node.<sup>[1](https://www.w3.org/TR/turtle/)</sup>

**Collections.** RDF provides a collection structure for lists of nodes, represented in Turtle as a possibly empty list of RDF terms enclosed in parentheses, such as `( :a :b :c )`. The syntax expands to an `rdf:first`/`rdf:rest` list structure whose order is the order of the enclosed terms; an empty collection `()` represents `rdf:nil`. The `(…)` syntax must appear in the subject or object position of a triple, and the blank node at the head of the list is the subject or object of the containing triple.<sup>[1](https://www.w3.org/TR/turtle/)</sup> [RDF Schema](https://www.edgepedia.org/rdf-schema) notes that this shorthand will be familiar to those with experience of [Lisp](https://www.edgepedia.org/lisp-programming-language) and similar languages, where lists are built the same way.<sup>[8](https://www.w3.org/TR/rdf-schema/)</sup>

## Standardization history

Turtle's RDF 1.1 specification moved through the W3C process as a Working Draft on 9 August 2011, a Last Call Working Draft on 10 July 2012, a Candidate Recommendation Snapshot on 19 February 2013, a Proposed Recommendation on 9 January 2014, and a Recommendation on 25 February 2014.<sup>[2](https://www.w3.org/standards/history/rdf11-turtle/)</sup> Along the way the document title changed from "Turtle" to "RDF 1.1 Turtle", and the SPARQL-style `PREFIX` and `BASE` directives, marked "at risk" at the Candidate Recommendation stage, were confirmed as a stable feature.<sup>[1](https://www.w3.org/TR/turtle/)</sup><sup> • </sup><sup>[2](https://www.w3.org/standards/history/rdf11-turtle/)</sup> Earlier teaching material from 2011 described Turtle as not yet a W3C Recommendation, reflecting its status before the RDF 1.1 round.<sup>[9](https://www.semantic-web-book.org/w/images/9/94/W2011-03-rdf.pdf)</sup>

## Use in software and practice

Mainstream RDF tooling treats Turtle as a standard input and output format. The Eclipse RDF4J framework, for example, supports all mainstream RDF file formats including RDF/XML, Turtle, N-Triples, N-Quads, JSON-LD, TriG, and TriX.<sup>[4](https://rdf4j.org/about/)</sup> In one reported benchmark, JSON-LD serialization ran about 20 times slower than Turtle serialization in the jsonld-java library.<sup>[10](https://github.com/jsonld-java/jsonld-java/issues/172)</sup>

The format remains central as W3C finalizes RDF 1.2, which is designed to simplify expressing annotations to triples; Turtle, RDF/XML, N-Triples, JSON-LD, and N3 are listed among the serialization formats of the RDF ecosystem in that work.<sup>[11](https://www.w3.org/2025/Bos-Raggett-GIECS-2025.pdf)</sup> Newer formats such as the binary Jelly serialization have been proposed to address performance limits of textual formats including Turtle, N-Triples, and JSON-LD in knowledge graph communication and storage.<sup>[12](https://arxiv.org/abs/2506.11298)</sup>

## References

1. [RDF 1.1 Turtle, W3C Recommendation](https://www.w3.org/TR/turtle/)
2. [RDF 1.1 Turtle publication history, W3C](https://www.w3.org/standards/history/rdf11-turtle/)
3. [Assessing resolvability, parsability, and consistency of RDF resources: a use case in rare diseases, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC10696869/)
4. [The Eclipse RDF4J Framework, Eclipse Foundation](https://rdf4j.org/about/)
5. [JSON-LD: JSON for Linked Data & Semantic Web, Inference Systems glossary](https://inferensys.com/glossary/enterprise-knowledge-graphs/knowledge-representation-languages/json-ld-json-for-linked-data)
6. [w3c workin](https://travesia.mcu.es/bitstreams/201267df-468f-4d6b-9344-6cdb4d99633b/download)
7. [JSON to RDF Converter, Fix42](https://fix42.com/tools/json-to-rdf/)
8. [RDF Schema 1.1, W3C Recommendation](https://www.w3.org/TR/rdf-schema/)
9. [Knowledge Representation for the Semantic Web (course slides, Pascal Hitzler)](https://www.semantic-web-book.org/w/images/9/94/W2011-03-rdf.pdf)
10. [Performances? Issue #172, jsonld-java GitHub](https://github.com/jsonld-java/jsonld-java/issues/172)
11. [RDF 1.2 and related standards, W3C (2025)](https://www.w3.org/2025/Bos-Raggett-GIECS-2025.pdf)
12. [Jelly: a fast and convenient RDF serialization format, arXiv](https://arxiv.org/abs/2506.11298)
13. [RDF 1.2 Turtle](https://www.w3.org/TR/rdf12-turtle/)

---
*Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Software and programming › Data formats and serialization*

*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
