Ttl Script Examples



Quick demo on running a TeraTerm Script. Keeping it Simple. Finally, if you’re just looking for a binary yes/no answer to if a computer is responding or not, you can always use the Quiet parameter. A common string I always use to quickly see if a server is online or not is to use Quiet and Count of 1 to force Test-Connection to send a single ICMP request. The batch command ASSOC associates a file extension with a file type, or list all associations. @echo OFF ASSOC find '.txt' pause. Output.txt = textfile. As shown in above output, it displays the file association for.txt extension. If only ASSOC is written and executed, it will display all the file associations for every extension, instead of just.txt extension.

  1. Teraterm Ttl Script Examples
  2. Teraterm Ttl Script Examples
  3. Ttl Script Examples Python
  4. Tera Term Script Examples
A TTL(Tera Term Language) script used for automatic reboot test
AutoReboot.ttl

# # This demo script will load in all of the zones specified by the # filenames on the command line, find all the A RRs in them, and # construct a reverse mapping table that maps each IP address used to # the list of names mapping to that address.

; TTL Script used for automatic reboot test
username = 'root'
password = 'root'
usernamePrompt = 'login'
passwordPrompt = 'Password'
oopsPrompt = 'Oops'
panicPrompt = 'Kernel panic'
maxLoop = 1000
gettime now '%Y/%m/%d-%H:%M:%S'#13#10
sprintf2 startTime 'AutoReboot started at %s' now
gettime logfile 'AutoReboot-test-log-%Y%m%d-%H%M%S.txt'
logopen logfile 000000
logwrite startTime
for i 1 maxLoop
wait usernamePrompt oopsPrompt panicPrompt
if result = 0 then
gettime now '%Y/%m/%d-%H:%M:%S'
sprintf2 tempTime 'Exception: Timeout at %s after %d times reboot'#13#10 now i
logwrite tempTime
elseif result = 1 then
sendln username
wait passwordPrompt
sendln password
elseif result = 2 then
gettime now '%Y/%m/%d-%H:%M:%S'
sprintf2 tempTime 'Exception: Oops at %s after %d times reboot'#13#10 now i
logwrite tempTime
logclose
exit
elseif result = 3 then
gettime now '%Y/%m/%d-%H:%M:%S'
sprintf2 tempTime 'Exception: Kernel panic at %s after %d times reboot'#13#10 now i
logwrite tempTime
logclose
exit
else
logwrite 'Unknown Error'#13#10
endif
sendln
gettime now '%Y/%m/%d-%H:%M:%S'
sprintf2 rebootTime 'AutoReboot %d times at %s'#13#10 i now
dispstr rebootTime
logwrite rebootTime
sendln
sendln 'reboot'
next
gettime now '%Y/%m/%d-%H:%M:%S'
sprintf2 stopTime 'AutoReboot stopped at %s after %d times reboot'#13#10 now i
logwrite stopTime
logclose
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

W3C Team Submission 28 March 2011

This version:
http://www.w3.org/TeamSubmission/2011/SUBM-turtle-20110328/
Latest version:
http://www.w3.org/TeamSubmission/turtle/
Previous version:
http://www.w3.org/TeamSubmission/2008/SUBM-turtle-20080114/
Authors:
David Beckett
Tim Berners-Lee W3C

Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.

Abstract

The Resource Description Framework (RDF) is a general-purpose language for representing information in the Web.

This document defines a textual syntax for RDF called Turtle that allows RDF graphs to be completely written in a compact and natural text form, with abbreviations for common usage patterns and datatypes. Turtle provides levels of compatibility with the existing N-Triples and Notation 3 formats as well as the triple pattern syntax of the SPARQL W3C Proposed Recommendation.

This document specifies a language that is in common usage under the name 'Turtle'. It is intended to be compatible with, and a subset of, Notation 3.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications can be found in the W3C technical reports index at http://www.w3.org/TR/.

This 14 January 2008 W3C Team Submission documents the currently deployed Turtle language, an alternative syntax to RDF/XML.

