fbpx
Wikipedia

Turtle (syntax)

In computing, Terse RDF Triple Language (Turtle) is a syntax and file format for expressing data in the Resource Description Framework (RDF) data model. Turtle syntax is similar to that of SPARQL, an RDF query language. It is a common data format for storing RDF data, along with N-Triples, JSON-LD and RDF/XML.

Terse RDF Triple Language
Filename extension
.ttl
Internet media type
text/turtle
Developed byDave Beckett
Latest release
RDF 1.1 Turtle (REC)
25 February 2014
Type of formatSemantic Web
Container forRDF data
Extended fromN-Triples, Notation3
Extended toTriG_(syntax)
Websitewww.w3.org/TR/turtle/

RDF represents information using semantic triples, which comprise a subject, predicate, and object. Each item in the triple is expressed as a Web URI. 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 could be expressed as:

<http://example.org/person/Mark_Twain> <http://example.org/relation/author> <http://example.org/books/Huckleberry_Finn> . 

History Edit

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.

Example Edit

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: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix ex: <http://example.org/stuff/1.0/> . <http://www.w3.org/TR/rdf-syntax-grammar> dc:title "RDF/XML Syntax Specification (Revised)" ; ex:editor [ ex:fullname "Dave Beckett"; ex:homePage <http://purl.org/net/dajobe/> ] . 

(Turtle examples are also valid Notation3).

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 notation:

<http://www.w3.org/TR/rdf-syntax-grammar> <http://purl.org/dc/elements/1.1/title> "RDF/XML Syntax Specification (Revised)" . <http://www.w3.org/TR/rdf-syntax-grammar> <http://example.org/stuff/1.0/editor> _:bnode . _:bnode <http://example.org/stuff/1.0/fullname> "Dave Beckett" . _:bnode <http://example.org/stuff/1.0/homePage> <http://purl.org/net/dajobe/> . 

The MIME type of Turtle is text/turtle. The character encoding of Turtle content is always UTF-8.[2]

Named graphs Edit

TriG RDF syntax extends Turtle with support for named graphs.

See also Edit

References Edit

  1. ^ "RDF 1.1 Turtle - Terse RDF Triple LanguageTurtle". World Wide Web Consortium (W3C). 25 February 2014. Retrieved 16 December 2015.
  2. ^ "MIME Media Types: text/turtle". Internet Assigned Numbers Authority (IANA). 28 March 2011. Retrieved 27 November 2011.

External links Edit

  • Turtle Specification

turtle, syntax, computing, terse, triple, language, turtle, syntax, file, format, expressing, data, resource, description, framework, data, model, turtle, syntax, similar, that, sparql, query, language, common, data, format, storing, data, along, with, triples. In computing Terse RDF Triple Language Turtle is a syntax and file format for expressing data in the Resource Description Framework RDF data model Turtle syntax is similar to that of SPARQL an RDF query language It is a common data format for storing RDF data along with N Triples JSON LD and RDF XML Terse RDF Triple LanguageFilename extension ttlInternet media typetext turtleDeveloped byDave BeckettLatest releaseRDF 1 1 Turtle REC 25 February 2014Type of formatSemantic WebContainer forRDF dataExtended fromN Triples Notation3Extended toTriG syntax Websitewww wbr w3 wbr org wbr TR wbr turtle wbr RDF represents information using semantic triples which comprise a subject predicate and object Each item in the triple is expressed as a Web URI 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 could be expressed as lt http example org person Mark Twain gt lt http example org relation author gt lt http example org books Huckleberry Finn gt Contents 1 History 2 Example 3 Named graphs 4 See also 5 References 6 External linksHistory EditTurtle 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 Example EditThe 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 lt http www w3 org 1999 02 22 rdf syntax ns gt prefix dc lt http purl org dc elements 1 1 gt prefix ex lt http example org stuff 1 0 gt lt http www w3 org TR rdf syntax grammar gt dc title RDF XML Syntax Specification Revised ex editor ex fullname Dave Beckett ex homePage lt http purl org net dajobe gt Turtle examples are also valid Notation3 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 notation lt http www w3 org TR rdf syntax grammar gt lt http purl org dc elements 1 1 title gt RDF XML Syntax Specification Revised lt http www w3 org TR rdf syntax grammar gt lt http example org stuff 1 0 editor gt bnode bnode lt http example org stuff 1 0 fullname gt Dave Beckett bnode lt http example org stuff 1 0 homePage gt lt http purl org net dajobe gt The MIME type of Turtle is text turtle The character encoding of Turtle content is always UTF 8 2 Named graphs EditTriG RDF syntax extends Turtle with support for named graphs See also EditN Triples Notation3 N3 LV2References Edit RDF 1 1 Turtle Terse RDF Triple LanguageTurtle World Wide Web Consortium W3C 25 February 2014 Retrieved 16 December 2015 MIME Media Types text turtle Internet Assigned Numbers Authority IANA 28 March 2011 Retrieved 27 November 2011 External links EditTurtle Specification Retrieved from https en wikipedia org w index php title Turtle syntax amp oldid 1172542721, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.