# RDF 1.2 Turtle Syntax Tests

Copyright © 2004-2023 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.

## Abstract

This page describes W3C RDF & SPARQL Working Group's test suite for RDF 1.2. Conformance for RDF 1.2 requires conforming with tests in this test suite along with the relevant RDF 1.2 tests.

### Contributing Tests

The test manifests and entries are built automatically from manifest.ttl using a Rake task. Tests may be contributed via pull request to https://github.com/w3c/rdf-tests with suitable changes to the manifest.ttl and referenced files.

### Distribution

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

### Disclaimer

UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

## Test Descriptions

turtle12-1: Turtle 1.2 - subject reified triple
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-basic-01.ttl
turtle12-2: Turtle 1.2 - object reified triple
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-basic-02.ttl
turtle12-3: Turtle 1.2 - triple term object
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-basic-03.ttl
turtle12-4: Turtle 1.2 - reified triple outside triple
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-basic-04.ttl
turtle12-inside-1: Turtle 1.2 - reified triple inside blankNodePropertyList
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-inside-01.ttl
turtle12-inside-2: Turtle 1.2 - reified triple inside collection
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-inside-02.ttl
turtle12-inside-3: Turtle 1.2 - reified triple with IRI identifier
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-inside-03.ttl
turtle12-inside-4: Turtle 1.2 - reified triple with blank node identifier
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-inside-04.ttl
turtle12-nested-1: Turtle 1.2 - nested reified triple, subject position
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-nested-01.ttl
turtle12-nested-2: Turtle 1.2 - nested reified triple, object position
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-nested-02.ttl
turtle12-compound-1: Turtle 1.2 - compound forms
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-compound.ttl
turtle12-bnode-1: Turtle 1.2 - blank node subject
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-bnode-01.ttl
turtle12-bnode-2: Turtle 1.2 - blank node object
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-bnode-02.ttl
turtle12-bnode-3: Turtle 1.2 - blank node
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-syntax-bnode-03.ttl
turtle12-bad-1: Turtle 1.2 - bad - reified triple as predicate
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-01.ttl
turtle12-bad-2: Turtle 1.2 - bad - literal in subject position of reified triple
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-02.ttl
turtle12-bad-3: Turtle 1.2 - bad - blank node as predicate in reified triple
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-03.ttl
turtle12-bad-4: Turtle 1.2 - bad - incomplete reified triple
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-04.ttl
turtle12-bad-5: Turtle 1.2 - bad - over-long reified triple
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-05.ttl
turtle12-bad-6: Turtle 1.2 - bad - reified with list object
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-06.ttl
turtle12-bad-7: Turtle 1.2 - bad - compound blank node expression
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-07.ttl
turtle12-ann-1: Turtle 1.2 - Annotation form
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-1.ttl
turtle12-ann-2: Turtle 1.2 - Annotation example
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-2.ttl
turtle12-ann-3: Turtle 1.2 - Annotation predicateObjecetList
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-3.ttl
turtle12-ann-4: Turtle 1.2 - Annotation followed by predicate/object
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-4.ttl
turtle12-ann-5: Turtle 1.2 - Reifier without annotation block
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-5.ttl
turtle12-ann-6: Turtle 1.2 - Empty reifier without annotation block
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-6.ttl
turtle12-ann-7: Turtle 1.2 - Reifier with annotation block
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-7.ttl
turtle12-ann-8: Turtle 1.2 - Empty reifier with annotation block
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-annotation-8.ttl
turtle12-bad-ann-1: Turtle 1.2 - bad - empty annotation
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-ann-1.ttl
turtle12-bad-ann-2: Turtle 1.2 - bad - triple as annotation
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-syntax-bad-ann-2.ttl
nt-ttl12-1: N-Triples 1.2 as Turtle 1.2 - triple term
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-syntax-1.ttl
nt-ttl12-2: N-Triples 1.2 as Turtle 1.2 - whitespace and terms
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-syntax-2.ttl
nt-ttl12-3: N-Triples 1.2 as Turtle 1.2 - Nested, no whitespace
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-syntax-3.ttl
nt-ttl12-bnode-1: N-Triples 1.2 as Turtle 1.2 - Blank node object
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-bnode-1.ttl
nt-ttl12-nested-1: N-Triples 1.2 as Turtle 1.2 - Nested subject term
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-nested-1.ttl
nt-ttl12-langdir-1: N-Triples 1.2 as Turtle 1.2 - base direction ltr
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-langdir-1.ttl
nt-ttl12-langdir-2: N-Triples 1.2 as Turtle 1.2 - base direction ltr
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    nt-ttl12-langdir-2.ttl
nt-ttl12-langdir-bad-1: N-Triples 1.2 as Turtle 1.2 - undefined base direction
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-langdir-bad-1.ttl
nt-ttl12-langdir-bad-2: N-Triples 1.2 as Turtle 1.2 - upper case LTR
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-langdir-bad-2.ttl
nt-ttl12-bad-01: N-Triples 1.2 as Turtle 1.2 - Bad - triple term as predicate
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-01.ttl
nt-ttl12-bad-02: N-Triples 1.2 as Turtle 1.2 - Bad - triple term, literal subject
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-02.ttl
nt-ttl12-bad-03: N-Triples 1.2 as Turtle 1.2 - Bad - triple term, literal predicate
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-03.ttl
nt-ttl12-bad-04: N-Triples 1.2 as Turtle 1.2 - Bad - triple term, blank node predicate
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-04.ttl
nt-ttl12-bad-05: N-Triples 1.2 as Turtle 1.2 - Bad - triple term as subject
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-05.ttl
nt-ttl12-bad-06: N-Triples 1.2 as Turtle 1.2 - Bad - reified triple as predicate
  type
    rdft:TestNTriplesNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-06.ttl
