Terse RDF Triple Language
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, Terse RDF Triple Language (Turtle) is a
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
and
file format A file format is a Computer standard, standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary format, pr ...
for expressing data in the
Resource Description Framework The Resource Description Framework (RDF) is a method to describe and exchange graph data. It was originally designed as a data model for metadata by the World Wide Web Consortium (W3C). It provides a variety of syntax notations and formats, of whi ...
(RDF) data model. Turtle syntax is similar to that of
SPARQL SPARQL (pronounced ":wikt:sparkle, sparkle", a recursive acronym for SPARQL Protocol and RDF Query Language) is an RDF query language—that is, a Semantic Query, semantic query language for databases—able to retrieve and manipulate data sto ...
, an
RDF query language An RDF query language is a computer language, specifically a query language for databases, able to retrieve and manipulate data stored in Resource Description Framework (RDF) format. SPARQL has emerged as the standard RDF query language, and in 2 ...
. It is a common data format for storing RDF data, along with
N-Triples N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF (Resource Description Framework) graphs, and a subset of the Turtle (Terse RDF Triple Language) format. N-Triples should not be ...
,
JSON-LD JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding linked data using JSON. One goal for JSON-LD was to require as little effort as possible from developers to transform their existing JSON to JSON-LD. JSON-LD allows data ...
and
RDF/XML RDF/XML is a syntax,RDF/XML Syntax Specification
semantic triple A semantic triple, or RDF triple or simply triple, is the atomic data entity in the Resource Description Framework (RDF) data model. As its name indicates, a triple is a sequence of three entities that codifies a statement about semantic data in ...
s, which comprise a subject, predicate, and object. Each item in the triple is expressed as a Web
URI Uri may refer to: Places * Canton of Uri, a canton in Switzerland * Úri, a village and commune in Hungary * Uri, Iran, a village in East Azerbaijan Province * Uri, Jammu and Kashmir, a town in India * Uri (island), off Malakula Island in V ...
. Turtle provides a way to group three URIs to make a triple, and provides ways to abbreviate such information, for example by factoring out common portions of URIs. For example, information about
Huckleberry Finn Huckleberry "Huck" Finn is a fictional character created by Mark Twain who first appeared in the book ''The Adventures of Tom Sawyer'' (1876) and is the protagonist and narrator of its sequel, '' Adventures of Huckleberry Finn'' (1884). He is 12 ...
could be expressed as: <http://example.org/books/Huckleberry_Finn> <http://example.org/relation/author> <http://example.org/person/Mark_Twain> .


History

Turtle was defined by Dave Beckett as a subset of
Tim Berners-Lee Sir Timothy John Berners-Lee (born 8 June 1955), also known as TimBL, is an English computer scientist best known as the inventor of the World Wide Web, the HTML markup language, the URL system, and HTTP. He is a professorial research fellow a ...
and Dan Connolly's
Notation3 Notation3, or N3 as it is more commonly known, is a shorthand non-XML serialization of Resource Description Framework models, designed with human-readability in mind: N3 is much more compact and readable than XML RDF notation. The format is being ...
(N3) language, and a superset of the minimal
N-Triples N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF (Resource Description Framework) graphs, and a subset of the Turtle (Terse RDF Triple Language) format. N-Triples should not be ...
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 RDF/XML is a syntax,RDF/XML Syntax Specification
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
and is generally recognized as being more readable and easier to edit manually than its XML counterpart.
SPARQL SPARQL (pronounced ":wikt:sparkle, sparkle", a recursive acronym for SPARQL Protocol and RDF Query Language) is an RDF query language—that is, a Semantic Query, semantic query language for databases—able to retrieve and manipulate data sto ...
, 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 The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working together in ...
(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. A significant proportion of RDF toolkits include Turtle parsing and serializing capability. Some examples of such toolkits are Redland,
RDF4J Eclipse RDF4J (formerly OpenRDF Sesame) is an open-source framework for storing, querying, and analysing Resource Description Framework (RDF) data. Framework It was created by the Dutch software company Aduna as part of "On-To-Knowledge", a sem ...
,
Jena Jena (; ) is a List of cities and towns in Germany, city in Germany and the second largest city in Thuringia. Together with the nearby cities of Erfurt and Weimar, it forms the central metropolitan area of Thuringia with approximately 500,000 in ...
, Python's
RDFLib RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information. This library contains parsers/serializers for almost all of the known RDF serializations, such as RDF/XML, Turtle, N-Triples, & JSON-L ...
and JavaScript's N3.js.


Example

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: @prefix rdf: . @prefix dc: . @prefix ex: . dc:title "RDF/XML Syntax Specification (Revised)" ; ex:editor "> ex:fullname "Dave Beckett"; ex:homePage . (Turtle examples are also valid
Notation3 Notation3, or N3 as it is more commonly known, is a shorthand non-XML serialization of Resource Description Framework models, designed with human-readability in mind: N3 is much more compact and readable than XML RDF notation. The format is being ...
). The example encodes an RDF graph made of four triples, which express these facts: * The W3C technical report on RDF syntax and grammar has the title ''RDF/XML Syntax Specification (Revised)''. * That report's editor is a certain individual, who in turn ** Has full name ''Dave Beckett''. ** Has a home page at a certain place. Here are the triples made explicit in
N-Triples N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF (Resource Description Framework) graphs, and a subset of the Turtle (Terse RDF Triple Language) format. N-Triples should not be ...
notation: "RDF/XML Syntax Specification (Revised)" . _:bnode . _:bnode "Dave Beckett" . _:bnode . The
MIME type In information and communications technology, a media type, content type or MIME type is a two-part identifier for file formats and content formats. Their purpose is comparable to filename extensions and uniform type identifiers, in that they ide ...
of Turtle is text/turtle. The character encoding of Turtle content is always
UTF-8 UTF-8 is a character encoding standard used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode Transformation Format 8-bit''. Almost every webpage is transmitted as UTF-8. UTF-8 supports all 1,112,0 ...
.


Named graphs

TriG RDF syntax extends Turtle with support for
named graph Named graphs are a key concept of Semantic Web architecture in which a set of Resource Description Framework statements (a graph) are identified using a URI, allowing descriptions to be made of that set of statements such as context, provenance ...
s.


See also

*
N-Triples N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF (Resource Description Framework) graphs, and a subset of the Turtle (Terse RDF Triple Language) format. N-Triples should not be ...
* Notation3 (N3) * LV2


References


External links


Turtle Specification

Turtle TL;DR Cheatsheet on Enola.dev
{{Semantic Web Resource Description Framework Syntax Computer file formats