Log on:
Powered by Elgg

Home > Group JVDB > 3 Technologies > RDF and Turtle > Comparisons to Turtle

The below lists are taken directly from the W3 team submission on Turtle in January 2008.

Turtle compared to N-Triples

Turtle as an offshoot of N-Triples adds the following syntax, some of which have been discussed in earlier pages.

  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

 

Turtle compared to Notation3

The following is not a complete list but highlight some of the syntax which remains in N3 but is not in Turtle.

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

 

Turtle compared to SPARQL

The SPARQL Query Language for RDF uses a Turtle/N3 style syntax for Triples including the same abbreviations mentioned earlier. The following syntax however are not in Turtle but are SPARQL. The following is 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 and false 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).