nt-ttl12-bad-07: N-Triples 1.2 as Turtle 1.2 - Bad - reified triple, literal subject
  type
    rdft:TestNTriplesNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-07.ttl
nt-ttl12-bad-08: N-Triples 1.2 as Turtle 1.2 - Bad - reified triple, literal predicate
  type
    rdft:TestNTriplesNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-08.ttl
nt-ttl12-bad-09: N-Triples 1.2 as Turtle 1.2 - Bad - reified triple, blank node predicate
  type
    rdft:TestNTriplesNegativeSyntax
  approval
  action
    nt-ttl12-bad-syntax-09.ttl
turtle12-version-01: Turtle 1.2 - VERSION
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-01.ttl
turtle12-version-02: Turtle 1.2 - @version
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-02.ttl
turtle12-version-03: Turtle 1.2 - VERSION in data
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-03.ttl
turtle12-version-04: Turtle 1.2 - @version in data
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-04.ttl
turtle12-version-05: Turtle 1.2 - VERSION other version string
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-05.ttl
turtle12-version-06: Turtle 1.2 - @version other version string
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-06.ttl
turtle12-version-07: Turtle 1.2 - mixed versions
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-07.ttl
turtle12-version-08: Turtle 1.2 - many versions
  type
    rdft:TestTurtlePositiveSyntax
  approval
  action
    turtle12-version-08.ttl
turtle12-version-bad-01: Turtle 1.2 - VERSION - not string
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-version-bad-01.ttl
turtle12-version-bad-02: Turtle 1.2 - VERSION - triple-'-quoted string
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-version-bad-02.ttl
turtle12-version-bad-03: Turtle 1.2 - VERSION - triple-"-quoted string
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-version-bad-03.ttl
turtle12-version-bad-04: Turtle 1.2 - @version - not string
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-version-bad-04.ttl
turtle12-version-bad-05: Turtle 1.2 - @version - triple-'-quoted string
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-version-bad-05.ttl
turtle12-version-bad-06: Turtle 1.2 - @version - triple-"-quoted string
  type
    rdft:TestTurtleNegativeSyntax
  approval
  action
    turtle12-version-bad-06.ttl