By publishing this document, David Beckett and Tim Berners-Lee have made a formal submission to W3C for discussion. Publication of this document by W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or will be allocating any resources to the issues addressed by it. This document is not the product of a chartered W3C group, but is published as potential input to the W3C Process. Please consult the complete list of acknowledged W3C Team Submissions.

Table of Contents

  • 1. Introduction
  • 2. Turtle Syntax
  • 3. Turtle Grammar
  • 3.1 White Space
  • 3.2 Comments
  • 3.3 String Escapes
  • 3.4 URI References
  • 3.5 Collections
  • 3.6 Grammar
  • 4. Examples
  • 5. Identifiers for the Turtle Language
  • 6. Conformance
  • 7. Media Type and Content Encoding
  • 8. Turtle compared to N-Triples
  • 9. Turtle compared to Notation3
  • 10. Turtle compared to SPARQL
  • A. References
  • A.1 Normative
  • A.2 Informative
  • B. Internet Media Type, File Extension and Macintosh File Type
  • C. Acknowledgements
  • D. Changes

1. Introduction

This document defines Turtle, the Terse RDF Triple Language,a concrete syntax for RDF as defined in theRDF Concepts and Abstract Syntax([RDF-CONCEPTS]) W3C Recommendation.Turtle is an extension of N-Triples([N-TRIPLES])carefully taking the most useful and appropriate things added fromNotation 3([NOTATION3])while keeping it in the RDF model.

The recommended XML syntax for RDF,RDF/XML([RDF-XML])has certain restrictions imposed by XML and the use of XML Namespacesthat prevent it encoding all RDF graphs (some predicate URIs areforbidden and XML 1.0 forbids encoding some Unicode codepoints).These restrictions do not apply to Turtle.

Turtle is intended to be compatible with, and a subset of, Notation 3 (see Turtle compared to Notation 3), and is generally usable in systems that support N3.

All RDF written in Turtle should be usable inside the querylanguage part of theSPARQL Protocol And RDF Query Language(SPARQL)[SPARQLQ]which uses a Turtle/N3 style syntax for the Triple patterns andfor RDF triples in the CONSTRUCT clause. This allowsusing RDF written in Turtle to allow forming 'queries by example',using the data to make an initial query which can then be edited touse variables where bindings are wanted.

2. Turtle Syntax (Informative)

This section is informative. In case of disagreement, theTurtle Grammar section is definitive.

A Turtle document allows writing down an RDF graph in a compacttextual form. It consists of a sequence of directives, triple-generatingstatements or blank lines. Comments may be given after a #and continue to the end of the line.

Simple triples are a sequence of (subject, predicate, object)terms, separated by whitespace and terminated by '.' after eachtriple. This corresponds toN-Triples([N-TRIPLES]).

There are three types of RDF Term:RDF URI References (URIs for short),literals andblank nodes.

2.1. RDF Terms

URIs are written enclosed in '<' and '>' and may beabsolute RDF URI References or relative to the current base URI(described below).

URIs may also be abbreviated by using Turtle's @prefixdirective that allows declaring a short prefix name for a long prefixof repeated URIs. This is useful for many RDF vocabularies that areall defined in nearby namespace URIs, possibly using XML's namespacemechanism that works in a similar fashion.

Once a prefix such as @prefix foo:<http://example.org/ns#> is defined, any mention of aURI later in the document may use a qualified name thatstarts foo: to stand for the longer URI. So forexample, the qualified name foo:bar is a shorthand forthe URI http://example.org/ns#bar.

Literals are written either using double-quotes when they do notcontain linebreaks like 'simple literal' or''long literal'' when they may contain linebreaks.

Literals may be given either a language suffix or a datatype URIbut not both. Languages are indicated by appending the simpleliteral with @ and the language tag. Datatype URIssimilarly append ^^ followed by any legal URI form (fullor qualified) as described above to give the datatype URI.

Blank nodes are written as _:nodeIDto provide a blank node either from the given nodeID.A generated blank node may also be made with []which is useful to provide the subject of RDF triples foreach pair from the predicateObjectListor the root of the collection.

