Subject: [ietf-types] Request for review of Turtle (an RDF serialization) media type: text/turtle

From: Eric Prud'hommeaux <[email-masked]>
Date: Fri, 11 Mar 2011 18:33:34 -0500

Believing all of the issues in
<http://www.w3.org/2008/01/rdf-media-types> to be resolved, I'd like a
review of the media type text/turtle . The Published specification
will be <http://www.w3.org/TeamSubmission/2011/SUBM-turtle-20110314/>,
which will be the same as
<http://www.w3.org/TeamSubmission/2008/SUBM-turtle-20080114/> with
modifications to the media type sections.

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.

It is recommended that sparql query files stored on Macintosh HFS file systems be given a file type of "TEXT".

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 transfering 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 sould 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] and Internationalized Resource Identifiers (IRIs) [RFC3987] Section 8.
Interoperability considerations:
    There are no known interoperability issues.
Published specification:
    http://www.w3.org/TeamSubmission/2011/SUBM-turtle-20110314/
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 <[email-masked]>
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.

I'll be submitting another form for text/n3 .
Boy I hope this is near the end.
-- 
-ericP

---

From: Eric Prud'hommeaux <[email-masked]>
Date: Sat, 12 Mar 2011 07:49:16 -0500

updated to fix a pasto:
  s/sparql query files/Turtle files/

* Eric Prud'hommeaux <[email-masked]> [2011-03-11 18:33-0500]

Contact:
    Eric Prud'hommeaux
See also:

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

Type name:
    text
Subtype name:
    turtle
Required parameters:
    None
Optional parameters:
    http://www.w3.org/TeamSubmission/2008/SUBM-turtle-20080114/

> I'll be submitting another form for text/n3 .

and another pasto fix...

-- 
-ericP

---

From: Eric Prud'hommeaux <[email-masked]>
Date: Sat, 12 Mar 2011 08:46:57 -0500

* Nathan <[email-masked]> [2011-03-12 00:26+0000]
> possible bugs..

tx for vigilance

> Eric Prud'hommeaux wrote:
> s/sparql/Turtle ??

fixed in attached

> s/transfering/transferring

fixed in attached

> s/sould/should

fixed in attached

> also, should it be referencing IRIs throughout, rather than URIs and IRIs?

I think the dereferencing section should talk about URIs as HTTP, and
I think all, URL schemes follow RFC2718's recommendation¹ of turning
non-ascii chars into bytes and %HH-encoding them. Thus, all
dereferencing happens via URNs. The media type *could* talk about
referencing IRIs and either explicitly call out the URI translation,
or leave it as an exercise for the reader. I'm interested in editorial
suggestions.

  ¹ http://tools.ietf.org/html/rfc2718#section-2.2.5

The other place URI is used is in the template heading "Base URI". The
media type registration template effectively asks "how does your
language represent base URIs?" and I've answered it with "with @base,
but it may also be an IRI".

Should I change the template to include "Base IRI" instead of "Base URI"?

> unsure this counts as magic numbers??

* Nathan <[email-masked]> [2011-03-12 00:29+0000]
> as before, afaict this isn't a magic number that can reliably be
> used for sniffing and detection of content type.. possibly remove

I had the impression that this was a call for heuristics which would
allow one to sniff a reasonable subset of the documents in the wild.
I note that Turtle and Notation3 are indistinguishable by the supplied
"Magic number" discriminators, and that the the real discriminator, a
lexical token '{', is hard to describe without rolling a lot of the
lexer into an outrageous regex:

  (   '<' ([^<>"{}|^`\]-[#x00-#x20])* '>'
    | '"' ( ([^#x22#x5C#xA#xD]) | [tbnrf\"'] )* '"'
    | '"""' ( ( '"' | '""' )? ( [^"\] | '\' [tbnrf\"'] ) )* '"""'
  )* [#x20#x9#xD#xA]* '{'

Also, even this distinction doesn't discriminate n3 from trig. Oof.

Do others think I should say "Magic number: None"?

> likewise! fingers crossed
> 
> Best,
> 
> Nathan

-- 
-ericP