Literals and URIs may also contain escapes to encode surroundingsyntax, non-printable characters and to encode Unicode characters bycodepoint number (although they may also be given directly, encodedas UTF-8). The character escapes are:

  • t (U+0009, tab)
  • n (U+000A, linefeed)
  • r (U+000D, carriage return)
  • ' (U+0022, double quote - only allowed inside strings)
  • > (U+003E, greater than - only allowed inside URIs)
  • (U+005C, backslash)
  • uHHHH orUHHHHHHHHfor writing Unicode characters by hexadecimal codepoint whereH is a single hexadecimal digit.

See the String escapes section for full details.

2.2. Abbreviating URIs

The current base URI may be altered in a Turtle document using the@base directive. It allows further abbreviation ofURIs but is usually for simplifying the URIs in the data, wherethe prefix directives are for vocabularies that describe the data.

Whenever this directive appears, it defines the base URI for whichall relative URIs are resolved against. That includes URIs,qualified names, prefix directives as well as later base directives.

The token a is equivalent to the URI<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>

2.3. Abbreviating groups of triples

The , symbol may be used to repeat the subject andpredicate of triples that only differ in the object RDF term.

The ; symbol may be used to repeat the subject ofof triples that vary only in predicate and object RDF terms.

2.4. Abbreviating common datatypes

Decimal integers may be written directly and correspond tothe XML Schema Datatypexsd:integer.in both syntax and datatype URI.

Decimal floating point double/fixed precision numbers may be writtendirectly and correspond to the XML Schema Datatypexsd:doublein both syntax and datatype URI.

Decimal floating point arbitrary precision numbers may be writtendirectly and correspond to the XML Schema Datatypexsd:decimal.in both syntax and datatype URI.

Boolean may be written directly as true orfalse and correspond to thethe XML Schema Datatypexsd:booleanin both syntax and datatype URI.

2.5. Abbreviating RDF Collections

An RDF Collection may be abbreviated using a sequence ofRDF Terms enclosed in ( ) brackets. Whitespace maybe used to separate them, as usual. This format provides ablank node at the start of RDF Collection which may be usedin further abbreviations.

See section Collections forthe details on the long form of the generated triples.

3. Turtle Grammar

A Turtle document is aUnicode[UNICODE]character string encoded in UTF-8.Unicode codepoints only in the range U+0 to U+10FFFF inclusive areallowed.

3.1 White Space

White space (production ws) is used to separatetwo tokens which would otherwise be (mis-)recognized as one token.

White space is significant in tokensrelativeURI, stringand longString.

3.2 Comments

Comments in Turtle take the form of '#', outside anrelativeURI or strings,and continue to the end of line (marked by characters U+000D or U+000A)or end of file if there is no end of line after the commentmarker. Comments are treated as white space and defined by tokencomment.

3.3. String Escapes

Turtle strings and URIs can use -escape sequences torepresent Unicode code points.

The following table describes all the escapesallowed inside a string, longStringor relativeURI:

EscapeUnicode code point
'u' hexhexhexhexA Unicode codepoint in the range U+0 to U+FFFF inclusive corresponding to the encoded hexadecimal value.
'U' hexhexhexhexhexhexhexhexA Unicode codepoint in the range U+10000 to U+10FFFF inclusive corresponding to the encoded hexadecimal value.
't'U+0009
'n'U+000A
'r'U+000D
''
(inside string andlongString)
U+0022
'>'
(inside relativeURI only)
U+003E
'U+005C

3.4. URI References

URIs are resolved relative to the In-scope base URI.

The starting In-Scope Base URI is defined usingthe Base URI mechanism defined in the URI RFC - dependenton the protocol or other context outside the document.During turtle parsing, the in-scope base URI at any point inthe document is determined by the @base directivewhich sets a new base URI relative to the current in-scope base URI.This directive may be repeated.

Example (test-30.ttl) with document base URI http://www.w3.org/2001/sw/DataAccess/df1/tests/

encodes the following N-Triples(test-30.out):

3.5. Collections

The triples that are generated by the collectionterm is given by these expansions to the longer triples form:

Script

( object1object2 ) is short for:
[ rdf:firstobject1;rdf:rest [ rdf:firstobject2;rdf:restrdf:nil ] ]

( ) is short for the resource:
rdf:nil

3.6 Grammar

The EBNF used here is defined in XML 1.0 (Third Edition)[NOTATION]

Turtle - Terse RDF Triple Language EBNF
[1]::=statement*
[2]statement::=directive '.' | triples '.' | ws+
[3]directive::=prefixID | base
[4]prefixID::='@prefix' ws+ prefixName? ':' uriref
[5]base::='@base' ws+ uriref
[6]triples::=
[7]predicateObjectList::=verbobjectList ( ';' verbobjectList )* ( ';')?
[8]objectList::=object ( ',' object)*
[9]verb::=predicate | 'a'
[10]comment::='#' ( [^#xA#xD] )*
[11]subject::=resource | blank
[12]predicate::=resource
[13]object::=resource | blank | literal
[14]literal::=quotedString ( '@' language )? | datatypeString | integer | double | decimal | boolean
[15]datatypeString::=quotedString '^^' resource
[16]integer::=('-' | '+') ? [0-9]+
[17]double::=('-' | '+') ? ( [0-9]+ '.' [0-9]* exponent | '.' ([0-9])+ exponent | ([0-9])+ exponent )
[18]decimal::=('-' | '+')? ( [0-9]+ '.' [0-9]* | '.' ([0-9])+ | ([0-9])+ )
[19]exponent::=[eE] ('-' | '+')? [0-9]+
[20]boolean::='true' | 'false'
[21]blank::=nodeID | '[]' | '[' predicateObjectList ']' | collection
[22]itemList::=object+
[23]collection::='(' itemList? ')'
[24]ws::=#x9 | #xA | #xD | #x20 | comment
[25]resource::=uriref | qname
[26]nodeID::='_:' name
[27]qname::=prefixName? ':' name?
[28]uriref::='<' relativeURI '>'
[29]language::=[a-z]+ ('-' [a-z0-9]+ )*
[30]nameStartChar::=[A-Z] | '_' | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
[31]nameChar::=nameStartChar | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
[32]name::=nameStartCharnameChar*
[33]prefixName::=( nameStartChar - '_' ) nameChar*
[34]relativeURI::=ucharacter*
[35]quotedString::=string | longString
[36]string::=#x22 scharacter* #x22
[37]longString::=#x22 #x22 #x22 lcharacter* #x22 #x22 #x22
[38]character::='u' hexhexhexhex |
'U' hexhexhexhexhexhexhexhex |
' |
[#x20-#x5B] | [#x5D-#x10FFFF]
[39]echaracter::=character |'t' | 'n' | 'r'
[40]hex::=[#x30-#x39] | [#x41-#x46]
[41]ucharacter::=( character - #x3E ) | '>'
[42]scharacter::=( echaracter - #x22 ) | ''
[43]lcharacter::=echaracter | '' | #x9 | #xA | #xD

4. Examples

This example is a Turtle translation of example 7in theRDF/XML Syntax specification(example1.ttl):

An example of an RDF collection of two literals.

which is short for (example2.ttl):

An example of two identical triples containing literal objectscontaining newlines, written in plain and long literal forms.Assumes that line feeds in this document are #xA.(example3.ttl):

5. Identifiers for the Turtle Language

The URI that identifies the Turtle language is:
http://www.w3.org/2008/turtle#turtle

The XML (Namespace name, Local name) pair that identifiesthe Turtle language is:
Namespace: http://www.w3.org/2008/turtle#
Local name: turtle
The suggested namespace prefix is ttl (informative)which would make this ttl:turtle as an XML QName.

6. Conformance

Teraterm Ttl Script Examples

Systems conforming to Turtle MUST pass all the following test cases:

  1. The N-Triples tests in theRDF Test Cases W3C Recommendation.
  2. The Turtle Test Suite(tests.zip md5sum 361f0b8b5e3a36d0ecd60be7965009df )

    Passing these tests means:

    1. All the test-n.ttl tests MUST generate equivalent RDFtriples to those given in the corresponding test-n.outN-Triples file.
    2. All the bad-n.ttl tests MUST NOT generate RDF triples.

7. Media Type and Content Encoding

The media type of Turtle istext/turtle (pre-registration media typeapplication/x-turtle should be accepted).The content encoding of Turtle content is alwaysUTF-8. Charset parameters on the mime type are required until such time as the text/ media type tree permits UTF-8 to be sent without a charset parameter. See B. Internet Media Type, File Extension and Macintosh File Type for the media type registration form.

8. Turtle compared to N-Triples (Informative)

Turtle adds the following syntax to N-Triples:

  1. Whitespace restrictions removed
  2. Text content-encoding changed from ASCII to UTF-8
  3. @prefix
  4. QNames
  5. ,
  6. ;
  7. []
  8. a
  9. ()
  10. Decimal integer literals (xsd:integer)
  11. Decimal double literals (xsd:double)
  12. Decimal arbitrary length literals (xsd:decimal)
  13. Boolean literals
  14. @base

9. Turtle compared to Notation 3 (Informative)

Notation 3 includes at least the following syntax that is not in Turtle(not a complete list):

Examples
  1. { ... }
  2. isof
  3. paths like :a.:b.:c and :a^:b^:c
  4. @keywords
  5. => implies
  6. = equivalence
  7. @forAll
  8. @forSome
  9. <=

10. Turtle compared to SPARQL (Informative)

theSPARQL Query Language for RDF(SPARQL)[SPARQLQ]uses a Turtle/N3 style syntax for the Triple patterns includingthe same forms of abbreviated forms given here.

SPARQL includes at least the following syntax that is not in Turtle(not a complete list):

  1. RDF Literals are allowed in triple subjects
  2. Variables are allowed in any part of the triple of the form?name or $name
  3. Long literals can use use single quote (') characters:'' ... ''
  4. The constants allowed for XSD booleans: true andfalse are case independent. In Turtle they are not,only lowercase forms are allowed.
  5. SPARQL allows '.'s in names in all positions apart from the first or last. These would correspond to rules:
    name ::= nameStartChar ( ( nameChar | '.' )* nameChar )?
    prefixName ::= ( nameStartChar - '_' ) ( ( nameChar | ' .' )* nameChar )?
  6. SPARQL allows digits in the first character of the PN_LOCAL lexical token. In Turtle, the only ascii characters allowed in a nameStartChar are [A-Z] | '_' | [a-z].
  7. Turtle allows prefix and base declarations anywhere outside of a triple. In SPARQL, they are only allowed in the Prologue (at the start of the SPARQL query).

For further information see theSyntax for IRIsand SPARQL Grammarsections of the SPARQL query document [SPARQLQ].

A. References

A.1 Normative

[NOTATION]
Notation section in Extensible Markup Language (XML) 1.0 (Third Edition), T. Bray, J. Paoli, C.m. Sperberg-McQueen, E. Maler, F. Yergeau editors, W3C Recommendation, 04 February 2004. This version of XML 1.0 is http://www.w3.org/TR/2004/REC-xml-20040204/. The latest version of the Extensible Markup Language (XML) 1.0 is at http://www.w3.org/TR/REC-xml/.
[N-TRIPLES]
N-Triples section in RDF Test Cases, J. Grant and D. Beckett, Editors, W3C Recommendation, 10 February 2004. This version of the RDF Test Cases is http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/. The latest version of the RDF Test Cases is at http://www.w3.org/TR/rdf-testcases/.
[UNICODE]
The Unicode Standard Version 3.0, Addison Wesley, Reading MA, 2000, ISBN: 0-201-61633-5. This document is http://www.unicode.org/unicode/standard/standard.html.
[CHARMOD]
Character Model for the World Wide Web 1.0: Fundamentals, M. J. Dürst, F. Yergeau, R. Ishida, M. Wolf, T. Texin editors, W3C Recommendation, 15 February 2005. This version of Character Model for the WWW 1.0: Fundamentals is http://www.w3.org/TR/2005/REC-charmod-20050215/ The latest version of Character Model for the WWW: Fundamentals 1.0 is at http://www.w3.org/TR/charmod/.
[RDF-CONCEPTS]
Resource Description Framework (RDF): Concepts and Abstract Syntax, G. Klyne, J.J. Carroll editors, W3C Recommendation, 10 February 2004. This version of RDF Concepts and Abstract Syntax is http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/. The latest version of RDF Concepts and Abstract Syntax is http://www.w3.org/TR/rdf-concepts/.
[RDF-XML]
RDF/XML Syntax Specification (Revised), D. Beckett editor, W3C Recommendation, 10 February 2004. This version of RDF/XML is http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/. The latest version of RDF/XML is http://www.w3.org/TR/rdf-syntax-grammar/.
[RFC3629]
RFC 3629 UTF-8, a transformation format of ISO 10646, F. Yergeau November 2003
[RFC3986]
RFC 3986 Uniform Resource Identifier (URI): Generic Syntax, T. Berners-Lee, R. Fielding, L. Masinter January 2005
[RFC3987]
RFC 3987, 'Internationalized Resource Identifiers (IRIs)', M. Dürst , M. Suignard
[UNISEC]
Unicode Security Considerations, Mark Davis, Michel Suignard
[UNICODE]
The Unicode Standard, Version 4. ISBN 0-321-18578-1, as updated from time to time by the publication of new versions. The latest version of Unicode and additional information on versions of the standard and of the Unicode Character Database is available at http://www.unicode.org/unicode/standard/versions/.

Teraterm Ttl Script Examples

A.2 Informative

Previous version
http://www.dajobe.org/2004/01/turtle/2007-09-11/
[NOTATION3]
Notation 3, Tim Berners-Lee, World Wide Web Consortium
[MSWM]
Modernising Semantic Web Markup, Dave Beckett and presentation given at XML Europe 2004, Amsterdam, 20 April 2004
[SPARQLQ]
SPARQL Query Language for RDF, E. Prud'hommeaux, A. Seaborne, Editors. World Wide Web Consortium. W3C Proposed Recommendation, 12 November 2007. This version is http://www.w3.org/TR/2007/PR-rdf-sparql-query-20071112/. The latest version of SPARQL Query Language for RDF is available at http://www.w3.org/TR/rdf-sparql-query/.
Ttl script examples sentences

B. Internet Media Type, File Extension and Macintosh File Type (Normative)

Contact:
Eric Prud'hommeaux
See also:
How to Register a Media Type for a W3C Specification
Internet Media Type registration, consistency of use
TAG Finding 3 June 2002 (Revised 4 September 2002)

The Internet Media Type / MIME Type for Turtle is 'text/turtle'.

It is recommended that Turtle files have the extension '.ttl' (all lowercase) on all platforms.

Ttl Script Examples Python

It is recommended that Turtle files stored on Macintosh HFS file systems be given a file type of 'TEXT'.

Tera Term Script Examples

This information that follows has been submitted to the IESG for review, approval, and registration with IANA.

Type name:
text
Subtype name:
turtle
Required parameters:
None
Optional parameters:
charset — this parameter is required when transferring non-ASCII data. If present, the value of charset is always UTF-8.
Encoding considerations:
The syntax of Turtle is expressed over code points in Unicode [UNICODE]. The encoding is always UTF-8 [RFC3629].
Unicode code points may also be expressed using an uXXXX (U+0 to U+FFFF) or UXXXXXXXX syntax (for U+10000 onwards) where X is a hexadecimal digit [0-9A-F]
Security considerations:
Turtle is a general-purpose assertion language; applications may evaluate given data to infer more assertions or to dereference URIs, invoking the security considerations of the scheme for that URI. Note in particular, the privacy issues in [RFC3023] section 10 for HTTP URIs. Data obtained from an inaccurate or malicious data source may lead to inaccurate or misleading conclusions, as well as the dereferencing of unintended URIs. Care must be taken to align the trust in consulted resources with the sensitivity of the intended use of the data; inferences of potential medical treatments would likely require different trust than inferences for trip planning.
Turtle is used to express arbitrary application data; security considerations will vary by domain of use. Security tools and protocols applicable to text (e.g. PGP encryption, MD5 sum validation, password-protected compression) may also be used on Turtle documents. Security/privacy protocols must be imposed which reflect the sensitivity of the embedded information.
Turtle can express data which is presented to the user, for example, RDF Schema labels. Application rendering strings retrieved from untrusted Turtle documents must ensure that malignant strings may not be used to mislead the reader. The security considerations in the media type registration for XML ([RFC3023] section 10) provide additional guidance around the expression of arbitrary data and markup.
Turtle uses IRIs as term identifiers. Applications interpreting data expressed in Turtle should address the security issues of Internationalized Resource Identifiers (IRIs) [RFC3987] Section 8, as well as Uniform Resource Identifier (URI): Generic Syntax [RFC3986] Section 7.
Multiple IRIs may have the same appearance. Characters in different scripts may look similar (a Cyrillic 'о' may appear similar to a Latin 'o'). A character followed by combining characters may have the same visual representation as another character (LATIN SMALL LETTER E followed by COMBINING ACUTE ACCENT has the same visual representation as LATIN SMALL LETTER E WITH ACUTE).Any person or application that is writing or interpreting data in Turtle must take care to use the IRI that matches the intended semantics, and avoid IRIs that make look similar.Further information about matching of similar characters can be found in Unicode Security Considerations [UNISEC] andInternationalized Resource Identifiers (IRIs) [RFC3987] Section 8.
Interoperability considerations:
There are no known interoperability issues.
Published specification:
This specification.
Applications which use this media type:
No widely deployed applications are known to use this media type. It may be used by some web services and clients consuming their data.
Additional information:
Magic number(s):
Turtle documents may have the strings '@prefix' or '@base' (case dependent) near the beginning of the document.
File extension(s):
'.ttl'
Base URI:
The Turtle '@base <IRIref>' term can change the current base URI for relative IRIrefs in the query language that are used sequentially later in the document.
Macintosh file type code(s):
'TEXT'
Person & email address to contact for further information:
Eric Prud'hommeaux <eric@w3.org>
Intended usage:
COMMON
Restrictions on usage:
None
Author/Change controller:
The Turtle specification is the product of David Beckett and Tim Berners-Lee. A W3C Working Group may assume maintenance of this document; W3C reserves change control over this specifications.

C. Acknowledgements (Informative)

This work was described in the paperNew Syntaxes for RDFwhich discusses other RDF syntaxes and the backgroundto the Turtle (Submitted to WWW2004, referred to as N-TriplesPlus there).

This work was started during theSemantic Web Advanced Development Europe (SWAD-Europe)project funded by the EU IST-7 programme IST-2001-34732 (2002-2004)and further development supported by theInstitute for Learning and Research Technology at the University of Bristol, UK (2002-Sep 2005).

D. Changes (Informative)

Changes since the last publication of this documentTurtle 2007-09-11. See thePrevious changelog for further information

  • Renamed section 2 to Turtle Syntax and completed it with examples.
    Tidied mime type section
    Added acknowledgements appendix C
    Added normative and informative references appendices
    Added RDF Concepts reference and link to it for RDF terms
    Renumbered collections section to 3.5
    Renumbered sections 4 onwards
    Removed implementations section2007-11-20
  • Added Tutorial Section
    Removed canonicalisation of lexical forms integer and boolean literals
    Renumbered section 6 as 3.4. URI References
    Renumbered section 3 as 3.3. String Escapes
    Deleted empty section 11. Possible Extensions
    Deleted section 10. XML QNamesas differences with SPARQL are noted elsewhere
    Added grammar sub-sections3.1 White Space and3.2 Comments and3.5 Grammar
    Removed use of ws production except where required
    2007-11-19




Comments are closed.