aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-25 06:18:29 +0000
committerDavid Robillard <d@drobilla.net>2013-02-25 06:18:29 +0000
commit4cd874e79f88f79a3782d4b7feea60b48ec26598 (patch)
treec94ee6cacfe15c43e96b75e5f41d226f62325f9c
parent29c0649c9f5cc4467b0545eb95759b835da9991b (diff)
downloadserd-4cd874e79f88f79a3782d4b7feea60b48ec26598.tar.gz
serd-4cd874e79f88f79a3782d4b7feea60b48ec26598.tar.bz2
serd-4cd874e79f88f79a3782d4b7feea60b48ec26598.zip
Support most of the latest Turtle Editor's Draft.
git-svn-id: http://svn.drobilla.net/serd/trunk@418 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--NEWS3
-rw-r--r--serd.ttl12
-rw-r--r--src/reader.c631
-rw-r--r--src/writer.c210
-rw-r--r--tests/good/test-07.nt10
-rw-r--r--tests/good/test-29.nt1
-rw-r--r--tests/good/test-29.ttl1
-rw-r--r--tests/good/test-backspace.nt4
-rw-r--r--tests/good/test-blank-in-list.nt6
-rw-r--r--tests/good/test-escapes.ttl2
-rw-r--r--tests/good/test-list-in-blank.nt10
-rw-r--r--tests/good/test-list-subject.nt10
-rw-r--r--tests/good/test-pretty.nt64
-rw-r--r--tests/good/test-uri-escape.nt1
-rw-r--r--tests/good/test-uri-escape.ttl1
-rw-r--r--tests/new/HYPHEN_MINUS_in_local_name.nt1
-rw-r--r--tests/new/HYPHEN_MINUS_in_local_name.ttl2
-rw-r--r--tests/new/IRIREF_datatype.nt1
-rw-r--r--tests/new/IRIREF_datatype.ttl1
-rw-r--r--tests/new/IRI_subject.nt1
-rw-r--r--tests/new/IRI_subject.ttl1
-rw-r--r--tests/new/IRI_with_all_punctuation.nt1
-rw-r--r--tests/new/IRI_with_all_punctuation.ttl1
-rw-r--r--tests/new/IRI_with_eight_digit_numeric_escape.ttl1
-rw-r--r--tests/new/IRI_with_four_digit_numeric_escape.ttl1
-rw-r--r--tests/new/LITERAL1.nt1
-rw-r--r--tests/new/LITERAL1.ttl1
-rw-r--r--tests/new/LITERAL2.ttl1
-rw-r--r--tests/new/LITERAL_LONG1.ttl1
-rw-r--r--tests/new/LITERAL_LONG1_with_1_squote.nt1
-rw-r--r--tests/new/LITERAL_LONG1_with_1_squote.ttl1
-rw-r--r--tests/new/LITERAL_LONG1_with_2_squotes.nt1
-rw-r--r--tests/new/LITERAL_LONG1_with_2_squotes.ttl1
-rw-r--r--tests/new/LITERAL_LONG2.ttl1
-rw-r--r--tests/new/LITERAL_LONG2_with_1_squote.nt1
-rw-r--r--tests/new/LITERAL_LONG2_with_1_squote.ttl1
-rw-r--r--tests/new/LITERAL_LONG2_with_2_squotes.nt1
-rw-r--r--tests/new/LITERAL_LONG2_with_2_squotes.ttl1
-rw-r--r--tests/new/SPARQL_style_base.ttl2
-rw-r--r--tests/new/SPARQL_style_prefix.ttl2
-rw-r--r--tests/new/anonymous_blank_node_object.nt1
-rw-r--r--tests/new/anonymous_blank_node_object.ttl1
-rw-r--r--tests/new/anonymous_blank_node_subject.ttl1
-rw-r--r--tests/new/bareword_a_predicate.nt1
-rw-r--r--tests/new/bareword_a_predicate.ttl1
-rw-r--r--tests/new/bareword_decimal.nt1
-rw-r--r--tests/new/bareword_decimal.ttl1
-rw-r--r--tests/new/bareword_double.nt1
-rw-r--r--tests/new/bareword_double.ttl1
-rw-r--r--tests/new/bareword_integer.ttl1
-rw-r--r--tests/new/blankNodePropertyList_as_object.nt2
-rw-r--r--tests/new/blankNodePropertyList_as_object.ttl1
-rw-r--r--tests/new/blankNodePropertyList_as_subject.nt2
-rw-r--r--tests/new/blankNodePropertyList_as_subject.ttl1
-rw-r--r--tests/new/blankNodePropertyList_containing_collection.nt3
-rw-r--r--tests/new/blankNodePropertyList_containing_collection.ttl1
-rw-r--r--tests/new/blankNodePropertyList_with_multiple_triples.nt3
-rw-r--r--tests/new/blankNodePropertyList_with_multiple_triples.ttl1
-rw-r--r--tests/new/collection_object.nt3
-rw-r--r--tests/new/collection_object.ttl1
-rw-r--r--tests/new/collection_subject.nt3
-rw-r--r--tests/new/collection_subject.ttl1
-rw-r--r--tests/new/default_namespace_IRI.ttl2
-rw-r--r--tests/new/double_lower_case_e.nt1
-rw-r--r--tests/new/double_lower_case_e.ttl1
-rw-r--r--tests/new/empty_collection.nt1
-rw-r--r--tests/new/empty_collection.ttl1
-rw-r--r--tests/new/first.nt7
-rw-r--r--tests/new/first.ttl1
-rw-r--r--tests/new/labeled_blank_node_object.nt1
-rw-r--r--tests/new/labeled_blank_node_object.ttl1
-rw-r--r--tests/new/labeled_blank_node_subject.nt1
-rw-r--r--tests/new/labeled_blank_node_subject.ttl1
-rw-r--r--tests/new/langtagged_LONG.ttl1
-rw-r--r--tests/new/langtagged_non_LONG.nt1
-rw-r--r--tests/new/langtagged_non_LONG.ttl1
-rw-r--r--tests/new/lantag_with_subtag.nt1
-rw-r--r--tests/new/lantag_with_subtag.ttl1
-rw-r--r--tests/new/last.nt7
-rw-r--r--tests/new/last.ttl1
-rw-r--r--tests/new/literal_false.nt1
-rw-r--r--tests/new/literal_false.ttl1
-rw-r--r--tests/new/literal_true.nt1
-rw-r--r--tests/new/literal_true.ttl1
-rw-r--r--tests/new/literal_with_BACKSPACE.nt1
-rw-r--r--tests/new/literal_with_BACKSPACE.ttl1
-rw-r--r--tests/new/literal_with_CARRIAGE_RETURN.nt1
-rw-r--r--tests/new/literal_with_CARRIAGE_RETURN.ttl1
-rw-r--r--tests/new/literal_with_CHARACTER_TABULATION.nt1
-rw-r--r--tests/new/literal_with_CHARACTER_TABULATION.ttl1
-rw-r--r--tests/new/literal_with_FORM_FEED.nt1
-rw-r--r--tests/new/literal_with_FORM_FEED.ttl1
-rw-r--r--tests/new/literal_with_LINE_FEED.nt1
-rw-r--r--tests/new/literal_with_LINE_FEED.ttl2
-rw-r--r--tests/new/literal_with_REVERSE_SOLIDUS.nt1
-rw-r--r--tests/new/literal_with_REVERSE_SOLIDUS.ttl1
-rw-r--r--tests/new/literal_with_escaped_BACKSPACE.ttl1
-rw-r--r--tests/new/literal_with_escaped_CARRIAGE_RETURN.ttl1
-rw-r--r--tests/new/literal_with_escaped_CHARACTER_TABULATION.ttl1
-rw-r--r--tests/new/literal_with_escaped_FORM_FEED.ttl1
-rw-r--r--tests/new/literal_with_escaped_LINE_FEED.ttl1
-rw-r--r--tests/new/literal_with_numeric_escape4.nt1
-rw-r--r--tests/new/literal_with_numeric_escape4.ttl1
-rw-r--r--tests/new/literal_with_numeric_escape8.ttl1
-rw-r--r--tests/new/localname_with_COLON.nt1
-rw-r--r--tests/new/localname_with_COLON.ttl2
-rw-r--r--tests/new/manifest.ttl605
-rw-r--r--tests/new/negative_numeric.nt1
-rw-r--r--tests/new/negative_numeric.ttl1
-rw-r--r--tests/new/nested_blankNodePropertyLists.nt3
-rw-r--r--tests/new/nested_blankNodePropertyLists.ttl1
-rw-r--r--tests/new/nested_collection.nt5
-rw-r--r--tests/new/nested_collection.ttl1
-rw-r--r--tests/new/numeric_with_leading_0.nt1
-rw-r--r--tests/new/numeric_with_leading_0.ttl1
-rw-r--r--tests/new/objectList_with_two_objects.nt2
-rw-r--r--tests/new/objectList_with_two_objects.ttl1
-rw-r--r--tests/new/old_style_base.ttl2
-rw-r--r--tests/new/old_style_prefix.ttl2
-rw-r--r--tests/new/percent_escaped_local_name.nt1
-rw-r--r--tests/new/percent_escaped_local_name.ttl2
-rw-r--r--tests/new/positive_numeric.nt1
-rw-r--r--tests/new/positive_numeric.ttl1
-rw-r--r--tests/new/predicateObjectList_with_two_objectLists.nt2
-rw-r--r--tests/new/predicateObjectList_with_two_objectLists.ttl1
-rw-r--r--tests/new/prefix_only_IRI.ttl2
-rw-r--r--tests/new/prefix_reassigned_and_used.nt1
-rw-r--r--tests/new/prefix_reassigned_and_used.ttl3
-rw-r--r--tests/new/prefixed_IRI_object.ttl2
-rw-r--r--tests/new/prefixed_IRI_predicate.ttl2
-rw-r--r--tests/new/prefixed_name_datatype.ttl2
-rw-r--r--tests/new/repeated_semis_at_end.ttl1
-rw-r--r--tests/new/repeated_semis_not_at_end.nt1
-rw-r--r--tests/new/repeated_semis_not_at_end.ttl1
-rw-r--r--tests/new/reserved_escaped_local_name.nt1
-rw-r--r--tests/new/reserved_escaped_local_name.ttl2
-rw-r--r--tests/new/sole_blankNodePropertyList.nt1
-rw-r--r--tests/new/sole_blankNodePropertyList.ttl1
-rw-r--r--tests/new/underscore_in_local_name.nt1
-rw-r--r--tests/new/underscore_in_local_name.ttl2
-rw-r--r--tests/tests-ttl/LICENSE40
-rw-r--r--tests/tests-ttl/README1
-rw-r--r--tests/tests-ttl/manifest.ttl1276
-rw-r--r--tests/tests-ttl/turtle-eval-bad-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-eval-bad-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-eval-bad-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-eval-bad-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-eval-struct-01.nt1
-rw-r--r--tests/tests-ttl/turtle-eval-struct-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-eval-struct-02.nt2
-rw-r--r--tests/tests-ttl/turtle-eval-struct-02.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-01.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-subm-02.nt3
-rw-r--r--tests/tests-ttl/turtle-subm-02.ttl7
-rw-r--r--tests/tests-ttl/turtle-subm-03.nt3
-rw-r--r--tests/tests-ttl/turtle-subm-03.ttl5
-rw-r--r--tests/tests-ttl/turtle-subm-04.nt3
-rw-r--r--tests/tests-ttl/turtle-subm-04.ttl5
-rw-r--r--tests/tests-ttl/turtle-subm-05.nt2
-rw-r--r--tests/tests-ttl/turtle-subm-05.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-06.nt4
-rw-r--r--tests/tests-ttl/turtle-subm-06.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-07.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-07.ttl3
-rw-r--r--tests/tests-ttl/turtle-subm-08.nt5
-rw-r--r--tests/tests-ttl/turtle-subm-08.ttl3
-rw-r--r--tests/tests-ttl/turtle-subm-09.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-09.ttl3
-rw-r--r--tests/tests-ttl/turtle-subm-10.nt4
-rw-r--r--tests/tests-ttl/turtle-subm-10.ttl10
-rw-r--r--tests/tests-ttl/turtle-subm-11.nt5
-rw-r--r--tests/tests-ttl/turtle-subm-11.ttl5
-rw-r--r--tests/tests-ttl/turtle-subm-12.nt4
-rw-r--r--tests/tests-ttl/turtle-subm-12.ttl10
-rw-r--r--tests/tests-ttl/turtle-subm-13.nt4
-rw-r--r--tests/tests-ttl/turtle-subm-13.ttl9
-rw-r--r--tests/tests-ttl/turtle-subm-14.nt2
-rw-r--r--tests/tests-ttl/turtle-subm-14.ttl7
-rw-r--r--tests/tests-ttl/turtle-subm-15.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-15.ttl6
-rw-r--r--tests/tests-ttl/turtle-subm-16.nt2
-rw-r--r--tests/tests-ttl/turtle-subm-16.ttl20
-rw-r--r--tests/tests-ttl/turtle-subm-17.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-17.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-18.nt2
-rw-r--r--tests/tests-ttl/turtle-subm-18.ttl6
-rw-r--r--tests/tests-ttl/turtle-subm-19.nt3
-rw-r--r--tests/tests-ttl/turtle-subm-19.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-20.nt3
-rw-r--r--tests/tests-ttl/turtle-subm-20.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-21.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-21.ttl3
-rw-r--r--tests/tests-ttl/turtle-subm-22.nt2
-rw-r--r--tests/tests-ttl/turtle-subm-22.ttl3
-rw-r--r--tests/tests-ttl/turtle-subm-23.nt7
-rw-r--r--tests/tests-ttl/turtle-subm-23.ttl14
-rw-r--r--tests/tests-ttl/turtle-subm-24.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-24.ttl4
-rw-r--r--tests/tests-ttl/turtle-subm-25.nt1
-rw-r--r--tests/tests-ttl/turtle-subm-25.ttl5
-rw-r--r--tests/tests-ttl/turtle-subm-26.nt22
-rw-r--r--tests/tests-ttl/turtle-subm-26.ttl22
-rw-r--r--tests/tests-ttl/turtle-subm-27.nt5
-rw-r--r--tests/tests-ttl/turtle-subm-27.ttl12
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-base-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-base-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-base-03.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-esc-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-esc-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-esc-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-esc-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-kw-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-kw-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-kw-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-kw-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-kw-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-lang-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-01.ttl5
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-02.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-03.ttl7
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-04.ttl5
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-05.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-06.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-07.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-08.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-09.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-10.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-11.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-12.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-n3-extras-13.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-num-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-num-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-num-03.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-num-04.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-num-05.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-pname-01.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-pname-02.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-pname-03.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-prefix-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-prefix-02.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-prefix-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-prefix-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-prefix-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-05.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-06.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-string-07.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-06.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-07.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-08.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-09.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-10.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-11.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-12.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-13.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-14.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-15.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-16.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-struct-17.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-uri-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-uri-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-uri-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-uri-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bad-uri-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-base-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-base-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-base-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-base-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-06.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-07.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-08.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-09.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-bnode-10.ttl5
-rw-r--r--tests/tests-ttl/turtle-syntax-datatypes-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-datatypes-02.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-file-01.ttl0
-rw-r--r--tests/tests-ttl/turtle-syntax-file-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-file-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-kw-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-kw-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-kw-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-lists-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-lists-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-lists-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-lists-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-lists-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-number-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-number-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-number-03.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-number-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-number-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-number-06.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-number-07.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-number-08.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-number-09.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-number-10.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-number-11.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-pname-esc-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-pname-esc-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-pname-esc-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-04.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-05.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-06.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-07.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-08.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-prefix-09.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-str-esc-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-str-esc-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-str-esc-03.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-02.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-03.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-04.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-05.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-06.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-07.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-string-08.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-string-09.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-string-10.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-string-11.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-struct-01.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-struct-02.ttl3
-rw-r--r--tests/tests-ttl/turtle-syntax-struct-03.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-struct-04.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-struct-05.ttl4
-rw-r--r--tests/tests-ttl/turtle-syntax-uri-01.ttl1
-rw-r--r--tests/tests-ttl/turtle-syntax-uri-02.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-uri-03.ttl2
-rw-r--r--tests/tests-ttl/turtle-syntax-uri-04.ttl3
-rwxr-xr-xwafbin83049 -> 83055 bytes
-rw-r--r--wscript121
348 files changed, 3342 insertions, 434 deletions
diff --git a/NEWS b/NEWS
index 64d0437d..6f9ab57b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
serd (0.18.3) unstable;
+ * Support most of the latest Turtle Editor's Draft
* Fix possible crash in serd_writer_end_anon() when writing invalid lists
- * Generate blank names like _:b1 _:B2 _:el3, not _:genid1 _:docid2 _:genid3
+ * Generate blank names like _:b1 and _:B2 not _:genid1 _:docid2
* Correctly handle posix_memalign failure
-- David Robillard <d@drobilla.net> Sun, 24 Feb 2013 02:05:30 -0500
diff --git a/serd.ttl b/serd.ttl
index 0feecba1..e3822087 100644
--- a/serd.ttl
+++ b/serd.ttl
@@ -1,5 +1,11 @@
@prefix doap: <http://usefulinc.com/ns/doap#> .
+<http://drobilla.net/drobilla#me>
+ a foaf:Person ;
+ foaf:name "David Robillard" ;
+ foaf:mbox <mailto:d@drobilla.net> ;
+ rdfs:seeAlso <http://drobilla.net/drobilla> .
+
<http://drobilla.net/sw/serd>
a doap:Project ;
doap:name "Serd" ;
@@ -13,4 +19,8 @@
doap:bug-database <http://dev.drobilla.net/> ;
doap:blog <http://drobilla.net/> ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:maintainer <http://drobilla.net/drobilla#me> .
+ doap:maintainer <http://drobilla.net/drobilla#me> ;
+ doap:repository [
+ a doap:SVNRepository ;
+ doap:location <http://svn.drobilla.net/serd/>
+ ] .
diff --git a/src/reader.c b/src/reader.c
index 149a3e28..b3accd3b 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -267,12 +267,11 @@ read_collection(SerdReader* reader, ReadContext ctx, Ref* dest);
static bool
read_predicateObjectList(SerdReader* reader, ReadContext ctx);
-// [40] hex ::= [#x30-#x39] | [#x41-#x46]
static inline uint8_t
-read_hex(SerdReader* reader)
+read_HEX(SerdReader* reader)
{
const uint8_t c = peek_byte(reader);
- if (in_range(c, 0x30, 0x39) || in_range(c, 0x41, 0x46)) {
+ if (is_digit(c) || in_range(c, 'A', 'F') || in_range(c, 'a', 'f')) {
return eat_byte_safe(reader, c);
} else {
return r_err(reader, SERD_ERR_BAD_SYNTAX,
@@ -280,12 +279,27 @@ read_hex(SerdReader* reader)
}
}
+// Read UCHAR escape, initial \ is already eaten by caller
static inline bool
-read_hex_escape(SerdReader* reader, unsigned length, Ref dest)
+read_UCHAR(SerdReader* reader, Ref dest)
{
+ const uint8_t b = peek_byte(reader);
+ unsigned length = 0;
+ switch (b) {
+ case 'U':
+ length = 8;
+ break;
+ case 'u':
+ length = 4;
+ break;
+ default:
+ return false;
+ }
+ eat_byte_safe(reader, b);
+
uint8_t buf[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (unsigned i = 0; i < length; ++i) {
- if (!(buf[i] = read_hex(reader))) {
+ if (!(buf[i] = read_HEX(reader))) {
return false;
}
}
@@ -334,32 +348,20 @@ read_hex_escape(SerdReader* reader, unsigned length, Ref dest)
return true;
}
+// Read ECHAR escape, initial \ is already eaten by caller
static inline bool
-read_character_escape(SerdReader* reader, Ref dest)
-{
- switch (peek_byte(reader)) {
- case '\\':
- push_byte(reader, dest, eat_byte_safe(reader, '\\'));
- return true;
- case 'u':
- eat_byte_safe(reader, 'u');
- return read_hex_escape(reader, 4, dest);
- case 'U':
- eat_byte_safe(reader, 'U');
- return read_hex_escape(reader, 8, dest);
- default:
- return false;
- }
-}
-
-static inline bool
-read_echaracter_escape(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
+read_ECHAR(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
{
- switch (peek_byte(reader)) {
+ const uint8_t c = peek_byte(reader);
+ switch (c) {
case 't':
eat_byte_safe(reader, 't');
push_byte(reader, dest, '\t');
return true;
+ case 'b':
+ eat_byte_safe(reader, 'b');
+ push_byte(reader, dest, '\b');
+ return true;
case 'n':
*flags |= SERD_HAS_NEWLINE;
eat_byte_safe(reader, 'n');
@@ -370,34 +372,15 @@ read_echaracter_escape(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
eat_byte_safe(reader, 'r');
push_byte(reader, dest, '\r');
return true;
- default:
- return read_character_escape(reader, dest);
- }
-}
-
-static inline bool
-read_scharacter_escape(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
-{
- switch (peek_byte(reader)) {
- case '"':
- *flags |= SERD_HAS_QUOTE;
- push_byte(reader, dest, eat_byte_safe(reader, '"'));
+ case 'f':
+ eat_byte_safe(reader, 'f');
+ push_byte(reader, dest, '\f');
return true;
- default:
- return read_echaracter_escape(reader, dest, flags);
- }
-}
-
-static inline bool
-read_ucharacter_escape(SerdReader* reader, Ref dest)
-{
- SerdNodeFlags flags = 0;
- switch (peek_byte(reader)) {
- case '>':
- push_byte(reader, dest, eat_byte_safe(reader, '>'));
+ case '\\': case '"': case '\'':
+ push_byte(reader, dest, eat_byte_safe(reader, c));
return true;
default:
- return read_echaracter_escape(reader, dest, &flags);
+ return false;
}
}
@@ -427,12 +410,11 @@ read_utf8_character(SerdReader* reader, Ref dest, uint8_t c)
} else if ((c & 0xF8) == 0xF0) { // Starts with `11110'
size = 4;
} else {
- return bad_char(reader, dest, "invalid UTF-8 start 0x%X\n",
- eat_byte_safe(reader, c));
+ return bad_char(reader, dest, "invalid UTF-8 start 0x%X\n", c);
}
char bytes[4];
- bytes[0] = eat_byte_safe(reader, c);
+ bytes[0] = c;
// Check character validity
for (unsigned i = 1; i < size; ++i) {
@@ -450,114 +432,19 @@ read_utf8_character(SerdReader* reader, Ref dest, uint8_t c)
return SERD_SUCCESS;
}
-// [38] character ::= '\u' hex hex hex hex
-// | '\U' hex hex hex hex hex hex hex hex
-// | '\\'
-// | [#x20-#x5B] | [#x5D-#x10FFFF]
+// Read one character (possibly multi-byte)
+// The first byte, c, has already been eaten by caller
static inline SerdStatus
-read_character(SerdReader* reader, Ref dest)
+read_character(SerdReader* reader, Ref dest, uint8_t c)
{
- const uint8_t c = peek_byte(reader);
- assert(c != '\\'); // Only called from methods that handle escapes first
- if (c == '\0') {
- r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected end of input\n", c);
- return SERD_ERR_BAD_SYNTAX;
- } else if (c < 0x20) {
- return bad_char(reader, dest,
- "unexpected control character 0x%X\n",
- eat_byte_safe(reader, c));
- } else if (!(c & 0x80)) {
- push_byte(reader, dest, eat_byte_safe(reader, c));
+ if (!(c & 0x80)) {
+ push_byte(reader, dest, c);
return SERD_SUCCESS;
} else {
return read_utf8_character(reader, dest, c);
}
}
-// [43] lcharacter ::= echaracter | '\"' | #x9 | #xA | #xD
-static inline SerdStatus
-read_lcharacter(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
-{
- const uint8_t c = peek_byte(reader);
- uint8_t buf[2];
- switch (c) {
- case '"':
- eat_byte_safe(reader, '\"');
- buf[0] = eat_byte_safe(reader, peek_byte(reader));
- buf[1] = eat_byte_safe(reader, peek_byte(reader));
- if (buf[0] == '\"' && buf[1] == '\"') {
- return SERD_FAILURE;
- } else {
- *flags |= SERD_HAS_QUOTE;
- push_byte(reader, dest, c);
- push_byte(reader, dest, buf[0]);
- push_byte(reader, dest, buf[1]);
- return SERD_SUCCESS;
- }
- case '\\':
- eat_byte_safe(reader, '\\');
- if (read_scharacter_escape(reader, dest, flags)) {
- return SERD_SUCCESS;
- } else {
- r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid escape `\\%c'\n", peek_byte(reader));
- return SERD_ERR_BAD_SYNTAX;
- }
- case 0xA: case 0xD:
- *flags |= SERD_HAS_NEWLINE;
- case 0x9:
- push_byte(reader, dest, eat_byte_safe(reader, c));
- return SERD_SUCCESS;
- default:
- return read_character(reader, dest);
- }
-}
-
-// [42] scharacter ::= ( echaracter - #x22 ) | '\"'
-static inline SerdStatus
-read_scharacter(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
-{
- uint8_t c = peek_byte(reader);
- switch (c) {
- case '\\':
- eat_byte_safe(reader, '\\');
- if (read_scharacter_escape(reader, dest, flags)) {
- return SERD_SUCCESS;
- } else {
- r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid escape `\\%c'\n", peek_byte(reader));
- return SERD_ERR_BAD_SYNTAX;
- }
- case '\"':
- return SERD_FAILURE;
- default:
- return read_character(reader, dest);
- }
-}
-
-// Spec: [41] ucharacter ::= ( character - #x3E ) | '\>'
-// Impl: [41] ucharacter ::= ( echaracter - #x3E ) | '\>'
-static inline SerdStatus
-read_ucharacter(SerdReader* reader, Ref dest)
-{
- const uint8_t c = peek_byte(reader);
- switch (c) {
- case '\\':
- eat_byte_safe(reader, '\\');
- if (read_ucharacter_escape(reader, dest)) {
- return SERD_SUCCESS;
- } else {
- r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid escape `\\%c'\n", peek_byte(reader));
- return SERD_FAILURE;
- }
- case '>':
- return SERD_FAILURE;
- default:
- return read_character(reader, dest);
- }
-}
-
// [10] comment ::= '#' ( [^#xA #xD] )*
static void
read_comment(SerdReader* reader)
@@ -617,131 +504,211 @@ eat_delim(SerdReader* reader, const char delim)
return false;
}
-// [37] longString ::= #x22 #x22 #x22 lcharacter* #x22 #x22 #x22
+// STRING_LITERAL_LONG_QUOTE and STRING_LITERAL_LONG_SINGLE_QUOTE
+// Initial triple quotes are already eaten by caller
static Ref
-read_longString(SerdReader* reader, SerdNodeFlags* flags)
+read_STRING_LITERAL_LONG(SerdReader* reader, SerdNodeFlags* flags, uint8_t q)
{
- Ref ref = push_node(reader, SERD_LITERAL, "", 0);
- SerdStatus st;
- while (!(st = read_lcharacter(reader, ref, flags))) {}
- if (st < SERD_ERR_UNKNOWN) {
- return ref;
+ Ref ref = push_node(reader, SERD_LITERAL, "", 0);
+ while (true) {
+ const uint8_t c = peek_byte(reader);
+ switch (c) {
+ case '\\':
+ eat_byte_safe(reader, c);
+ if (!read_ECHAR(reader, ref, flags) && !read_UCHAR(reader, ref)) {
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid escape `\\%c'\n", peek_byte(reader));
+ return pop_node(reader, ref);
+ }
+ break;
+ default:
+ if (c == q) {
+ eat_byte_safe(reader, q);
+ const uint8_t q2 = eat_byte_safe(reader, peek_byte(reader));
+ const uint8_t q3 = peek_byte(reader);
+ if (q2 == q && q3 == q) { // End of string
+ eat_byte_safe(reader, q3);
+ return ref;
+ } else {
+ *flags |= SERD_HAS_QUOTE;
+ push_byte(reader, ref, c);
+ read_character(reader, ref, q2);
+ }
+ } else {
+ read_character(reader, ref, eat_byte_safe(reader, c));
+ }
+ }
}
- return pop_node(reader, ref);
+ return ref;
}
-// [36] string ::= #x22 scharacter* #x22
+// STRING_LITERAL_QUOTE and STRING_LITERAL_SINGLE_QUOTE
+// Initial quote is already eaten by caller
static Ref
-read_string(SerdReader* reader, SerdNodeFlags* flags)
+read_STRING_LITERAL(SerdReader* reader, SerdNodeFlags* flags, uint8_t q)
{
- Ref ref = push_node(reader, SERD_LITERAL, "", 0);
- SerdStatus st;
- while (!(st = read_scharacter(reader, ref, flags))) {}
- if (st < SERD_ERR_UNKNOWN) {
- eat_byte_check(reader, '\"');
- return ref;
+ Ref ref = push_node(reader, SERD_LITERAL, "", 0);
+ while (true) {
+ const uint8_t c = peek_byte(reader);
+ switch (c) {
+ case '\n': case '\r':
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "line end in short string\n");
+ return pop_node(reader, ref);
+ case '\\':
+ eat_byte_safe(reader, c);
+ if (!read_ECHAR(reader, ref, flags) && !read_UCHAR(reader, ref)) {
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid escape `\\%c'\n", peek_byte(reader));
+ return pop_node(reader, ref);
+ }
+ break;
+ default:
+ if (c == q) {
+ eat_byte_check(reader, q);
+ return ref;
+ } else {
+ read_character(reader, ref, eat_byte_safe(reader, c));
+ }
+ }
}
- return pop_node(reader, ref);
+ eat_byte_check(reader, q);
+ return ref;
}
-// [35] quotedString ::= string | longString
static Ref
-read_quotedString(SerdReader* reader, SerdNodeFlags* flags)
+read_String(SerdReader* reader, SerdNodeFlags* flags)
{
- eat_byte_safe(reader, '\"'); // q1
+ const uint8_t q1 = peek_byte(reader);
+ if (q1 != '\"' && q1 != '\'') {
+ return 0;
+ }
+ eat_byte_safe(reader, q1);
+
const uint8_t q2 = peek_byte(reader);
- if (q2 != '\"') { // Non-empty single-quoted string
- return read_string(reader, flags);
+ if (q2 != q1) { // Short string (not triple quoted)
+ return read_STRING_LITERAL(reader, flags, q1);
}
eat_byte_safe(reader, q2);
const uint8_t q3 = peek_byte(reader);
- if (q3 != '\"') { // Empty single-quoted string
+ if (q3 != q1) { // Empty short string ("" or '')
return push_node(reader, SERD_LITERAL, "", 0);
}
- eat_byte_safe(reader, '\"');
- return read_longString(reader, flags);
+ eat_byte_safe(reader, q3);
+ return read_STRING_LITERAL_LONG(reader, flags, q1);
}
-// [34] relativeURI ::= ucharacter*
-static inline Ref
-read_relativeURI(SerdReader* reader)
+static bool
+read_PN_CHARS_BASE(SerdReader* reader, Ref dest)
{
- Ref ref = push_node(reader, SERD_URI, "", 0);
- SerdStatus st;
- while (!(st = read_ucharacter(reader, ref))) {}
- if (st < SERD_ERR_UNKNOWN) {
- return ref;
+ const uint8_t c = peek_byte(reader);
+ if (is_alpha(c)) { // TODO: UTF-8
+ push_byte(reader, dest, eat_byte_safe(reader, c));
+ return true;
}
- return pop_node(reader, ref);
+ return false;
}
-// [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]
-static inline uchar
-read_nameStartChar(SerdReader* reader)
+static bool
+read_PN_CHARS(SerdReader* reader, Ref dest)
{
const uint8_t c = peek_byte(reader);
- if (c == '_' || is_alpha(c) || is_digit(c)) { // TODO: Not correct
- return eat_byte_safe(reader, c);
+ if (is_alpha(c) || is_digit(c) || c == '_' || c == '-') { // TODO: UTF-8
+ push_byte(reader, dest, eat_byte_safe(reader, c));
+ return true;
}
- return 0;
+ return false;
}
-// [31] nameChar ::= nameStartChar | '-' | [0-9]
-// | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
-static inline uchar
-read_nameChar(SerdReader* reader)
+static bool
+read_PERCENT(SerdReader* reader, Ref dest)
+{
+ push_byte(reader, dest, eat_byte_safe(reader, '%'));
+ const uint8_t h1 = read_HEX(reader);
+ const uint8_t h2 = read_HEX(reader);
+ if (h1 && h2) {
+ push_byte(reader, dest, h1);
+ push_byte(reader, dest, h2);
+ return true;
+ }
+ return false;
+}
+
+static bool
+read_PLX(SerdReader* reader, Ref dest)
{
- uchar c = read_nameStartChar(reader);
- if (c)
- return c;
+ uint8_t c = peek_byte(reader);
+ switch (c) {
+ case '%':
+ return read_PERCENT(reader, dest);
+ case '\\':
+ eat_byte_safe(reader, c);
+ c = peek_byte(reader);
+ push_byte(reader, dest, eat_byte_safe(reader, c));
+ return true;
+ }
+ return false;
+}
- switch ((c = peek_byte(reader))) {
- case '-': case 0xB7: case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- return eat_byte_safe(reader, c);
- default: // TODO: 0x300-0x036F | 0x203F-0x2040
- return 0;
+static bool
+read_PN_LOCAL(SerdReader* reader, Ref dest)
+{
+ uint8_t c = peek_byte(reader);
+ if (is_digit(c) || c == ':' || c == '_') {
+ push_byte(reader, dest, eat_byte_safe(reader, c));
+ } else if (!read_PLX(reader, dest) && !read_PN_CHARS(reader, dest)) {
+ return false;
}
- return 0;
+
+ while ((c = peek_byte(reader))) { // Middle: (PN_CHARS | '.')*
+ if (/*c == '.' || */c == ':') {
+ push_byte(reader, dest, eat_byte_safe(reader, c));
+ } else if (!read_PLX(reader, dest) && !read_PN_CHARS(reader, dest)) {
+ break;
+ }
+ }
+
+ return dest;
}
-// [33] prefixName ::= ( nameStartChar - '_' ) nameChar*
static Ref
-read_prefixName(SerdReader* reader, Ref dest)
+read_PN_PREFIX(SerdReader* reader, Ref dest)
{
- uint8_t c = peek_byte(reader);
- if (c == '_') {
- r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `_'\n");
- return pop_node(reader, dest);
+ Ref prefix = dest ? dest : push_node(reader, SERD_CURIE, "", 0);
+
+ if (!read_PN_CHARS_BASE(reader, prefix)) { // First: PN_CHARS_BASE
+ if (prefix != dest) {
+ return pop_node(reader, prefix);
+ }
+ return dest;
}
- TRY_RET(c = read_nameStartChar(reader));
- if (!dest) {
- dest = push_node(reader, SERD_CURIE, "", 0);
+
+ uint8_t c;
+ while ((c = peek_byte(reader))) { // Middle: (PN_CHARS | '.')*
+ if (c == '.') {
+ push_byte(reader, prefix, eat_byte_safe(reader, c));
+ } else if (!read_PN_CHARS(reader, prefix)) {
+ break;
+ }
}
- push_byte(reader, dest, c);
- while ((c = read_nameChar(reader))) {
- push_byte(reader, dest, c);
+
+ if (c == '.' && !read_PN_CHARS(reader, prefix)) { // Last: PN_CHARS
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid prefix character\n");
}
- return dest;
+
+ return prefix;
}
-// [32] name ::= nameStartChar nameChar*
static Ref
-read_name(SerdReader* reader, Ref dest)
+read_PNAME_NS(SerdReader* reader, Ref dest)
{
- uchar c = read_nameStartChar(reader);
- if (!c) {
- return 0;
+ const Ref prefix = read_PN_PREFIX(reader, dest);
+ if (prefix && eat_byte_check(reader, ':') != ':') {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `:'\n");
}
- do {
- push_byte(reader, dest, c);
- } while ((c = read_nameChar(reader)) != 0);
- return dest;
+ return prefix;
}
// [29] language ::= [a-z]+ ('-' [a-z0-9]+ )*
@@ -767,35 +734,57 @@ read_language(SerdReader* reader)
return ref;
}
-// [28] uriref ::= '<' relativeURI '>'
static Ref
-read_uriref(SerdReader* reader)
+read_IRIREF(SerdReader* reader)
{
TRY_RET(eat_byte_check(reader, '<'));
- Ref const str = read_relativeURI(reader);
- if (str && eat_byte_check(reader, '>')) {
- return str;
+ Ref ref = push_node(reader, SERD_URI, "", 0);
+ while (true) {
+ const uint8_t c = peek_byte(reader);
+ switch (c) {
+ case '"': case '<': case '^': case '`': case '{': case '|': case '}':
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid IRI character `%c'\n", c);
+ return pop_node(reader, ref);
+ case '>':
+ eat_byte_safe(reader, c);
+ return ref;
+ case '\\':
+ eat_byte_safe(reader, c);
+ if (!read_UCHAR(reader, ref)) {
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid IRI character `%c'\n", c);
+ return pop_node(reader, ref);
+ }
+ break;
+ default:
+ if (c <= 0x20) {
+ return pop_node(reader, ref);
+ } else {
+ push_byte(reader, ref, eat_byte_safe(reader, c));
+ }
+ }
}
- return pop_node(reader, str);
}
-// [27] qname ::= prefixName? ':' name?
static Ref
-read_qname(SerdReader* reader, Ref dest, bool read_prefix)
+read_PrefixedName(SerdReader* reader, Ref dest, bool read_prefix)
{
- Ref str = 0;
if (!dest) {
dest = push_node(reader, SERD_CURIE, "", 0);
}
if (read_prefix) {
- read_prefixName(reader, dest);
+ if (!read_PNAME_NS(reader, dest)) {
+ return pop_node(reader, dest);
+ }
+ push_byte(reader, dest, ':');
}
- TRY_THROW(eat_byte_check(reader, ':'));
- push_byte(reader, dest, ':');
- str = read_name(reader, dest);
- return str ? str : dest;
-except:
- return pop_node(reader, dest);
+ if (!read_PN_LOCAL(reader, dest)) {
+ if (!read_prefix) {
+ return pop_node(reader, dest);
+ }
+ }
+ return dest;
}
static bool
@@ -841,7 +830,7 @@ read_number(SerdReader* reader, Ref* dest, Ref* datatype)
TRY_THROW(read_0_9(reader, ref, true));
} else {
// all other cases ::= ( '-' | '+' ) [0-9]+ ( . )? ( [0-9]+ )? ...
- assert(is_digit(c));
+ TRY_THROW(is_digit(c));
read_0_9(reader, ref, true);
if ((c = peek_byte(reader)) == '.') {
has_decimal = true;
@@ -858,7 +847,7 @@ read_number(SerdReader* reader, Ref* dest, Ref* datatype)
push_byte(reader, ref, eat_byte_safe(reader, c));
default: break;
}
- read_0_9(reader, ref, true);
+ TRY_THROW(read_0_9(reader, ref, true));
*datatype = push_node(reader, SERD_URI,
XSD_DOUBLE, sizeof(XSD_DOUBLE) - 1);
} else if (has_decimal) {
@@ -876,16 +865,15 @@ except:
return false;
}
-// [25] resource ::= uriref | qname
static bool
-read_resource(SerdReader* reader, Ref* dest)
+read_iri(SerdReader* reader, Ref* dest)
{
switch (peek_byte(reader)) {
case '<':
- *dest = read_uriref(reader);
+ *dest = read_IRIREF(reader);
break;
default:
- *dest = read_qname(reader, 0, true);
+ *dest = read_PrefixedName(reader, 0, true);
}
return *dest != 0;
}
@@ -894,7 +882,7 @@ static bool
read_literal(SerdReader* reader, Ref* dest,
Ref* datatype, Ref* lang, SerdNodeFlags* flags)
{
- Ref str = read_quotedString(reader, flags);
+ Ref str = read_String(reader, flags);
if (!str) {
return false;
}
@@ -903,7 +891,7 @@ read_literal(SerdReader* reader, Ref* dest,
case '^':
eat_byte_safe(reader, '^');
eat_byte_check(reader, '^');
- TRY_THROW(read_resource(reader, datatype));
+ TRY_THROW(read_iri(reader, datatype));
break;
case '@':
eat_byte_safe(reader, '@');
@@ -912,6 +900,8 @@ read_literal(SerdReader* reader, Ref* dest,
*dest = str;
return true;
except:
+ pop_node(reader, *datatype);
+ pop_node(reader, *lang);
pop_node(reader, str);
return false;
}
@@ -936,20 +926,24 @@ read_verb(SerdReader* reader, Ref* dest)
bool ret;
switch (peek_byte(reader)) {
case '<':
- ret = (*dest = read_uriref(reader));
+ ret = (*dest = read_IRIREF(reader));
break;
default:
/* Either a qname, or "a". Read the prefix first, and if it is in fact
"a", produce that instead.
*/
- *dest = read_prefixName(reader, 0);
+ *dest = read_PN_PREFIX(reader, 0);
node = deref(reader, *dest);
if (node && node->n_bytes == 1 && node->buf[0] == 'a'
&& is_token_end(peek_byte(reader))) {
pop_node(reader, *dest);
ret = (*dest = push_node(reader, SERD_URI, NS_RDF "type", 47));
} else {
- ret = (*dest = read_qname(reader, *dest, false));
+ ret = (*dest = read_PrefixedName(reader, *dest, false));
+ }
+ if (*dest && !strncmp((char*)deref(reader, *dest)->buf, "_:", 2)) {
+ *dest = pop_node(reader, *dest);
+ return false;
}
}
read_ws_star(reader);
@@ -958,51 +952,71 @@ read_verb(SerdReader* reader, Ref* dest)
// [26] nodeID ::= '_:' name
static Ref
-read_nodeID(SerdReader* reader)
+read_BLANK_NODE_LABEL(SerdReader* reader)
{
eat_byte_safe(reader, '_');
eat_byte_check(reader, ':');
Ref ref = push_node(reader, SERD_BLANK,
reader->bprefix ? (char*)reader->bprefix : "",
reader->bprefix_len);
- if (!read_name(reader, ref)) {
- return r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid character at start of name\n");
+
+ uint8_t c = peek_byte(reader); // First: (PN_CHARS | '_' | [0-9])
+ if (is_digit(c) || c == '_') {
+ push_byte(reader, ref, c);
+ } else if (!read_PN_CHARS(reader, ref)) {
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid name start character\n");
+ return pop_node(reader, ref);
+ }
+
+ while ((c = peek_byte(reader))) { // Middle: (PN_CHARS | '.')*
+ if (c == '.') {
+ push_byte(reader, ref, eat_byte_safe(reader, c));
+ } else if (!read_PN_CHARS(reader, ref)) {
+ break;
+ }
}
+
+ if (c == '.' && !read_PN_CHARS(reader, ref)) { // Last: PN_CHARS
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid name character\n");
+ return pop_node(reader, ref);
+ }
+
if (reader->syntax == SERD_TURTLE) {
const char* const buf = (const char*)deref(reader, ref)->buf;
- if (buf[0] == 'b' && is_digit(buf[1])) {
- ((char*)buf)[0] = 'B'; // Prevent clash
- reader->seen_genid = true;
- } else if (reader->seen_genid && buf[0] == 'B') {
- r_err(reader, SERD_ERR_ID_CLASH,
- "found both `b' and `B' blank IDs, prefix required\n");
- return pop_node(reader, ref);
+ if (is_digit(buf[1])) {
+ if (buf[0] == 'b') {
+ ((char*)buf)[0] = 'B'; // Prevent clash
+ reader->seen_genid = true;
+ } else if (reader->seen_genid && buf[0] == 'B') {
+ r_err(reader, SERD_ERR_ID_CLASH,
+ "found both `b' and `B' blank IDs, prefix required\n");
+ return pop_node(reader, ref);
+ }
}
}
return ref;
}
static void
-set_blank_id(SerdReader* reader, Ref ref, const char* b, size_t buf_size)
+set_blank_id(SerdReader* reader, Ref ref, size_t buf_size)
{
SerdNode* node = deref(reader, ref);
const char* prefix = reader->bprefix ? (const char*)reader->bprefix : "";
node->n_bytes = node->n_chars = snprintf(
- (char*)node->buf, buf_size, "%s%s%u", prefix, b, reader->next_id++);
+ (char*)node->buf, buf_size, "%sb%u", prefix, reader->next_id++);
}
static size_t
genid_size(SerdReader* reader)
{
- return reader->bprefix_len + 2 + 10 + 1; // + "el" + UINT32_MAX + \0
+ return reader->bprefix_len + 1 + 10 + 1; // + "b" + UINT32_MAX + \0
}
static Ref
-blank_id(SerdReader* reader, const char* b)
+blank_id(SerdReader* reader)
{
Ref ref = push_node_padded(reader, genid_size(reader), SERD_BLANK, "", 0);
- set_blank_id(reader, ref, b, genid_size(reader));
+ set_blank_id(reader, ref, genid_size(reader));
return ref;
}
@@ -1017,7 +1031,7 @@ read_blank(SerdReader* reader, ReadContext ctx, bool subject, Ref* dest)
bool empty;
switch (peek_byte(reader)) {
case '_':
- return (*dest = read_nodeID(reader));
+ return (*dest = read_BLANK_NODE_LABEL(reader));
case '[':
eat_byte_safe(reader, '[');
if ((empty = peek_delim(reader, ']'))) {
@@ -1026,7 +1040,7 @@ read_blank(SerdReader* reader, ReadContext ctx, bool subject, Ref* dest)
*ctx.flags |= (subject) ? SERD_ANON_S_BEGIN : SERD_ANON_O_BEGIN;
}
- *dest = blank_id(reader, "b");
+ *dest = blank_id(reader);
if (ctx.subject) {
TRY_RET(emit_statement(reader, ctx, *dest, 0, 0));
}
@@ -1085,20 +1099,21 @@ read_object(SerdReader* reader, ReadContext ctx)
TRY_THROW(ret = read_blank(reader, ctx, false, &o));
break;
case '<': case ':':
- TRY_THROW(ret = read_resource(reader, &o));
+ TRY_THROW(ret = read_iri(reader, &o));
break;
case '+': case '-': case '.': case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7': case '8': case '9':
TRY_THROW(ret = read_number(reader, &o, &datatype));
break;
case '\"':
+ case '\'':
TRY_THROW(ret = read_literal(reader, &o, &datatype, &lang, &flags));
break;
default:
/* Either a boolean literal, or a qname. Read the prefix first, and if
it is in fact a "true" or "false" literal, produce that instead.
*/
- o = read_prefixName(reader, 0);
+ o = read_PN_PREFIX(reader, 0);
node = deref(reader, o);
if (node && is_token_end(peek_byte(reader)) &&
((node->n_bytes == 4 && !memcmp(node->buf, "true", 4))
@@ -1108,7 +1123,10 @@ read_object(SerdReader* reader, ReadContext ctx)
XSD_BOOLEAN, XSD_BOOLEAN_LEN);
} else {
o = o ? o : push_node(reader, SERD_CURIE, "", 0);
- o = read_qname(reader, o, false);
+ o = read_PrefixedName(reader, o, false);
+ if (!o) {
+ pop_node(reader, o);
+ }
}
ret = o;
}
@@ -1152,6 +1170,8 @@ read_predicateObjectList(SerdReader* reader, ReadContext ctx)
ctx.predicate = pop_node(reader, ctx.predicate);
while (eat_delim(reader, ';')) {
switch (peek_byte(reader)) {
+ case ';':
+ continue;
case '.': case ']':
return true;
default:
@@ -1183,7 +1203,7 @@ read_collection(SerdReader* reader, ReadContext ctx, Ref* dest)
{
eat_byte_safe(reader, '(');
bool end = peek_delim(reader, ')');
- *dest = end ? reader->rdf_nil : blank_id(reader, "el");
+ *dest = end ? reader->rdf_nil : blank_id(reader);
if (ctx.subject) {
// subject predicate _:head
*ctx.flags |= (end ? 0 : SERD_LIST_O_BEGIN);
@@ -1216,9 +1236,9 @@ read_collection(SerdReader* reader, ReadContext ctx, Ref* dest)
/* Give rest a new ID. Done as late as possible to ensure it is
used and > IDs generated by read_object above. */
if (!rest) {
- rest = n2 = blank_id(reader, "el"); // First pass, push
+ rest = n2 = blank_id(reader); // First pass, push
} else {
- set_blank_id(reader, rest, "el", genid_size(reader));
+ set_blank_id(reader, rest, genid_size(reader));
}
}
@@ -1238,15 +1258,18 @@ read_collection(SerdReader* reader, ReadContext ctx, Ref* dest)
// [11] subject ::= resource | blank
static Ref
-read_subject(SerdReader* reader, ReadContext ctx)
+read_subject(SerdReader* reader, ReadContext ctx, bool* nested)
{
Ref subject = 0;
switch (peek_byte(reader)) {
- case '[': case '(': case '_':
+ case '[': case '(':
+ *nested = true;
+ // nobreak
+ case '_':
read_blank(reader, ctx, true, &subject);
break;
default:
- read_resource(reader, &subject);
+ read_iri(reader, &subject);
}
return subject;
}
@@ -1256,12 +1279,19 @@ read_subject(SerdReader* reader, ReadContext ctx)
static bool
read_triples(SerdReader* reader, ReadContext ctx)
{
- const Ref subject = read_subject(reader, ctx);
+ bool nested = false;
+ const Ref subject = read_subject(reader, ctx, &nested);
bool ret = false;
if (subject) {
ctx.subject = subject;
- TRY_RET(read_ws_plus(reader));
- ret = read_predicateObjectList(reader, ctx);
+ if (nested) {
+ read_ws_star(reader);
+ read_predicateObjectList(reader, ctx);
+ ret = true;
+ } else {
+ TRY_RET(read_ws_plus(reader));
+ ret = read_predicateObjectList(reader, ctx);
+ }
pop_node(reader, subject);
}
ctx.subject = ctx.predicate = 0;
@@ -1276,7 +1306,7 @@ read_base(SerdReader* reader)
eat_string(reader, "base", 4);
TRY_RET(read_ws_plus(reader));
Ref uri;
- TRY_RET(uri = read_uriref(reader));
+ TRY_RET(uri = read_IRIREF(reader));
if (reader->base_sink) {
reader->base_sink(reader->handle, deref(reader, uri));
}
@@ -1289,26 +1319,29 @@ read_base(SerdReader* reader)
static bool
read_prefixID(SerdReader* reader)
{
- bool ret = true;
- Ref name = 0;
- Ref uri = 0;
+ bool ret = true;
// `@' is already eaten in read_directive
eat_string(reader, "prefix", 6);
TRY_RET(read_ws_plus(reader));
- name = read_prefixName(reader, 0);
- if (!name) {
- name = push_node(reader, SERD_LITERAL, "", 0);
+
+ Ref name = push_node(reader, SERD_LITERAL, "", 0);
+ if (!read_PNAME_NS(reader, name)) {
+ return pop_node(reader, name);
}
- TRY_THROW(eat_byte_check(reader, ':') == ':');
+
read_ws_star(reader);
- TRY_THROW(uri = read_uriref(reader));
+ const Ref uri = read_IRIREF(reader);
+ if (!uri) {
+ pop_node(reader, name);
+ return false;
+ }
+
if (reader->prefix_sink) {
ret = !reader->prefix_sink(reader->handle,
deref(reader, name),
deref(reader, uri));
}
pop_node(reader, uri);
-except:
pop_node(reader, name);
return ret;
}
diff --git a/src/writer.c b/src/writer.c
index a9574d76..75af4b57 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -145,17 +145,133 @@ sink(const void* buf, size_t len, SerdWriter* writer)
}
}
+// Parse a UTF-8 character, set *size to the length, and return the code point
+static inline uint32_t
+parse_utf8_char(SerdWriter* writer, const uint8_t* utf8, size_t* size)
+{
+ uint32_t c = 0;
+ if ((utf8[0] & 0x80) == 0) { // Starts with `0'
+ *size = 1;
+ c = utf8[0];
+ } else if ((utf8[0] & 0xE0) == 0xC0) { // Starts with `110'
+ *size = 2;
+ c = utf8[0] & 0x1F;
+ } else if ((utf8[0] & 0xF0) == 0xE0) { // Starts with `1110'
+ *size = 3;
+ c = utf8[0] & 0x0F;
+ } else if ((utf8[0] & 0xF8) == 0xF0) { // Starts with `11110'
+ *size = 4;
+ c = utf8[0] & 0x07;
+ } else {
+ w_err(writer, SERD_ERR_BAD_ARG, "invalid UTF-8: %X\n", utf8[0]);
+ *size = 0;
+ return 0;
+ }
+
+ size_t i = 0;
+ uint8_t in = utf8[i++];
+
+#define READ_BYTE() \
+ in = utf8[i++] & 0x3f; \
+ c = (c << 6) | in;
+
+ switch (*size) {
+ case 4: READ_BYTE();
+ case 3: READ_BYTE();
+ case 2: READ_BYTE();
+ }
+
+ return c;
+}
+
+// Write a single character, as an escape for single byte characters
+// (Caller prints any single byte characters that don't need escaping)
+static size_t
+write_character(SerdWriter* writer, const uint8_t* utf8, size_t* size)
+{
+ const uint8_t replacement_char[] = { 0xEF, 0xBF, 0xBD };
+ char escape[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ const uint8_t in = utf8[0];
+
+ uint32_t c = parse_utf8_char(writer, utf8, size);
+ switch (*size) {
+ case 0:
+ w_err(writer, SERD_ERR_BAD_ARG, "invalid UTF-8: %X\n", in);
+ return sink(replacement_char, sizeof(replacement_char), writer);
+ case 1:
+ snprintf(escape, sizeof(escape), "\\u%04X", in);
+ return sink(escape, 6, writer);
+ default:
+ break;
+ }
+
+ if (!(writer->style & SERD_STYLE_ASCII)) {
+ // Write UTF-8 character directly to UTF-8 output
+ return sink(utf8, *size, writer);
+ }
+
+ if (c < 0xFFFF) {
+ snprintf(escape, sizeof(escape), "\\u%04X", c);
+ return sink(escape, 6, writer);
+ } else {
+ snprintf(escape, sizeof(escape), "\\U%08X", c);
+ return sink(escape, 10, writer);
+ }
+}
+
+static inline bool
+uri_must_escape(const uint8_t c)
+{
+ switch (c) {
+ case ' ': case '"': case '<': case '>': case '\\':
+ case '^': case '`': case '{': case '|': case '}':
+ return true;
+ default:
+ return !in_range(c, 0x20, 0x7E);
+ }
+}
+
+static size_t
+write_uri(SerdWriter* writer, const uint8_t* utf8, size_t n_bytes)
+{
+ size_t len = 0;
+ for (size_t i = 0; i < n_bytes;) {
+ size_t j = i; // Index of next character that must be escaped
+ for (; j < n_bytes; ++j) {
+ if (uri_must_escape(utf8[j])) {
+ break;
+ }
+ }
+
+ if (j > i) {
+ // Bulk write all characters up to this special one
+ len += sink(&utf8[i], j - i, writer);
+ i = j;
+ continue;
+ }
+
+ // Write UTF-8 character
+ size_t size = 0;
+ len += write_character(writer, utf8 + i, &size);
+ i += size;
+
+ if (size == 0) {
+ return len;
+ }
+ }
+ return len;
+}
+
static size_t
write_text(SerdWriter* writer, TextContext ctx,
const uint8_t* utf8, size_t n_bytes)
{
- size_t len = 0;
- char escape[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ size_t len = 0;
for (size_t i = 0; i < n_bytes;) {
// Fast bulk write for long strings of printable ASCII
size_t j = i;
for (; j < n_bytes; ++j) {
- if (utf8[j] == '>' || utf8[j] == '\\' || utf8[j] == '"'
+ if (utf8[j] == '\\' || utf8[j] == '"'
|| (!in_range(utf8[j], 0x20, 0x7E))) {
break;
}
@@ -174,82 +290,27 @@ write_text(SerdWriter* writer, TextContext ctx,
} else if (in == '\"' && i == n_bytes) {
len += sink("\\\"", 2, writer); continue; // '"' at string end
}
- } else {
+ } else if (ctx == WRITE_STRING) {
switch (in) {
case '\\': len += sink("\\\\", 2, writer); continue;
case '\n': len += sink("\\n", 2, writer); continue;
case '\r': len += sink("\\r", 2, writer); continue;
case '\t': len += sink("\\t", 2, writer); continue;
- case '"':
- if (ctx == WRITE_STRING) {
- len += sink("\\\"", 2, writer);
- continue;
- } // else fall-through
+ case '\b': len += sink("\\b", 2, writer); continue;
+ case '\f': len += sink("\\f", 2, writer); continue;
+ case '"': len += sink("\\\"", 2, writer); continue;
default: break;
}
-
- if ((ctx == WRITE_STRING && in == '"') ||
- (ctx == WRITE_URI && in == '>')) {
- snprintf(escape, sizeof(escape), "\\u%04X",
- ctx == WRITE_STRING ? '"' : '>');
- len += sink(escape, 6, writer);
- continue;
- }
- }
-
- uint32_t c = 0;
- size_t size = 0;
- if ((in & 0x80) == 0) { // Starts with `0'
- c = in & 0x7F;
- if (in_range(c, 0x20, 0x7E)
- || (is_space(c) && ctx == WRITE_LONG_STRING)) {
- len += sink(&in, 1, writer); // Print ASCII character
- } else {
- snprintf(escape, sizeof(escape), "\\u%04X", c);
- len += sink(escape, 6, writer); // ASCII control character
- }
- continue;
- } else if ((in & 0xE0) == 0xC0) { // Starts with `110'
- size = 2;
- c = in & 0x1F;
- } else if ((in & 0xF0) == 0xE0) { // Starts with `1110'
- size = 3;
- c = in & 0x0F;
- } else if ((in & 0xF8) == 0xF0) { // Starts with `11110'
- size = 4;
- c = in & 0x07;
- } else {
- w_err(writer, SERD_ERR_BAD_ARG, "invalid UTF-8: %X\n", in);
- const uint8_t replacement_char[] = { 0xEF, 0xBF, 0xBD };
- len += sink(replacement_char, sizeof(replacement_char), writer);
- return len;
- }
-
- if (ctx != WRITE_URI && !(writer->style & SERD_STYLE_ASCII)) {
- // Write UTF-8 character directly to UTF-8 output
- // TODO: Always parse and validate character?
- len += sink(utf8 + i - 1, size, writer);
- i += size - 1;
- continue;
}
-#define READ_BYTE() \
- in = utf8[i++] & 0x3f; \
- c = (c << 6) | in;
+ size_t size = 0;
+ len += write_character(writer, utf8 + i - 1, &size);
- switch (size) {
- case 4: READ_BYTE();
- case 3: READ_BYTE();
- case 2: READ_BYTE();
+ if (size == 0) {
+ return len;
}
- if (c < 0xFFFF) {
- snprintf(escape, sizeof(escape), "\\u%04X", c);
- len += sink(escape, 6, writer);
- } else {
- snprintf(escape, sizeof(escape), "\\U%08X", c);
- len += sink(escape, 10, writer);
- }
+ i += size - 1;
}
return len;
}
@@ -257,8 +318,7 @@ write_text(SerdWriter* writer, TextContext ctx,
static size_t
uri_sink(const void* buf, size_t len, void* stream)
{
- return write_text((SerdWriter*)stream, WRITE_URI,
- (const uint8_t*)buf, len);
+ return write_uri((SerdWriter*)stream, (const uint8_t*)buf, len);
}
static void
@@ -369,8 +429,8 @@ write_node(SerdWriter* writer,
return false;
}
sink("<", 1, writer);
- write_text(writer, WRITE_URI, uri_prefix.buf, uri_prefix.len);
- write_text(writer, WRITE_URI, uri_suffix.buf, uri_suffix.len);
+ write_uri(writer, uri_prefix.buf, uri_prefix.len);
+ write_uri(writer, uri_suffix.buf, uri_suffix.len);
sink(">", 1, writer);
break;
case SERD_TURTLE:
@@ -420,9 +480,9 @@ write_node(SerdWriter* writer,
SerdNode prefix;
SerdChunk suffix;
if (serd_env_qualify(writer->env, node, &prefix, &suffix)) {
- write_text(writer, WRITE_URI, prefix.buf, prefix.n_bytes);
+ write_uri(writer, prefix.buf, prefix.n_bytes);
sink(":", 1, writer);
- write_text(writer, WRITE_URI, suffix.buf, suffix.len);
+ write_uri(writer, suffix.buf, suffix.len);
break;
}
}
@@ -442,7 +502,7 @@ write_node(SerdWriter* writer,
&uri, &writer->base_uri, root, uri_sink, writer);
}
} else {
- write_text(writer, WRITE_URI, node->buf, node->n_bytes);
+ write_uri(writer, node->buf, node->n_bytes);
}
sink(">", 1, writer);
default:
@@ -749,7 +809,7 @@ serd_writer_set_prefix(SerdWriter* writer,
sink("@prefix ", 8, writer);
sink(name->buf, name->n_bytes, writer);
sink(": <", 3, writer);
- write_text(writer, WRITE_URI, uri->buf, uri->n_bytes);
+ write_uri(writer, uri->buf, uri->n_bytes);
sink("> .\n", 4, writer);
}
writer->indent = 0;
diff --git a/tests/good/test-07.nt b/tests/good/test-07.nt
index 923f26a4..e62cede5 100644
--- a/tests/good/test-07.nt
+++ b/tests/good/test-07.nt
@@ -1,5 +1,5 @@
-<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:el1 .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el2 .
-_:el2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
-_:el2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/good/test-29.nt b/tests/good/test-29.nt
deleted file mode 100644
index 612052d3..00000000
--- a/tests/good/test-29.nt
+++ /dev/null
@@ -1 +0,0 @@
-<http://example.org/node> <http://example.org/prop> <scheme:\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\t\n\u000B\u000C\r\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F !"#$%&'()*+,-./0123456789:/<=\u003E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007F> .
diff --git a/tests/good/test-29.ttl b/tests/good/test-29.ttl
deleted file mode 100644
index 612052d3..00000000
--- a/tests/good/test-29.ttl
+++ /dev/null
@@ -1 +0,0 @@
-<http://example.org/node> <http://example.org/prop> <scheme:\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\t\n\u000B\u000C\r\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F !"#$%&'()*+,-./0123456789:/<=\u003E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007F> .
diff --git a/tests/good/test-backspace.nt b/tests/good/test-backspace.nt
index ad4806cf..3a88c436 100644
--- a/tests/good/test-backspace.nt
+++ b/tests/good/test-backspace.nt
@@ -1,2 +1,2 @@
-<http://example.org/thing> <http://example.org/label> "\u0008" .
-<http://example.org/thing> <http://example.org/label> "\uFFFD" .
+<http://example.org/thing> <http://example.org/label> "\b" .
+<http://example.org/thing> <http://example.org/label> "\b" .
diff --git a/tests/good/test-blank-in-list.nt b/tests/good/test-blank-in-list.nt
index 253087e7..36bac6d7 100644
--- a/tests/good/test-blank-in-list.nt
+++ b/tests/good/test-blank-in-list.nt
@@ -1,4 +1,4 @@
-<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:el1 .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b2 .
+<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b2 .
_:b2 <http://example.org/stuff/1.0/c> <http://example.org/stuff/1.0/d> .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/good/test-escapes.ttl b/tests/good/test-escapes.ttl
index ff306b15..9898e883 100644
--- a/tests/good/test-escapes.ttl
+++ b/tests/good/test-escapes.ttl
@@ -1,2 +1,2 @@
<http://example.org/thing> <http://example.org/comment> "\\\r\n\t" .
-<http://example.org/thing> <http://example.org/comment> <http://example.org/\>> . \ No newline at end of file
+<http://example.org/thing> <http://example.org/comment> <http://example.org/\u003E> . \ No newline at end of file
diff --git a/tests/good/test-list-in-blank.nt b/tests/good/test-list-in-blank.nt
index b7f631da..108363f2 100644
--- a/tests/good/test-list-in-blank.nt
+++ b/tests/good/test-list-in-blank.nt
@@ -1,6 +1,6 @@
<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:b1 .
-_:b1 <http://example.org/stuff/1.0/c> _:el2 .
-_:el2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
-_:el2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el3 .
-_:el3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
-_:el3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b1 <http://example.org/stuff/1.0/c> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b3 .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/good/test-list-subject.nt b/tests/good/test-list-subject.nt
index ef87b0f2..e4f9c40c 100644
--- a/tests/good/test-list-subject.nt
+++ b/tests/good/test-list-subject.nt
@@ -1,6 +1,6 @@
<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el2 .
-_:el2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
-_:el2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
diff --git a/tests/good/test-pretty.nt b/tests/good/test-pretty.nt
index f96a10e2..9251563a 100644
--- a/tests/good/test-pretty.nt
+++ b/tests/good/test-pretty.nt
@@ -2,33 +2,33 @@
_:b1 <http://example.org/isA> <http://example.org/Blank> .
<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.org/sameAs> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
_:b2 <http://example.org/sameAs> _:b3 .
-_:el4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
-_:el4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el5 .
-_:el5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
-_:el5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el6 .
-_:el6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "pear" .
-_:el6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:el4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
-_:el7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:el8 .
-_:el8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/a> .
-_:el8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el9 .
-_:el9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/b> .
-_:el9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:el7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el10 .
-_:el10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:el11 .
-_:el11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/c> .
-_:el11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el12 .
-_:el12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/d> .
-_:el12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:el10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:el7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
-_:b13 <http://example.org/list> _:el14 .
-_:el14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
-_:el14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el15 .
-_:el15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
-_:el15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el16 .
-_:el16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "pear" .
-_:el16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b5 .
+_:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
+_:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b6 .
+_:b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "pear" .
+_:b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
+_:b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b8 .
+_:b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/a> .
+_:b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b9 .
+_:b9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/b> .
+_:b9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b10 .
+_:b10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b11 .
+_:b11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/c> .
+_:b11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b12 .
+_:b12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.org/d> .
+_:b12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
+_:b13 <http://example.org/list> _:b14 .
+_:b14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:b14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b15 .
+_:b15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
+_:b15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b16 .
+_:b16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "pear" .
+_:b16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
_:b17 <http://example.org/a> <http://example.org/b> .
_:b17 <http://example.org/a> <http://example.org/c> .
_:b17 <http://example.org/a> <http://example.org/d> .
@@ -37,10 +37,10 @@ _:b19 <http://example.org/b> <http://example.org/c> .
_:b19 <http://example.org/d> <http://example.org/e> .
_:b18 <http://example.org/a> _:b20 .
_:b20 <http://example.org/f> <http://example.org/g> .
-_:b21 <http://example.org/list> _:el22 .
-_:el22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b23 .
+_:b21 <http://example.org/list> _:b22 .
+_:b22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b23 .
_:b23 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Apple> .
-_:el22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:el24 .
-_:el24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b25 .
+_:b22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b24 .
+_:b24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b25 .
_:b25 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Banana> .
-_:el24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/good/test-uri-escape.nt b/tests/good/test-uri-escape.nt
new file mode 100644
index 00000000..bdb27185
--- /dev/null
+++ b/tests/good/test-uri-escape.nt
@@ -0,0 +1 @@
+<http://example.org/node> <http://example.org/prop> <scheme:\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u0020!\u0022#$%&'()*+,-./0123456789:/\u003C=\u003E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\u005C]\u005E_\u0060abcdefghijklmnopqrstuvwxyz\u007B\u007C\u007D~\u007F> .
diff --git a/tests/good/test-uri-escape.ttl b/tests/good/test-uri-escape.ttl
new file mode 100644
index 00000000..bdb27185
--- /dev/null
+++ b/tests/good/test-uri-escape.ttl
@@ -0,0 +1 @@
+<http://example.org/node> <http://example.org/prop> <scheme:\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u0020!\u0022#$%&'()*+,-./0123456789:/\u003C=\u003E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\u005C]\u005E_\u0060abcdefghijklmnopqrstuvwxyz\u007B\u007C\u007D~\u007F> .
diff --git a/tests/new/HYPHEN_MINUS_in_local_name.nt b/tests/new/HYPHEN_MINUS_in_local_name.nt
new file mode 100644
index 00000000..25546b38
--- /dev/null
+++ b/tests/new/HYPHEN_MINUS_in_local_name.nt
@@ -0,0 +1 @@
+<http://a.example/s-> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/HYPHEN_MINUS_in_local_name.ttl b/tests/new/HYPHEN_MINUS_in_local_name.ttl
new file mode 100644
index 00000000..0340b8c8
--- /dev/null
+++ b/tests/new/HYPHEN_MINUS_in_local_name.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+p:s- <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/IRIREF_datatype.nt b/tests/new/IRIREF_datatype.nt
new file mode 100644
index 00000000..c333a5f6
--- /dev/null
+++ b/tests/new/IRIREF_datatype.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/new/IRIREF_datatype.ttl b/tests/new/IRIREF_datatype.ttl
new file mode 100644
index 00000000..c333a5f6
--- /dev/null
+++ b/tests/new/IRIREF_datatype.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/new/IRI_subject.nt b/tests/new/IRI_subject.nt
new file mode 100644
index 00000000..01125e50
--- /dev/null
+++ b/tests/new/IRI_subject.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/IRI_subject.ttl b/tests/new/IRI_subject.ttl
new file mode 100644
index 00000000..01125e50
--- /dev/null
+++ b/tests/new/IRI_subject.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/IRI_with_all_punctuation.nt b/tests/new/IRI_with_all_punctuation.nt
new file mode 100644
index 00000000..94158773
--- /dev/null
+++ b/tests/new/IRI_with_all_punctuation.nt
@@ -0,0 +1 @@
+<scheme:!$%25&amp;'()*+,-./0123456789:/@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/IRI_with_all_punctuation.ttl b/tests/new/IRI_with_all_punctuation.ttl
new file mode 100644
index 00000000..94158773
--- /dev/null
+++ b/tests/new/IRI_with_all_punctuation.ttl
@@ -0,0 +1 @@
+<scheme:!$%25&amp;'()*+,-./0123456789:/@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/IRI_with_eight_digit_numeric_escape.ttl b/tests/new/IRI_with_eight_digit_numeric_escape.ttl
new file mode 100644
index 00000000..434034e7
--- /dev/null
+++ b/tests/new/IRI_with_eight_digit_numeric_escape.ttl
@@ -0,0 +1 @@
+<http://a.example/\U00000073> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/IRI_with_four_digit_numeric_escape.ttl b/tests/new/IRI_with_four_digit_numeric_escape.ttl
new file mode 100644
index 00000000..4163636e
--- /dev/null
+++ b/tests/new/IRI_with_four_digit_numeric_escape.ttl
@@ -0,0 +1 @@
+<http://a.example/\u0073> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/LITERAL1.nt b/tests/new/LITERAL1.nt
new file mode 100644
index 00000000..3aba89e4
--- /dev/null
+++ b/tests/new/LITERAL1.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "x" .
diff --git a/tests/new/LITERAL1.ttl b/tests/new/LITERAL1.ttl
new file mode 100644
index 00000000..725a2403
--- /dev/null
+++ b/tests/new/LITERAL1.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> 'x' .
diff --git a/tests/new/LITERAL2.ttl b/tests/new/LITERAL2.ttl
new file mode 100644
index 00000000..3aba89e4
--- /dev/null
+++ b/tests/new/LITERAL2.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "x" .
diff --git a/tests/new/LITERAL_LONG1.ttl b/tests/new/LITERAL_LONG1.ttl
new file mode 100644
index 00000000..ab6baa93
--- /dev/null
+++ b/tests/new/LITERAL_LONG1.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '''x''' .
diff --git a/tests/new/LITERAL_LONG1_with_1_squote.nt b/tests/new/LITERAL_LONG1_with_1_squote.nt
new file mode 100644
index 00000000..acf7f58f
--- /dev/null
+++ b/tests/new/LITERAL_LONG1_with_1_squote.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "x'y" .
diff --git a/tests/new/LITERAL_LONG1_with_1_squote.ttl b/tests/new/LITERAL_LONG1_with_1_squote.ttl
new file mode 100644
index 00000000..3b93046b
--- /dev/null
+++ b/tests/new/LITERAL_LONG1_with_1_squote.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '''x'y''' .
diff --git a/tests/new/LITERAL_LONG1_with_2_squotes.nt b/tests/new/LITERAL_LONG1_with_2_squotes.nt
new file mode 100644
index 00000000..8ddc52e8
--- /dev/null
+++ b/tests/new/LITERAL_LONG1_with_2_squotes.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "x''y" .
diff --git a/tests/new/LITERAL_LONG1_with_2_squotes.ttl b/tests/new/LITERAL_LONG1_with_2_squotes.ttl
new file mode 100644
index 00000000..1219bad3
--- /dev/null
+++ b/tests/new/LITERAL_LONG1_with_2_squotes.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '''x''y''' .
diff --git a/tests/new/LITERAL_LONG2.ttl b/tests/new/LITERAL_LONG2.ttl
new file mode 100644
index 00000000..e37bf4a3
--- /dev/null
+++ b/tests/new/LITERAL_LONG2.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> """x""" .
diff --git a/tests/new/LITERAL_LONG2_with_1_squote.nt b/tests/new/LITERAL_LONG2_with_1_squote.nt
new file mode 100644
index 00000000..05a1fd3a
--- /dev/null
+++ b/tests/new/LITERAL_LONG2_with_1_squote.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "x\"y" .
diff --git a/tests/new/LITERAL_LONG2_with_1_squote.ttl b/tests/new/LITERAL_LONG2_with_1_squote.ttl
new file mode 100644
index 00000000..80e389b8
--- /dev/null
+++ b/tests/new/LITERAL_LONG2_with_1_squote.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> """x"y""" .
diff --git a/tests/new/LITERAL_LONG2_with_2_squotes.nt b/tests/new/LITERAL_LONG2_with_2_squotes.nt
new file mode 100644
index 00000000..3e69dc10
--- /dev/null
+++ b/tests/new/LITERAL_LONG2_with_2_squotes.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "x\"\"y" .
diff --git a/tests/new/LITERAL_LONG2_with_2_squotes.ttl b/tests/new/LITERAL_LONG2_with_2_squotes.ttl
new file mode 100644
index 00000000..2f14f5b3
--- /dev/null
+++ b/tests/new/LITERAL_LONG2_with_2_squotes.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> """x""y""" .
diff --git a/tests/new/SPARQL_style_base.ttl b/tests/new/SPARQL_style_base.ttl
new file mode 100644
index 00000000..d134ea81
--- /dev/null
+++ b/tests/new/SPARQL_style_base.ttl
@@ -0,0 +1,2 @@
+BASE <http://a.example/>
+<s> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/SPARQL_style_prefix.ttl b/tests/new/SPARQL_style_prefix.ttl
new file mode 100644
index 00000000..e7e4a3da
--- /dev/null
+++ b/tests/new/SPARQL_style_prefix.ttl
@@ -0,0 +1,2 @@
+PREFIX p: <http://a.example/>
+p:s <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/anonymous_blank_node_object.nt b/tests/new/anonymous_blank_node_object.nt
new file mode 100644
index 00000000..89e88f63
--- /dev/null
+++ b/tests/new/anonymous_blank_node_object.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> _:b1 .
diff --git a/tests/new/anonymous_blank_node_object.ttl b/tests/new/anonymous_blank_node_object.ttl
new file mode 100644
index 00000000..0b2ce436
--- /dev/null
+++ b/tests/new/anonymous_blank_node_object.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> [] .
diff --git a/tests/new/anonymous_blank_node_subject.ttl b/tests/new/anonymous_blank_node_subject.ttl
new file mode 100644
index 00000000..17b378c2
--- /dev/null
+++ b/tests/new/anonymous_blank_node_subject.ttl
@@ -0,0 +1 @@
+[] <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/bareword_a_predicate.nt b/tests/new/bareword_a_predicate.nt
new file mode 100644
index 00000000..afe14252
--- /dev/null
+++ b/tests/new/bareword_a_predicate.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://a.example/o> .
diff --git a/tests/new/bareword_a_predicate.ttl b/tests/new/bareword_a_predicate.ttl
new file mode 100644
index 00000000..66fa0d0c
--- /dev/null
+++ b/tests/new/bareword_a_predicate.ttl
@@ -0,0 +1 @@
+<http://a.example/s> a <http://a.example/o> .
diff --git a/tests/new/bareword_decimal.nt b/tests/new/bareword_decimal.nt
new file mode 100644
index 00000000..e177a9c6
--- /dev/null
+++ b/tests/new/bareword_decimal.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
diff --git a/tests/new/bareword_decimal.ttl b/tests/new/bareword_decimal.ttl
new file mode 100644
index 00000000..20955d51
--- /dev/null
+++ b/tests/new/bareword_decimal.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> 1.0 .
diff --git a/tests/new/bareword_double.nt b/tests/new/bareword_double.nt
new file mode 100644
index 00000000..dd8be2fd
--- /dev/null
+++ b/tests/new/bareword_double.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "1E0"^^<http://www.w3.org/2001/XMLSchema#double> .
diff --git a/tests/new/bareword_double.ttl b/tests/new/bareword_double.ttl
new file mode 100644
index 00000000..7ce25b11
--- /dev/null
+++ b/tests/new/bareword_double.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> 1E0 .
diff --git a/tests/new/bareword_integer.ttl b/tests/new/bareword_integer.ttl
new file mode 100644
index 00000000..087e71b6
--- /dev/null
+++ b/tests/new/bareword_integer.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> 1 .
diff --git a/tests/new/blankNodePropertyList_as_object.nt b/tests/new/blankNodePropertyList_as_object.nt
new file mode 100644
index 00000000..528bd844
--- /dev/null
+++ b/tests/new/blankNodePropertyList_as_object.nt
@@ -0,0 +1,2 @@
+<http://a.example/s> <http://a.example/p> _:b1 .
+_:b1 <http://a.example/p2> <http://a.example/o2> .
diff --git a/tests/new/blankNodePropertyList_as_object.ttl b/tests/new/blankNodePropertyList_as_object.ttl
new file mode 100644
index 00000000..aa85a746
--- /dev/null
+++ b/tests/new/blankNodePropertyList_as_object.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> [ <http://a.example/p2> <http://a.example/o2> ] .
diff --git a/tests/new/blankNodePropertyList_as_subject.nt b/tests/new/blankNodePropertyList_as_subject.nt
new file mode 100644
index 00000000..f0768879
--- /dev/null
+++ b/tests/new/blankNodePropertyList_as_subject.nt
@@ -0,0 +1,2 @@
+_:b1 <http://a.example/p> <http://a.example/o> .
+_:b1 <http://a.example/p2> <http://a.example/o2> .
diff --git a/tests/new/blankNodePropertyList_as_subject.ttl b/tests/new/blankNodePropertyList_as_subject.ttl
new file mode 100644
index 00000000..cb2e52aa
--- /dev/null
+++ b/tests/new/blankNodePropertyList_as_subject.ttl
@@ -0,0 +1 @@
+[ <http://a.example/p> <http://a.example/o> ] <http://a.example/p2> <http://a.example/o2> .
diff --git a/tests/new/blankNodePropertyList_containing_collection.nt b/tests/new/blankNodePropertyList_containing_collection.nt
new file mode 100644
index 00000000..e590826b
--- /dev/null
+++ b/tests/new/blankNodePropertyList_containing_collection.nt
@@ -0,0 +1,3 @@
+_:b1 <http://a.example/p1> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/new/blankNodePropertyList_containing_collection.ttl b/tests/new/blankNodePropertyList_containing_collection.ttl
new file mode 100644
index 00000000..bf164c83
--- /dev/null
+++ b/tests/new/blankNodePropertyList_containing_collection.ttl
@@ -0,0 +1 @@
+[ <http://a.example/p1> (1) ] .
diff --git a/tests/new/blankNodePropertyList_with_multiple_triples.nt b/tests/new/blankNodePropertyList_with_multiple_triples.nt
new file mode 100644
index 00000000..8f3fc507
--- /dev/null
+++ b/tests/new/blankNodePropertyList_with_multiple_triples.nt
@@ -0,0 +1,3 @@
+_:b1 <http://a.example/p1> <http://a.example/o1> .
+_:b1 <http://a.example/p2> <http://a.example/o2> .
+_:b1 <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/blankNodePropertyList_with_multiple_triples.ttl b/tests/new/blankNodePropertyList_with_multiple_triples.ttl
new file mode 100644
index 00000000..6153c13d
--- /dev/null
+++ b/tests/new/blankNodePropertyList_with_multiple_triples.ttl
@@ -0,0 +1 @@
+[ <http://a.example/p1> <http://a.example/o1> ; <http://a.example/p2> <http://a.example/o2> ] <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/collection_object.nt b/tests/new/collection_object.nt
new file mode 100644
index 00000000..391162e0
--- /dev/null
+++ b/tests/new/collection_object.nt
@@ -0,0 +1,3 @@
+<http://a.example/s> <http://a.example/p> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/new/collection_object.ttl b/tests/new/collection_object.ttl
new file mode 100644
index 00000000..6af34715
--- /dev/null
+++ b/tests/new/collection_object.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> (1) .
diff --git a/tests/new/collection_subject.nt b/tests/new/collection_subject.nt
new file mode 100644
index 00000000..502768c8
--- /dev/null
+++ b/tests/new/collection_subject.nt
@@ -0,0 +1,3 @@
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b1 <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/collection_subject.ttl b/tests/new/collection_subject.ttl
new file mode 100644
index 00000000..00a4c0bc
--- /dev/null
+++ b/tests/new/collection_subject.ttl
@@ -0,0 +1 @@
+(1) <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/default_namespace_IRI.ttl b/tests/new/default_namespace_IRI.ttl
new file mode 100644
index 00000000..f1f83fd5
--- /dev/null
+++ b/tests/new/default_namespace_IRI.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://a.example/>.
+:s <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/double_lower_case_e.nt b/tests/new/double_lower_case_e.nt
new file mode 100644
index 00000000..49a792b9
--- /dev/null
+++ b/tests/new/double_lower_case_e.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "1e0"^^<http://www.w3.org/2001/XMLSchema#double> .
diff --git a/tests/new/double_lower_case_e.ttl b/tests/new/double_lower_case_e.ttl
new file mode 100644
index 00000000..5f4552bf
--- /dev/null
+++ b/tests/new/double_lower_case_e.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> 1e0 .
diff --git a/tests/new/empty_collection.nt b/tests/new/empty_collection.nt
new file mode 100644
index 00000000..82726a3f
--- /dev/null
+++ b/tests/new/empty_collection.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/new/empty_collection.ttl b/tests/new/empty_collection.ttl
new file mode 100644
index 00000000..02f9cc07
--- /dev/null
+++ b/tests/new/empty_collection.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> () .
diff --git a/tests/new/first.nt b/tests/new/first.nt
new file mode 100644
index 00000000..d50539f6
--- /dev/null
+++ b/tests/new/first.nt
@@ -0,0 +1,7 @@
+<http://a.example/s> <http://a.example/p> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b3 .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/new/first.ttl b/tests/new/first.ttl
new file mode 100644
index 00000000..44f496cb
--- /dev/null
+++ b/tests/new/first.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> ((1) 2) .
diff --git a/tests/new/labeled_blank_node_object.nt b/tests/new/labeled_blank_node_object.nt
new file mode 100644
index 00000000..2645d4ee
--- /dev/null
+++ b/tests/new/labeled_blank_node_object.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> _:o .
diff --git a/tests/new/labeled_blank_node_object.ttl b/tests/new/labeled_blank_node_object.ttl
new file mode 100644
index 00000000..2645d4ee
--- /dev/null
+++ b/tests/new/labeled_blank_node_object.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> _:o .
diff --git a/tests/new/labeled_blank_node_subject.nt b/tests/new/labeled_blank_node_subject.nt
new file mode 100644
index 00000000..d0c7f458
--- /dev/null
+++ b/tests/new/labeled_blank_node_subject.nt
@@ -0,0 +1 @@
+_:s <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/labeled_blank_node_subject.ttl b/tests/new/labeled_blank_node_subject.ttl
new file mode 100644
index 00000000..d0c7f458
--- /dev/null
+++ b/tests/new/labeled_blank_node_subject.ttl
@@ -0,0 +1 @@
+_:s <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/langtagged_LONG.ttl b/tests/new/langtagged_LONG.ttl
new file mode 100644
index 00000000..2baefe5d
--- /dev/null
+++ b/tests/new/langtagged_LONG.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> """chat"""@en .
diff --git a/tests/new/langtagged_non_LONG.nt b/tests/new/langtagged_non_LONG.nt
new file mode 100644
index 00000000..1bddb04e
--- /dev/null
+++ b/tests/new/langtagged_non_LONG.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "chat"@en .
diff --git a/tests/new/langtagged_non_LONG.ttl b/tests/new/langtagged_non_LONG.ttl
new file mode 100644
index 00000000..1bddb04e
--- /dev/null
+++ b/tests/new/langtagged_non_LONG.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "chat"@en .
diff --git a/tests/new/lantag_with_subtag.nt b/tests/new/lantag_with_subtag.nt
new file mode 100644
index 00000000..46c9d53a
--- /dev/null
+++ b/tests/new/lantag_with_subtag.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "chat"@en-us .
diff --git a/tests/new/lantag_with_subtag.ttl b/tests/new/lantag_with_subtag.ttl
new file mode 100644
index 00000000..46c9d53a
--- /dev/null
+++ b/tests/new/lantag_with_subtag.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "chat"@en-us .
diff --git a/tests/new/last.nt b/tests/new/last.nt
new file mode 100644
index 00000000..27c21b3d
--- /dev/null
+++ b/tests/new/last.nt
@@ -0,0 +1,7 @@
+<http://a.example/s> <http://a.example/p> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b3 .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/new/last.ttl b/tests/new/last.ttl
new file mode 100644
index 00000000..1254c261
--- /dev/null
+++ b/tests/new/last.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> (1 (2)) .
diff --git a/tests/new/literal_false.nt b/tests/new/literal_false.nt
new file mode 100644
index 00000000..5bbbae84
--- /dev/null
+++ b/tests/new/literal_false.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
diff --git a/tests/new/literal_false.ttl b/tests/new/literal_false.ttl
new file mode 100644
index 00000000..6a32e362
--- /dev/null
+++ b/tests/new/literal_false.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> false .
diff --git a/tests/new/literal_true.nt b/tests/new/literal_true.nt
new file mode 100644
index 00000000..054b229f
--- /dev/null
+++ b/tests/new/literal_true.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
diff --git a/tests/new/literal_true.ttl b/tests/new/literal_true.ttl
new file mode 100644
index 00000000..6c5bb742
--- /dev/null
+++ b/tests/new/literal_true.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> true .
diff --git a/tests/new/literal_with_BACKSPACE.nt b/tests/new/literal_with_BACKSPACE.nt
new file mode 100644
index 00000000..339013df
--- /dev/null
+++ b/tests/new/literal_with_BACKSPACE.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "\b" .
diff --git a/tests/new/literal_with_BACKSPACE.ttl b/tests/new/literal_with_BACKSPACE.ttl
new file mode 100644
index 00000000..17b2880f
--- /dev/null
+++ b/tests/new/literal_with_BACKSPACE.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '' .
diff --git a/tests/new/literal_with_CARRIAGE_RETURN.nt b/tests/new/literal_with_CARRIAGE_RETURN.nt
new file mode 100644
index 00000000..91b85c89
--- /dev/null
+++ b/tests/new/literal_with_CARRIAGE_RETURN.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "\r" .
diff --git a/tests/new/literal_with_CARRIAGE_RETURN.ttl b/tests/new/literal_with_CARRIAGE_RETURN.ttl
new file mode 100644
index 00000000..3cd1d89c
--- /dev/null
+++ b/tests/new/literal_with_CARRIAGE_RETURN.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> ''' ''' .
diff --git a/tests/new/literal_with_CHARACTER_TABULATION.nt b/tests/new/literal_with_CHARACTER_TABULATION.nt
new file mode 100644
index 00000000..a6a9d9f0
--- /dev/null
+++ b/tests/new/literal_with_CHARACTER_TABULATION.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "\t" .
diff --git a/tests/new/literal_with_CHARACTER_TABULATION.ttl b/tests/new/literal_with_CHARACTER_TABULATION.ttl
new file mode 100644
index 00000000..37fbd9d1
--- /dev/null
+++ b/tests/new/literal_with_CHARACTER_TABULATION.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> ' ' .
diff --git a/tests/new/literal_with_FORM_FEED.nt b/tests/new/literal_with_FORM_FEED.nt
new file mode 100644
index 00000000..10d2c6d7
--- /dev/null
+++ b/tests/new/literal_with_FORM_FEED.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "\f" .
diff --git a/tests/new/literal_with_FORM_FEED.ttl b/tests/new/literal_with_FORM_FEED.ttl
new file mode 100644
index 00000000..76d6ee77
--- /dev/null
+++ b/tests/new/literal_with_FORM_FEED.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> ' ' .
diff --git a/tests/new/literal_with_LINE_FEED.nt b/tests/new/literal_with_LINE_FEED.nt
new file mode 100644
index 00000000..462f97ac
--- /dev/null
+++ b/tests/new/literal_with_LINE_FEED.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "\n" .
diff --git a/tests/new/literal_with_LINE_FEED.ttl b/tests/new/literal_with_LINE_FEED.ttl
new file mode 100644
index 00000000..50cc8a8b
--- /dev/null
+++ b/tests/new/literal_with_LINE_FEED.ttl
@@ -0,0 +1,2 @@
+<http://a.example/s> <http://a.example/p> '''
+''' .
diff --git a/tests/new/literal_with_REVERSE_SOLIDUS.nt b/tests/new/literal_with_REVERSE_SOLIDUS.nt
new file mode 100644
index 00000000..ebc846ed
--- /dev/null
+++ b/tests/new/literal_with_REVERSE_SOLIDUS.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "\\" .
diff --git a/tests/new/literal_with_REVERSE_SOLIDUS.ttl b/tests/new/literal_with_REVERSE_SOLIDUS.ttl
new file mode 100644
index 00000000..380a3d04
--- /dev/null
+++ b/tests/new/literal_with_REVERSE_SOLIDUS.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\\' .
diff --git a/tests/new/literal_with_escaped_BACKSPACE.ttl b/tests/new/literal_with_escaped_BACKSPACE.ttl
new file mode 100644
index 00000000..5284b9b6
--- /dev/null
+++ b/tests/new/literal_with_escaped_BACKSPACE.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\b' .
diff --git a/tests/new/literal_with_escaped_CARRIAGE_RETURN.ttl b/tests/new/literal_with_escaped_CARRIAGE_RETURN.ttl
new file mode 100644
index 00000000..a28e7c0b
--- /dev/null
+++ b/tests/new/literal_with_escaped_CARRIAGE_RETURN.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\r' .
diff --git a/tests/new/literal_with_escaped_CHARACTER_TABULATION.ttl b/tests/new/literal_with_escaped_CHARACTER_TABULATION.ttl
new file mode 100644
index 00000000..67966f78
--- /dev/null
+++ b/tests/new/literal_with_escaped_CHARACTER_TABULATION.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\t' .
diff --git a/tests/new/literal_with_escaped_FORM_FEED.ttl b/tests/new/literal_with_escaped_FORM_FEED.ttl
new file mode 100644
index 00000000..21acace9
--- /dev/null
+++ b/tests/new/literal_with_escaped_FORM_FEED.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\f' .
diff --git a/tests/new/literal_with_escaped_LINE_FEED.ttl b/tests/new/literal_with_escaped_LINE_FEED.ttl
new file mode 100644
index 00000000..b53f49ec
--- /dev/null
+++ b/tests/new/literal_with_escaped_LINE_FEED.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\n' .
diff --git a/tests/new/literal_with_numeric_escape4.nt b/tests/new/literal_with_numeric_escape4.nt
new file mode 100644
index 00000000..0b35a89a
--- /dev/null
+++ b/tests/new/literal_with_numeric_escape4.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "o" .
diff --git a/tests/new/literal_with_numeric_escape4.ttl b/tests/new/literal_with_numeric_escape4.ttl
new file mode 100644
index 00000000..2b4e0175
--- /dev/null
+++ b/tests/new/literal_with_numeric_escape4.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\u006F' .
diff --git a/tests/new/literal_with_numeric_escape8.ttl b/tests/new/literal_with_numeric_escape8.ttl
new file mode 100644
index 00000000..8d0e4ef2
--- /dev/null
+++ b/tests/new/literal_with_numeric_escape8.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> '\U0000006F' .
diff --git a/tests/new/localname_with_COLON.nt b/tests/new/localname_with_COLON.nt
new file mode 100644
index 00000000..eb966ca3
--- /dev/null
+++ b/tests/new/localname_with_COLON.nt
@@ -0,0 +1 @@
+<http://a.example/s:> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/localname_with_COLON.ttl b/tests/new/localname_with_COLON.ttl
new file mode 100644
index 00000000..1d45f20f
--- /dev/null
+++ b/tests/new/localname_with_COLON.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+p:s: <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/manifest.ttl b/tests/new/manifest.ttl
new file mode 100644
index 00000000..60bb8b93
--- /dev/null
+++ b/tests/new/manifest.ttl
@@ -0,0 +1,605 @@
+# Turtle atomic test manifest
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdft: <http://www.w3.org/ns/rdftest#> .
+
+<> rdf:type mf:Manifest ;
+ rdfs:comment "Atomic Turtle tests" ;
+ mf:entries
+ (
+ <#IRI_subject>
+ <#IRI_with_four_digit_numeric_escape>
+ <#IRI_with_eight_digit_numeric_escape>
+ <#IRI_with_all_punctuation>
+ <#bareword_a_predicate>
+ <#old_style_prefix>
+ <#SPARQL_style_prefix>
+ <#prefixed_IRI_predicate>
+ <#prefixed_IRI_object>
+ <#prefix_only_IRI>
+ <#default_namespace_IRI>
+ <#prefix_reassigned_and_used>
+ <#reserved_escaped_local_name>
+ <#percent_escaped_local_name>
+ <#HYPHEN_MINUS_in_local_name>
+ <#underscore_in_local_name>
+ <#localname_with_COLON>
+ <#old_style_base>
+ <#SPARQL_style_base>
+ <#labeled_blank_node_subject>
+ <#labeled_blank_node_object>
+ <#anonymous_blank_node_subject>
+ <#anonymous_blank_node_object>
+ <#sole_blankNodePropertyList>
+ <#blankNodePropertyList_as_subject>
+ <#blankNodePropertyList_as_object>
+ <#blankNodePropertyList_with_multiple_triples>
+ <#nested_blankNodePropertyLists>
+ <#blankNodePropertyList_containing_collection>
+ <#collection_subject>
+ <#collection_object>
+ <#empty_collection>
+ <#nested_collection>
+ <#first>
+ <#last>
+ <#LITERAL1>
+ <#LITERAL_LONG1>
+ <#LITERAL_LONG1_with_1_squote>
+ <#LITERAL_LONG1_with_2_squotes>
+ <#LITERAL2>
+ <#LITERAL_LONG2>
+ <#LITERAL_LONG2_with_1_squote>
+ <#LITERAL_LONG2_with_2_squotes>
+ <#literal_with_CHARACTER_TABULATION>
+ <#literal_with_BACKSPACE>
+ <#literal_with_LINE_FEED>
+ <#literal_with_CARRIAGE_RETURN>
+ <#literal_with_FORM_FEED>
+ <#literal_with_REVERSE_SOLIDUS>
+ <#literal_with_escaped_CHARACTER_TABULATION>
+ <#literal_with_escaped_BACKSPACE>
+ <#literal_with_escaped_LINE_FEED>
+ <#literal_with_escaped_CARRIAGE_RETURN>
+ <#literal_with_escaped_FORM_FEED>
+ <#literal_with_numeric_escape4>
+ <#literal_with_numeric_escape8>
+ <#IRIREF_datatype>
+ <#prefixed_name_datatype>
+ <#bareword_integer>
+ <#bareword_decimal>
+ <#bareword_double>
+ <#double_lower_case_e>
+ <#negative_numeric>
+ <#positive_numeric>
+ <#numeric_with_leading_0>
+ <#literal_true>
+ <#literal_false>
+ <#langtagged_non_LONG>
+ <#langtagged_LONG>
+ <#lantag_with_subtag>
+ <#objectList_with_two_objects>
+ <#predicateObjectList_with_two_objectLists>
+ <#repeated_semis_at_end>
+ <#repeated_semis_not_at_end>
+ ) .
+
+<#IRI_subject> rdf:type rdft:TestTurtleEval ;
+ mf:name "IRI_subject" ;
+ rdfs:comment "IRI subject" ;
+ mf:action <IRI_subject.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#IRI_with_four_digit_numeric_escape> rdf:type rdft:TestTurtleEval ;
+ mf:name "IRI_with_four_digit_numeric_escape" ;
+ rdfs:comment "IRI with four digit numeric escape (\\u)" ;
+ mf:action <IRI_with_four_digit_numeric_escape.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#IRI_with_eight_digit_numeric_escape> rdf:type rdft:TestTurtleEval ;
+ mf:name "IRI_with_eight_digit_numeric_escape" ;
+ rdfs:comment "IRI with eight digit numeric escape (\\U)" ;
+ mf:action <IRI_with_eight_digit_numeric_escape.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#IRI_with_all_punctuation> rdf:type rdft:TestTurtleEval ;
+ mf:name "IRI_with_all_punctuation" ;
+ rdfs:comment "IRI with all punctuation" ;
+ mf:action <IRI_with_all_punctuation.ttl> ;
+ mf:result <IRI_with_all_punctuation.nt> ;
+ .
+
+<#bareword_a_predicate> rdf:type rdft:TestTurtleEval ;
+ mf:name "bareword_a_predicate" ;
+ rdfs:comment "bareword a predicate" ;
+ mf:action <bareword_a_predicate.ttl> ;
+ mf:result <bareword_a_predicate.nt> ;
+ .
+
+<#old_style_prefix> rdf:type rdft:TestTurtleEval ;
+ mf:name "old_style_prefix" ;
+ rdfs:comment "old-style prefix" ;
+ mf:action <old_style_prefix.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#SPARQL_style_prefix> rdf:type rdft:TestTurtleEval ;
+ mf:name "SPARQL_style_prefix" ;
+ rdfs:comment "SPARQL-style prefix" ;
+ mf:action <SPARQL_style_prefix.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#prefixed_IRI_predicate> rdf:type rdft:TestTurtleEval ;
+ mf:name "prefixed_IRI_predicate" ;
+ rdfs:comment "prefixed IRI predicate" ;
+ mf:action <prefixed_IRI_predicate.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#prefixed_IRI_object> rdf:type rdft:TestTurtleEval ;
+ mf:name "prefixed_IRI_object" ;
+ rdfs:comment "prefixed IRI object" ;
+ mf:action <prefixed_IRI_object.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#prefix_only_IRI> rdf:type rdft:TestTurtleEval ;
+ mf:name "prefix_only_IRI" ;
+ rdfs:comment "prefix-only IRI (p:)" ;
+ mf:action <prefix_only_IRI.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#default_namespace_IRI> rdf:type rdft:TestTurtleEval ;
+ mf:name "default_namespace_IRI" ;
+ rdfs:comment "default namespace IRI (:ln)" ;
+ mf:action <default_namespace_IRI.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#prefix_reassigned_and_used> rdf:type rdft:TestTurtleEval ;
+ mf:name "prefix_reassigned_and_used" ;
+ rdfs:comment "prefix reassigned and used" ;
+ mf:action <prefix_reassigned_and_used.ttl> ;
+ mf:result <prefix_reassigned_and_used.nt> ;
+ .
+
+<#reserved_escaped_local_name> rdf:type rdft:TestTurtleEval ;
+ mf:name "reserved_escaped_local_name" ;
+ rdfs:comment "reserved-escaped local name" ;
+ mf:action <reserved_escaped_local_name.ttl> ;
+ mf:result <reserved_escaped_local_name.nt> ;
+ .
+
+<#percent_escaped_local_name> rdf:type rdft:TestTurtleEval ;
+ mf:name "percent_escaped_local_name" ;
+ rdfs:comment "percent-escaped local name" ;
+ mf:action <percent_escaped_local_name.ttl> ;
+ mf:result <percent_escaped_local_name.nt> ;
+ .
+
+<#HYPHEN_MINUS_in_local_name> rdf:type rdft:TestTurtleEval ;
+ mf:name "HYPHEN_MINUS_in_local_name" ;
+ rdfs:comment "HYPHEN-MINUS in local name" ;
+ mf:action <HYPHEN_MINUS_in_local_name.ttl> ;
+ mf:result <HYPHEN_MINUS_in_local_name.nt> ;
+ .
+
+<#underscore_in_local_name> rdf:type rdft:TestTurtleEval ;
+ mf:name "underscore_in_local_name" ;
+ rdfs:comment "underscore in local name" ;
+ mf:action <underscore_in_local_name.ttl> ;
+ mf:result <underscore_in_local_name.nt> ;
+ .
+
+<#localname_with_COLON> rdf:type rdft:TestTurtleEval ;
+ mf:name "localname_with_COLON" ;
+ rdfs:comment "localname with COLON" ;
+ mf:action <localname_with_COLON.ttl> ;
+ mf:result <localname_with_COLON.nt> ;
+ .
+
+<#old_style_base> rdf:type rdft:TestTurtleEval ;
+ mf:name "old_style_base" ;
+ rdfs:comment "old-style base" ;
+ mf:action <old_style_base.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#SPARQL_style_base> rdf:type rdft:TestTurtleEval ;
+ mf:name "SPARQL_style_base" ;
+ rdfs:comment "SPARQL-style base" ;
+ mf:action <SPARQL_style_base.ttl> ;
+ mf:result <IRI_subject.nt> ;
+ .
+
+<#labeled_blank_node_subject> rdf:type rdft:TestTurtleEval ;
+ mf:name "labeled_blank_node_subject" ;
+ rdfs:comment "labeled blank node subject" ;
+ mf:action <labeled_blank_node_subject.ttl> ;
+ mf:result <labeled_blank_node_subject.nt> ;
+ .
+
+<#labeled_blank_node_object> rdf:type rdft:TestTurtleEval ;
+ mf:name "labeled_blank_node_object" ;
+ rdfs:comment "labeled blank node object" ;
+ mf:action <labeled_blank_node_object.ttl> ;
+ mf:result <labeled_blank_node_object.nt> ;
+ .
+
+<#anonymous_blank_node_subject> rdf:type rdft:TestTurtleEval ;
+ mf:name "anonymous_blank_node_subject" ;
+ rdfs:comment "anonymous blank node subject" ;
+ mf:action <anonymous_blank_node_subject.ttl> ;
+ mf:result <labeled_blank_node_subject.nt> ;
+ .
+
+<#anonymous_blank_node_object> rdf:type rdft:TestTurtleEval ;
+ mf:name "anonymous_blank_node_object" ;
+ rdfs:comment "anonymous blank node object" ;
+ mf:action <anonymous_blank_node_object.ttl> ;
+ mf:result <anonymous_blank_node_object.nt> ;
+ .
+
+<#sole_blankNodePropertyList> rdf:type rdft:TestTurtleEval ;
+ mf:name "sole_blankNodePropertyList" ;
+ rdfs:comment "sole blankNodePropertyList [ <p> <o> ] ." ;
+ mf:action <sole_blankNodePropertyList.ttl> ;
+ mf:result <sole_blankNodePropertyList.nt> ;
+ .
+
+<#blankNodePropertyList_as_subject> rdf:type rdft:TestTurtleEval ;
+ mf:name "blankNodePropertyList_as_subject" ;
+ rdfs:comment "blankNodePropertyList as subject [ … ] <p> <o> ." ;
+ mf:action <blankNodePropertyList_as_subject.ttl> ;
+ mf:result <blankNodePropertyList_as_subject.nt> ;
+ .
+
+<#blankNodePropertyList_as_object> rdf:type rdft:TestTurtleEval ;
+ mf:name "blankNodePropertyList_as_object" ;
+ rdfs:comment "blankNodePropertyList as object <s> <p> [ … ] ." ;
+ mf:action <blankNodePropertyList_as_object.ttl> ;
+ mf:result <blankNodePropertyList_as_object.nt> ;
+ .
+
+<#blankNodePropertyList_with_multiple_triples> rdf:type rdft:TestTurtleEval ;
+ mf:name "blankNodePropertyList_with_multiple_triples" ;
+ rdfs:comment "blankNodePropertyList with multiple triples [ <s> <p> ; <s2> <p2> ]" ;
+ mf:action <blankNodePropertyList_with_multiple_triples.ttl> ;
+ mf:result <blankNodePropertyList_with_multiple_triples.nt> ;
+ .
+
+<#nested_blankNodePropertyLists> rdf:type rdft:TestTurtleEval ;
+ mf:name "nested_blankNodePropertyLists" ;
+ rdfs:comment "nested blankNodePropertyLists [ <p1> [ <p2> <o2> ] ; <p3> <o3> ]" ;
+ mf:action <nested_blankNodePropertyLists.ttl> ;
+ mf:result <nested_blankNodePropertyLists.nt> ;
+ .
+
+<#blankNodePropertyList_containing_collection> rdf:type rdft:TestTurtleEval ;
+ mf:name "blankNodePropertyList_containing_collection" ;
+ rdfs:comment "blankNodePropertyList containing collection [ <p1> ( … ) ]" ;
+ mf:action <blankNodePropertyList_containing_collection.ttl> ;
+ mf:result <blankNodePropertyList_containing_collection.nt> ;
+ .
+
+<#collection_subject> rdf:type rdft:TestTurtleEval ;
+ mf:name "collection_subject" ;
+ rdfs:comment "collection subject" ;
+ mf:action <collection_subject.ttl> ;
+ mf:result <collection_subject.nt> ;
+ .
+
+<#collection_object> rdf:type rdft:TestTurtleEval ;
+ mf:name "collection_object" ;
+ rdfs:comment "collection object" ;
+ mf:action <collection_object.ttl> ;
+ mf:result <collection_object.nt> ;
+ .
+
+<#empty_collection> rdf:type rdft:TestTurtleEval ;
+ mf:name "empty_collection" ;
+ rdfs:comment "empty collection ()" ;
+ mf:action <empty_collection.ttl> ;
+ mf:result <empty_collection.nt> ;
+ .
+
+<#nested_collection> rdf:type rdft:TestTurtleEval ;
+ mf:name "nested_collection" ;
+ rdfs:comment "nested collection (())" ;
+ mf:action <nested_collection.ttl> ;
+ mf:result <nested_collection.nt> ;
+ .
+
+<#first> rdf:type rdft:TestTurtleEval ;
+ mf:name "first" ;
+ rdfs:comment "first, not last, non-empty nested collection" ;
+ mf:action <first.ttl> ;
+ mf:result <first.nt> ;
+ .
+
+<#last> rdf:type rdft:TestTurtleEval ;
+ mf:name "last" ;
+ rdfs:comment "last, not first, non-empty nested collection" ;
+ mf:action <last.ttl> ;
+ mf:result <last.nt> ;
+ .
+
+<#LITERAL1> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL1" ;
+ rdfs:comment "LITERAL1 'x'" ;
+ mf:action <LITERAL1.ttl> ;
+ mf:result <LITERAL1.nt> ;
+ .
+
+<#LITERAL_LONG1> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL_LONG1" ;
+ rdfs:comment "LITERAL_LONG1 '''x'''" ;
+ mf:action <LITERAL_LONG1.ttl> ;
+ mf:result <LITERAL1.nt> ;
+ .
+
+<#LITERAL_LONG1_with_1_squote> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL_LONG1_with_1_squote" ;
+ rdfs:comment "LITERAL_LONG1 with 1 squote '''a'b'''" ;
+ mf:action <LITERAL_LONG1_with_1_squote.ttl> ;
+ mf:result <LITERAL_LONG1_with_1_squote.nt> ;
+ .
+
+<#LITERAL_LONG1_with_2_squotes> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL_LONG1_with_2_squotes" ;
+ rdfs:comment "LITERAL_LONG1 with 2 squotes '''a''b'''" ;
+ mf:action <LITERAL_LONG1_with_2_squotes.ttl> ;
+ mf:result <LITERAL_LONG1_with_2_squotes.nt> ;
+ .
+
+<#LITERAL2> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL2" ;
+ rdfs:comment "LITERAL2 \"x\"" ;
+ mf:action <LITERAL2.ttl> ;
+ mf:result <LITERAL1.nt> ;
+ .
+
+<#LITERAL_LONG2> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL_LONG2" ;
+ rdfs:comment "LITERAL_LONG2 \"\"\"x\"\"\"" ;
+ mf:action <LITERAL_LONG2.ttl> ;
+ mf:result <LITERAL1.nt> ;
+ .
+
+<#LITERAL_LONG2_with_1_squote> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL_LONG2_with_1_squote" ;
+ rdfs:comment "LITERAL_LONG2 with 1 squote \"\"\"a\"b\"\"\"" ;
+ mf:action <LITERAL_LONG2_with_1_squote.ttl> ;
+ mf:result <LITERAL_LONG2_with_1_squote.nt> ;
+ .
+
+<#LITERAL_LONG2_with_2_squotes> rdf:type rdft:TestTurtleEval ;
+ mf:name "LITERAL_LONG2_with_2_squotes" ;
+ rdfs:comment "LITERAL_LONG2 with 2 squotes \"\"\"a\"\"b\"\"\"" ;
+ mf:action <LITERAL_LONG2_with_2_squotes.ttl> ;
+ mf:result <LITERAL_LONG2_with_2_squotes.nt> ;
+ .
+
+<#literal_with_CHARACTER_TABULATION> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_CHARACTER_TABULATION" ;
+ rdfs:comment "literal with CHARACTER TABULATION" ;
+ mf:action <literal_with_CHARACTER_TABULATION.ttl> ;
+ mf:result <literal_with_CHARACTER_TABULATION.nt> ;
+ .
+
+<#literal_with_BACKSPACE> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_BACKSPACE" ;
+ rdfs:comment "literal with BACKSPACE" ;
+ mf:action <literal_with_BACKSPACE.ttl> ;
+ mf:result <literal_with_BACKSPACE.nt> ;
+ .
+
+<#literal_with_LINE_FEED> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_LINE_FEED" ;
+ rdfs:comment "literal with LINE FEED" ;
+ mf:action <literal_with_LINE_FEED.ttl> ;
+ mf:result <literal_with_LINE_FEED.nt> ;
+ .
+
+<#literal_with_CARRIAGE_RETURN> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_CARRIAGE_RETURN" ;
+ rdfs:comment "literal with CARRIAGE RETURN" ;
+ mf:action <literal_with_CARRIAGE_RETURN.ttl> ;
+ mf:result <literal_with_CARRIAGE_RETURN.nt> ;
+ .
+
+<#literal_with_FORM_FEED> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_FORM_FEED" ;
+ rdfs:comment "literal with FORM FEED" ;
+ mf:action <literal_with_FORM_FEED.ttl> ;
+ mf:result <literal_with_FORM_FEED.nt> ;
+ .
+
+<#literal_with_REVERSE_SOLIDUS> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_REVERSE_SOLIDUS" ;
+ rdfs:comment "literal with REVERSE SOLIDUS" ;
+ mf:action <literal_with_REVERSE_SOLIDUS.ttl> ;
+ mf:result <literal_with_REVERSE_SOLIDUS.nt> ;
+ .
+
+<#literal_with_escaped_CHARACTER_TABULATION> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_escaped_CHARACTER_TABULATION" ;
+ rdfs:comment "literal with escaped CHARACTER TABULATION" ;
+ mf:action <literal_with_escaped_CHARACTER_TABULATION.ttl> ;
+ mf:result <literal_with_CHARACTER_TABULATION.nt> ;
+ .
+
+<#literal_with_escaped_BACKSPACE> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_escaped_BACKSPACE" ;
+ rdfs:comment "literal with escaped BACKSPACE" ;
+ mf:action <literal_with_escaped_BACKSPACE.ttl> ;
+ mf:result <literal_with_BACKSPACE.nt> ;
+ .
+
+<#literal_with_escaped_LINE_FEED> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_escaped_LINE_FEED" ;
+ rdfs:comment "literal with escaped LINE FEED" ;
+ mf:action <literal_with_escaped_LINE_FEED.ttl> ;
+ mf:result <literal_with_LINE_FEED.nt> ;
+ .
+
+<#literal_with_escaped_CARRIAGE_RETURN> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_escaped_CARRIAGE_RETURN" ;
+ rdfs:comment "literal with escaped CARRIAGE RETURN" ;
+ mf:action <literal_with_escaped_CARRIAGE_RETURN.ttl> ;
+ mf:result <literal_with_CARRIAGE_RETURN.nt> ;
+ .
+
+<#literal_with_escaped_FORM_FEED> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_escaped_FORM_FEED" ;
+ rdfs:comment "literal with escaped FORM FEED" ;
+ mf:action <literal_with_escaped_FORM_FEED.ttl> ;
+ mf:result <literal_with_FORM_FEED.nt> ;
+ .
+
+<#literal_with_numeric_escape4> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_numeric_escape4" ;
+ rdfs:comment "literal with numeric escape4 \\u" ;
+ mf:action <literal_with_numeric_escape4.ttl> ;
+ mf:result <literal_with_numeric_escape4.nt> ;
+ .
+
+<#literal_with_numeric_escape8> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_with_numeric_escape8" ;
+ rdfs:comment "literal with numeric escape8 \\U" ;
+ mf:action <literal_with_numeric_escape8.ttl> ;
+ mf:result <literal_with_numeric_escape4.nt> ;
+ .
+
+<#IRIREF_datatype> rdf:type rdft:TestTurtleEval ;
+ mf:name "IRIREF_datatype" ;
+ rdfs:comment "IRIREF datatype \"\"^^<t>" ;
+ mf:action <IRIREF_datatype.ttl> ;
+ mf:result <IRIREF_datatype.nt> ;
+ .
+
+<#prefixed_name_datatype> rdf:type rdft:TestTurtleEval ;
+ mf:name "prefixed_name_datatype" ;
+ rdfs:comment "prefixed name datatype \"\"^^p:t" ;
+ mf:action <prefixed_name_datatype.ttl> ;
+ mf:result <IRIREF_datatype.nt> ;
+ .
+
+<#bareword_integer> rdf:type rdft:TestTurtleEval ;
+ mf:name "bareword_integer" ;
+ rdfs:comment "bareword integer" ;
+ mf:action <bareword_integer.ttl> ;
+ mf:result <IRIREF_datatype.nt> ;
+ .
+
+<#bareword_decimal> rdf:type rdft:TestTurtleEval ;
+ mf:name "bareword_decimal" ;
+ rdfs:comment "bareword decimal" ;
+ mf:action <bareword_decimal.ttl> ;
+ mf:result <bareword_decimal.nt> ;
+ .
+
+<#bareword_double> rdf:type rdft:TestTurtleEval ;
+ mf:name "bareword_double" ;
+ rdfs:comment "bareword double" ;
+ mf:action <bareword_double.ttl> ;
+ mf:result <bareword_double.nt> ;
+ .
+
+<#double_lower_case_e> rdf:type rdft:TestTurtleEval ;
+ mf:name "double_lower_case_e" ;
+ rdfs:comment "double lower case e" ;
+ mf:action <double_lower_case_e.ttl> ;
+ mf:result <double_lower_case_e.nt> ;
+ .
+
+<#negative_numeric> rdf:type rdft:TestTurtleEval ;
+ mf:name "negative_numeric" ;
+ rdfs:comment "negative numeric" ;
+ mf:action <negative_numeric.ttl> ;
+ mf:result <negative_numeric.nt> ;
+ .
+
+<#positive_numeric> rdf:type rdft:TestTurtleEval ;
+ mf:name "positive_numeric" ;
+ rdfs:comment "positive numeric" ;
+ mf:action <positive_numeric.ttl> ;
+ mf:result <positive_numeric.nt> ;
+ .
+
+<#numeric_with_leading_0> rdf:type rdft:TestTurtleEval ;
+ mf:name "numeric_with_leading_0" ;
+ rdfs:comment "numeric with leading 0" ;
+ mf:action <numeric_with_leading_0.ttl> ;
+ mf:result <numeric_with_leading_0.nt> ;
+ .
+
+<#literal_true> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_true" ;
+ rdfs:comment "literal true" ;
+ mf:action <literal_true.ttl> ;
+ mf:result <literal_true.nt> ;
+ .
+
+<#literal_false> rdf:type rdft:TestTurtleEval ;
+ mf:name "literal_false" ;
+ rdfs:comment "literal false" ;
+ mf:action <literal_false.ttl> ;
+ mf:result <literal_false.nt> ;
+ .
+
+<#langtagged_non_LONG> rdf:type rdft:TestTurtleEval ;
+ mf:name "langtagged_non_LONG" ;
+ rdfs:comment "langtagged non-LONG \"x\"@en" ;
+ mf:action <langtagged_non_LONG.ttl> ;
+ mf:result <langtagged_non_LONG.nt> ;
+ .
+
+<#langtagged_LONG> rdf:type rdft:TestTurtleEval ;
+ mf:name "langtagged_LONG" ;
+ rdfs:comment "langtagged LONG \"\"\"x\"\"\"@en" ;
+ mf:action <langtagged_LONG.ttl> ;
+ mf:result <langtagged_non_LONG.nt> ;
+ .
+
+<#lantag_with_subtag> rdf:type rdft:TestTurtleEval ;
+ mf:name "lantag_with_subtag" ;
+ rdfs:comment "lantag with subtag \"x\"@en-us" ;
+ mf:action <lantag_with_subtag.ttl> ;
+ mf:result <lantag_with_subtag.nt> ;
+ .
+
+<#objectList_with_two_objects> rdf:type rdft:TestTurtleEval ;
+ mf:name "objectList_with_two_objects" ;
+ rdfs:comment "objectList with two objects … <o1>,<o2>" ;
+ mf:action <objectList_with_two_objects.ttl> ;
+ mf:result <objectList_with_two_objects.nt> ;
+ .
+
+<#predicateObjectList_with_two_objectLists> rdf:type rdft:TestTurtleEval ;
+ mf:name "predicateObjectList_with_two_objectLists" ;
+ rdfs:comment "predicateObjectList with two objectLists … <o1>,<o2>" ;
+ mf:action <predicateObjectList_with_two_objectLists.ttl> ;
+ mf:result <predicateObjectList_with_two_objectLists.nt> ;
+ .
+
+<#repeated_semis_at_end> rdf:type rdft:TestTurtleEval ;
+ mf:name "repeated_semis_at_end" ;
+ rdfs:comment "repeated semis at end <s> <p> <o> ;; <p2> <o2> ." ;
+ mf:action <repeated_semis_at_end.ttl> ;
+ mf:result <predicateObjectList_with_two_objectLists.nt> ;
+ .
+
+<#repeated_semis_not_at_end> rdf:type rdft:TestTurtleEval ;
+ mf:name "repeated_semis_not_at_end" ;
+ rdfs:comment "repeated semis not at end <s> <p> <o> ;;." ;
+ mf:action <repeated_semis_not_at_end.ttl> ;
+ mf:result <repeated_semis_not_at_end.nt> ;
+ .
+
diff --git a/tests/new/negative_numeric.nt b/tests/new/negative_numeric.nt
new file mode 100644
index 00000000..4baf628d
--- /dev/null
+++ b/tests/new/negative_numeric.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "-1"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/new/negative_numeric.ttl b/tests/new/negative_numeric.ttl
new file mode 100644
index 00000000..a6a7f57b
--- /dev/null
+++ b/tests/new/negative_numeric.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> -1 .
diff --git a/tests/new/nested_blankNodePropertyLists.nt b/tests/new/nested_blankNodePropertyLists.nt
new file mode 100644
index 00000000..5284c007
--- /dev/null
+++ b/tests/new/nested_blankNodePropertyLists.nt
@@ -0,0 +1,3 @@
+_:b1 <http://a.example/p1> _:b2 .
+_:b2 <http://a.example/p2> <http://a.example/o2> .
+_:b1 <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/nested_blankNodePropertyLists.ttl b/tests/new/nested_blankNodePropertyLists.ttl
new file mode 100644
index 00000000..a3e4681c
--- /dev/null
+++ b/tests/new/nested_blankNodePropertyLists.ttl
@@ -0,0 +1 @@
+[ <http://a.example/p1> [ <http://a.example/p2> <http://a.example/o2> ] ; <http://a.example/p> <http://a.example/o> ].
diff --git a/tests/new/nested_collection.nt b/tests/new/nested_collection.nt
new file mode 100644
index 00000000..eaea2847
--- /dev/null
+++ b/tests/new/nested_collection.nt
@@ -0,0 +1,5 @@
+<http://a.example/s> <http://a.example/p> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/new/nested_collection.ttl b/tests/new/nested_collection.ttl
new file mode 100644
index 00000000..944e7c6b
--- /dev/null
+++ b/tests/new/nested_collection.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> ((1)) .
diff --git a/tests/new/numeric_with_leading_0.nt b/tests/new/numeric_with_leading_0.nt
new file mode 100644
index 00000000..1df5c472
--- /dev/null
+++ b/tests/new/numeric_with_leading_0.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "01"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/new/numeric_with_leading_0.ttl b/tests/new/numeric_with_leading_0.ttl
new file mode 100644
index 00000000..a5eac209
--- /dev/null
+++ b/tests/new/numeric_with_leading_0.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> 01 .
diff --git a/tests/new/objectList_with_two_objects.nt b/tests/new/objectList_with_two_objects.nt
new file mode 100644
index 00000000..7f8e9c0f
--- /dev/null
+++ b/tests/new/objectList_with_two_objects.nt
@@ -0,0 +1,2 @@
+<http://a.example/s> <http://a.example/p> <http://a.example/o1> .
+<http://a.example/s> <http://a.example/p> <http://a.example/o2> .
diff --git a/tests/new/objectList_with_two_objects.ttl b/tests/new/objectList_with_two_objects.ttl
new file mode 100644
index 00000000..b12f02d1
--- /dev/null
+++ b/tests/new/objectList_with_two_objects.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> <http://a.example/o1>, <http://a.example/o2> .
diff --git a/tests/new/old_style_base.ttl b/tests/new/old_style_base.ttl
new file mode 100644
index 00000000..f0f4c03c
--- /dev/null
+++ b/tests/new/old_style_base.ttl
@@ -0,0 +1,2 @@
+@base <http://a.example/>.
+<s> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/old_style_prefix.ttl b/tests/new/old_style_prefix.ttl
new file mode 100644
index 00000000..59595672
--- /dev/null
+++ b/tests/new/old_style_prefix.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+p:s <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/percent_escaped_local_name.nt b/tests/new/percent_escaped_local_name.nt
new file mode 100644
index 00000000..e0af4b62
--- /dev/null
+++ b/tests/new/percent_escaped_local_name.nt
@@ -0,0 +1 @@
+<http://a.example/%25> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/percent_escaped_local_name.ttl b/tests/new/percent_escaped_local_name.ttl
new file mode 100644
index 00000000..0564ccab
--- /dev/null
+++ b/tests/new/percent_escaped_local_name.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+p:%25 <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/positive_numeric.nt b/tests/new/positive_numeric.nt
new file mode 100644
index 00000000..96e6086a
--- /dev/null
+++ b/tests/new/positive_numeric.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> "+1"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/new/positive_numeric.ttl b/tests/new/positive_numeric.ttl
new file mode 100644
index 00000000..606691d9
--- /dev/null
+++ b/tests/new/positive_numeric.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p> +1 .
diff --git a/tests/new/predicateObjectList_with_two_objectLists.nt b/tests/new/predicateObjectList_with_two_objectLists.nt
new file mode 100644
index 00000000..274182c7
--- /dev/null
+++ b/tests/new/predicateObjectList_with_two_objectLists.nt
@@ -0,0 +1,2 @@
+<http://a.example/s> <http://a.example/p1> <http://a.example/o1> .
+<http://a.example/s> <http://a.example/p2> <http://a.example/o2> .
diff --git a/tests/new/predicateObjectList_with_two_objectLists.ttl b/tests/new/predicateObjectList_with_two_objectLists.ttl
new file mode 100644
index 00000000..337b132f
--- /dev/null
+++ b/tests/new/predicateObjectList_with_two_objectLists.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p1> <http://a.example/o1>; <http://a.example/p2> <http://a.example/o2> .
diff --git a/tests/new/prefix_only_IRI.ttl b/tests/new/prefix_only_IRI.ttl
new file mode 100644
index 00000000..9ff66603
--- /dev/null
+++ b/tests/new/prefix_only_IRI.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/s>.
+p: <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/prefix_reassigned_and_used.nt b/tests/new/prefix_reassigned_and_used.nt
new file mode 100644
index 00000000..68bc9efe
--- /dev/null
+++ b/tests/new/prefix_reassigned_and_used.nt
@@ -0,0 +1 @@
+<http://b.example/s> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/prefix_reassigned_and_used.ttl b/tests/new/prefix_reassigned_and_used.ttl
new file mode 100644
index 00000000..1f948597
--- /dev/null
+++ b/tests/new/prefix_reassigned_and_used.ttl
@@ -0,0 +1,3 @@
+@prefix p: <http://a.example/>.
+@prefix p: <http://b.example/>.
+p:s <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/prefixed_IRI_object.ttl b/tests/new/prefixed_IRI_object.ttl
new file mode 100644
index 00000000..c2d50362
--- /dev/null
+++ b/tests/new/prefixed_IRI_object.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+<http://a.example/s> <http://a.example/p> p:o .
diff --git a/tests/new/prefixed_IRI_predicate.ttl b/tests/new/prefixed_IRI_predicate.ttl
new file mode 100644
index 00000000..2c1e5cc7
--- /dev/null
+++ b/tests/new/prefixed_IRI_predicate.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+<http://a.example/s> p:p <http://a.example/o> .
diff --git a/tests/new/prefixed_name_datatype.ttl b/tests/new/prefixed_name_datatype.ttl
new file mode 100644
index 00000000..4a526073
--- /dev/null
+++ b/tests/new/prefixed_name_datatype.ttl
@@ -0,0 +1,2 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+<http://a.example/s> <http://a.example/p> "1"^^xsd:integer .
diff --git a/tests/new/repeated_semis_at_end.ttl b/tests/new/repeated_semis_at_end.ttl
new file mode 100644
index 00000000..8a4d9356
--- /dev/null
+++ b/tests/new/repeated_semis_at_end.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p1> <http://a.example/o1>;; <http://a.example/p2> <http://a.example/o2> .
diff --git a/tests/new/repeated_semis_not_at_end.nt b/tests/new/repeated_semis_not_at_end.nt
new file mode 100644
index 00000000..9ac6005f
--- /dev/null
+++ b/tests/new/repeated_semis_not_at_end.nt
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p1> <http://a.example/o1> .
diff --git a/tests/new/repeated_semis_not_at_end.ttl b/tests/new/repeated_semis_not_at_end.ttl
new file mode 100644
index 00000000..3c8144f3
--- /dev/null
+++ b/tests/new/repeated_semis_not_at_end.ttl
@@ -0,0 +1 @@
+<http://a.example/s> <http://a.example/p1> <http://a.example/o1>;; .
diff --git a/tests/new/reserved_escaped_local_name.nt b/tests/new/reserved_escaped_local_name.nt
new file mode 100644
index 00000000..1dd88393
--- /dev/null
+++ b/tests/new/reserved_escaped_local_name.nt
@@ -0,0 +1 @@
+<http://a.example/%00> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/reserved_escaped_local_name.ttl b/tests/new/reserved_escaped_local_name.ttl
new file mode 100644
index 00000000..2464d655
--- /dev/null
+++ b/tests/new/reserved_escaped_local_name.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+p:\%00 <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/sole_blankNodePropertyList.nt b/tests/new/sole_blankNodePropertyList.nt
new file mode 100644
index 00000000..b48df9a7
--- /dev/null
+++ b/tests/new/sole_blankNodePropertyList.nt
@@ -0,0 +1 @@
+_:b1 <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/sole_blankNodePropertyList.ttl b/tests/new/sole_blankNodePropertyList.ttl
new file mode 100644
index 00000000..5cc300f3
--- /dev/null
+++ b/tests/new/sole_blankNodePropertyList.ttl
@@ -0,0 +1 @@
+[ <http://a.example/p> <http://a.example/o> ] .
diff --git a/tests/new/underscore_in_local_name.nt b/tests/new/underscore_in_local_name.nt
new file mode 100644
index 00000000..f9d0c4f1
--- /dev/null
+++ b/tests/new/underscore_in_local_name.nt
@@ -0,0 +1 @@
+<http://a.example/s_> <http://a.example/p> <http://a.example/o> .
diff --git a/tests/new/underscore_in_local_name.ttl b/tests/new/underscore_in_local_name.ttl
new file mode 100644
index 00000000..34596fdf
--- /dev/null
+++ b/tests/new/underscore_in_local_name.ttl
@@ -0,0 +1,2 @@
+@prefix p: <http://a.example/>.
+p:s_ <http://a.example/p> <http://a.example/o> .
diff --git a/tests/tests-ttl/LICENSE b/tests/tests-ttl/LICENSE
new file mode 100644
index 00000000..35eb3db2
--- /dev/null
+++ b/tests/tests-ttl/LICENSE
@@ -0,0 +1,40 @@
+## License for RDF 1.1 Trutle test Suite.
+##
+## By obtaining, using and/or copying this work, you (the licensee) agree that
+## you have read, understood, and will comply with the following terms and
+## conditions.
+##
+## Permission to copy, modify, and distribute this software and its
+## documentation, with or without modification, for any purpose and without
+## fee or royalty is hereby granted, provided that you include the following
+## on ALL copies of the software and documentation or portions thereof,
+## including modifications:
+##
+## * The full text of this NOTICE in a location viewable to users of the
+## redistributed or derivative work.
+##
+## * Any pre-existing intellectual property disclaimers, notices, or terms and
+## conditions. If none exist, the W3C Software Short Notice should be included
+## (hypertext is preferred, text is permitted) within the body of any
+## redistributed or derivative code.
+##
+## * Notice of any changes or modifications to the files, including the date
+## changes were made. (We recommend you provide URIs to the location from
+## which the code is derived.)
+##
+## Disclaimers
+##
+## THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
+## MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
+## NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
+## PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION 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 SOFTWARE OR
+## DOCUMENTATION.
+##
+## The name and trademarks of copyright holders may NOT be used in advertising
+## or publicity pertaining to the software without specific, written prior
+## permission. Title to copyright in this software and any associated
+## documentation will at all times remain with copyright holders.
diff --git a/tests/tests-ttl/README b/tests/tests-ttl/README
new file mode 100644
index 00000000..83ef182b
--- /dev/null
+++ b/tests/tests-ttl/README
@@ -0,0 +1 @@
+See http://www.w3.org/2011/rdf-wg/wiki/Turtle_Test_Suite for details.
diff --git a/tests/tests-ttl/manifest.ttl b/tests/tests-ttl/manifest.ttl
new file mode 100644
index 00000000..f149f451
--- /dev/null
+++ b/tests/tests-ttl/manifest.ttl
@@ -0,0 +1,1276 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Test named *subm* are (c) W3C and taken from the Trutle submission.
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix qt: <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
+
+@prefix rdft: <http://www.w3.org/ns/rdftest#> .
+
+<> rdf:type mf:Manifest ;
+ rdfs:comment "Turtle tests" ;
+ mf:entries
+ (
+ <#turtle-syntax-file-01>
+ <#turtle-syntax-file-02>
+ <#turtle-syntax-file-03>
+ <#turtle-syntax-uri-01>
+ <#turtle-syntax-uri-02>
+ <#turtle-syntax-uri-03>
+ <#turtle-syntax-uri-04>
+ <#turtle-syntax-base-01>
+ <#turtle-syntax-base-02>
+ <#turtle-syntax-base-03>
+ <#turtle-syntax-base-04>
+ <#turtle-syntax-prefix-01>
+ <#turtle-syntax-prefix-02>
+ <#turtle-syntax-prefix-03>
+ <#turtle-syntax-prefix-04>
+ <#turtle-syntax-prefix-05>
+ <#turtle-syntax-prefix-06>
+ <#turtle-syntax-prefix-07>
+ <#turtle-syntax-prefix-08>
+ <#turtle-syntax-prefix-09>
+ <#turtle-syntax-string-01>
+ <#turtle-syntax-string-02>
+ <#turtle-syntax-string-03>
+ <#turtle-syntax-string-04>
+ <#turtle-syntax-string-05>
+ <#turtle-syntax-string-06>
+ <#turtle-syntax-string-07>
+ <#turtle-syntax-string-08>
+ <#turtle-syntax-string-09>
+ <#turtle-syntax-string-10>
+ <#turtle-syntax-string-11>
+ <#turtle-syntax-str-esc-01>
+ <#turtle-syntax-str-esc-02>
+ <#turtle-syntax-str-esc-03>
+ <#turtle-syntax-pname-esc-01>
+ <#turtle-syntax-pname-esc-02>
+ <#turtle-syntax-pname-esc-03>
+ <#turtle-syntax-bnode-01>
+ <#turtle-syntax-bnode-02>
+ <#turtle-syntax-bnode-03>
+ <#turtle-syntax-bnode-04>
+ <#turtle-syntax-bnode-05>
+ <#turtle-syntax-bnode-06>
+ <#turtle-syntax-bnode-07>
+ <#turtle-syntax-bnode-08>
+ <#turtle-syntax-bnode-09>
+ <#turtle-syntax-bnode-10>
+ <#turtle-syntax-number-01>
+ <#turtle-syntax-number-02>
+ <#turtle-syntax-number-03>
+ <#turtle-syntax-number-04>
+ <#turtle-syntax-number-05>
+ <#turtle-syntax-number-06>
+ <#turtle-syntax-number-07>
+ <#turtle-syntax-number-08>
+ <#turtle-syntax-number-09>
+ <#turtle-syntax-number-10>
+ <#turtle-syntax-number-11>
+ <#turtle-syntax-datatypes-01>
+ <#turtle-syntax-datatypes-02>
+ <#turtle-syntax-kw-01>
+ <#turtle-syntax-kw-02>
+ <#turtle-syntax-kw-03>
+ <#turtle-syntax-struct-01>
+ <#turtle-syntax-struct-02>
+ <#turtle-syntax-struct-03>
+ <#turtle-syntax-struct-04>
+ <#turtle-syntax-struct-05>
+ <#turtle-syntax-lists-01>
+ <#turtle-syntax-lists-02>
+ <#turtle-syntax-lists-03>
+ <#turtle-syntax-lists-04>
+ <#turtle-syntax-lists-05>
+ <#turtle-syntax-bad-uri-01>
+ <#turtle-syntax-bad-uri-02>
+ <#turtle-syntax-bad-uri-03>
+ <#turtle-syntax-bad-uri-04>
+ <#turtle-syntax-bad-uri-05>
+ <#turtle-syntax-bad-prefix-01>
+ <#turtle-syntax-bad-prefix-02>
+ <#turtle-syntax-bad-prefix-03>
+ <#turtle-syntax-bad-prefix-04>
+ <#turtle-syntax-bad-prefix-05>
+ <#turtle-syntax-bad-base-01>
+ <#turtle-syntax-bad-base-02>
+ <#turtle-syntax-bad-base-03>
+ <#turtle-syntax-bad-struct-01>
+ <#turtle-syntax-bad-struct-02>
+ <#turtle-syntax-bad-struct-03>
+ <#turtle-syntax-bad-struct-04>
+ <#turtle-syntax-bad-struct-05>
+ <#turtle-syntax-bad-struct-06>
+ <#turtle-syntax-bad-struct-07>
+ <#turtle-syntax-bad-kw-01>
+ <#turtle-syntax-bad-kw-02>
+ <#turtle-syntax-bad-kw-03>
+ <#turtle-syntax-bad-kw-04>
+ <#turtle-syntax-bad-kw-05>
+ <#turtle-syntax-bad-n3-extras-01>
+ <#turtle-syntax-bad-n3-extras-02>
+ <#turtle-syntax-bad-n3-extras-03>
+ <#turtle-syntax-bad-n3-extras-04>
+ <#turtle-syntax-bad-n3-extras-05>
+ <#turtle-syntax-bad-n3-extras-06>
+ <#turtle-syntax-bad-n3-extras-07>
+ <#turtle-syntax-bad-n3-extras-08>
+ <#turtle-syntax-bad-n3-extras-09>
+ <#turtle-syntax-bad-n3-extras-10>
+ <#turtle-syntax-bad-n3-extras-11>
+ <#turtle-syntax-bad-n3-extras-12>
+ <#turtle-syntax-bad-n3-extras-13>
+ <#turtle-syntax-bad-struct-08>
+ <#turtle-syntax-bad-struct-09>
+ <#turtle-syntax-bad-struct-10>
+ <#turtle-syntax-bad-struct-11>
+ <#turtle-syntax-bad-struct-12>
+ <#turtle-syntax-bad-struct-13>
+ <#turtle-syntax-bad-struct-14>
+ <#turtle-syntax-bad-struct-15>
+ <#turtle-syntax-bad-struct-16>
+ <#turtle-syntax-bad-struct-17>
+ <#turtle-syntax-bad-lang-01>
+ <#turtle-syntax-bad-esc-01>
+ <#turtle-syntax-bad-esc-02>
+ <#turtle-syntax-bad-esc-03>
+ <#turtle-syntax-bad-esc-04>
+ <#turtle-syntax-bad-pname-01>
+ <#turtle-syntax-bad-pname-02>
+ <#turtle-syntax-bad-pname-03>
+ <#turtle-syntax-bad-string-01>
+ <#turtle-syntax-bad-string-02>
+ <#turtle-syntax-bad-string-03>
+ <#turtle-syntax-bad-string-04>
+ <#turtle-syntax-bad-string-05>
+ <#turtle-syntax-bad-string-06>
+ <#turtle-syntax-bad-string-07>
+ <#turtle-syntax-bad-num-01>
+ <#turtle-syntax-bad-num-02>
+ <#turtle-syntax-bad-num-03>
+ <#turtle-syntax-bad-num-04>
+ <#turtle-syntax-bad-num-05>
+ <#turtle-eval-struct-01>
+ <#turtle-eval-struct-02>
+ <#turtle-subm-01>
+ <#turtle-subm-02>
+ <#turtle-subm-03>
+ <#turtle-subm-04>
+ <#turtle-subm-05>
+ <#turtle-subm-06>
+ <#turtle-subm-07>
+ <#turtle-subm-08>
+ <#turtle-subm-09>
+ <#turtle-subm-10>
+ <#turtle-subm-11>
+ <#turtle-subm-12>
+ <#turtle-subm-13>
+ <#turtle-subm-14>
+ <#turtle-subm-15>
+ <#turtle-subm-16>
+ <#turtle-subm-17>
+ <#turtle-subm-18>
+ <#turtle-subm-19>
+ <#turtle-subm-20>
+ <#turtle-subm-21>
+ <#turtle-subm-22>
+ <#turtle-subm-23>
+ <#turtle-subm-24>
+ <#turtle-subm-25>
+ <#turtle-subm-26>
+ <#turtle-subm-27>
+ <#turtle-eval-bad-01>
+ <#turtle-eval-bad-02>
+ <#turtle-eval-bad-03>
+ <#turtle-eval-bad-04>
+ ) .
+
+<#turtle-syntax-file-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-file-01" ;
+ rdfs:comment "Empty file" ;
+ mf:action <turtle-syntax-file-01.ttl> ;
+ .
+
+<#turtle-syntax-file-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-file-02" ;
+ rdfs:comment "Only comment" ;
+ mf:action <turtle-syntax-file-02.ttl> ;
+ .
+
+<#turtle-syntax-file-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-file-03" ;
+ rdfs:comment "One comment, one empty line" ;
+ mf:action <turtle-syntax-file-03.ttl> ;
+ .
+
+<#turtle-syntax-uri-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-uri-01" ;
+ rdfs:comment "Only IRIs" ;
+ mf:action <turtle-syntax-uri-01.ttl> ;
+ .
+
+<#turtle-syntax-uri-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-uri-02" ;
+ rdfs:comment "IRIs with Unicode escape" ;
+ mf:action <turtle-syntax-uri-02.ttl> ;
+ .
+
+<#turtle-syntax-uri-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-uri-03" ;
+ rdfs:comment "IRIs with long Unicode escape" ;
+ mf:action <turtle-syntax-uri-03.ttl> ;
+ .
+
+<#turtle-syntax-uri-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-uri-04" ;
+ rdfs:comment "Legal IRIs" ;
+ mf:action <turtle-syntax-uri-04.ttl> ;
+ .
+
+<#turtle-syntax-base-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-base-01" ;
+ rdfs:comment "@base" ;
+ mf:action <turtle-syntax-base-01.ttl> ;
+ .
+
+<#turtle-syntax-base-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-base-02" ;
+ rdfs:comment "BASE" ;
+ mf:action <turtle-syntax-base-02.ttl> ;
+ .
+
+<#turtle-syntax-base-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-base-03" ;
+ rdfs:comment "@base with relative IRIs" ;
+ mf:action <turtle-syntax-base-03.ttl> ;
+ .
+
+<#turtle-syntax-base-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-base-04" ;
+ rdfs:comment "base with relative IRIs" ;
+ mf:action <turtle-syntax-base-04.ttl> ;
+ .
+
+<#turtle-syntax-prefix-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-01" ;
+ rdfs:comment "@prefix" ;
+ mf:action <turtle-syntax-prefix-01.ttl> ;
+ .
+
+<#turtle-syntax-prefix-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-02" ;
+ rdfs:comment "PreFIX" ;
+ mf:action <turtle-syntax-prefix-02.ttl> ;
+ .
+
+<#turtle-syntax-prefix-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-03" ;
+ rdfs:comment "Empty PREFIX" ;
+ mf:action <turtle-syntax-prefix-03.ttl> ;
+ .
+
+<#turtle-syntax-prefix-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-04" ;
+ rdfs:comment "Empty @prefix with % escape" ;
+ mf:action <turtle-syntax-prefix-04.ttl> ;
+ .
+
+<#turtle-syntax-prefix-05> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-05" ;
+ rdfs:comment "@prefix with no suffix" ;
+ mf:action <turtle-syntax-prefix-05.ttl> ;
+ .
+
+<#turtle-syntax-prefix-06> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-06" ;
+ rdfs:comment "colon is a legal pname character" ;
+ mf:action <turtle-syntax-prefix-06.ttl> ;
+ .
+
+<#turtle-syntax-prefix-07> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-07" ;
+ rdfs:comment "dash is a legal pname character" ;
+ mf:action <turtle-syntax-prefix-07.ttl> ;
+ .
+
+<#turtle-syntax-prefix-08> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-08" ;
+ rdfs:comment "underscore is a legal pname character" ;
+ mf:action <turtle-syntax-prefix-08.ttl> ;
+ .
+
+<#turtle-syntax-prefix-09> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-prefix-09" ;
+ rdfs:comment "percents in pnames" ;
+ mf:action <turtle-syntax-prefix-09.ttl> ;
+ .
+
+<#turtle-syntax-string-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-01" ;
+ rdfs:comment "string literal" ;
+ mf:action <turtle-syntax-string-01.ttl> ;
+ .
+
+<#turtle-syntax-string-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-02" ;
+ rdfs:comment "langString literal" ;
+ mf:action <turtle-syntax-string-02.ttl> ;
+ .
+
+<#turtle-syntax-string-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-03" ;
+ rdfs:comment "langString literal with region" ;
+ mf:action <turtle-syntax-string-03.ttl> ;
+ .
+
+<#turtle-syntax-string-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-04" ;
+ rdfs:comment "squote string literal" ;
+ mf:action <turtle-syntax-string-04.ttl> ;
+ .
+
+<#turtle-syntax-string-05> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-05" ;
+ rdfs:comment "squote langString literal" ;
+ mf:action <turtle-syntax-string-05.ttl> ;
+ .
+
+<#turtle-syntax-string-06> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-06" ;
+ rdfs:comment "squote langString literal with region" ;
+ mf:action <turtle-syntax-string-06.ttl> ;
+ .
+
+<#turtle-syntax-string-07> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-07" ;
+ rdfs:comment "long string literal with embedded single- and double-quotes" ;
+ mf:action <turtle-syntax-string-07.ttl> ;
+ .
+
+<#turtle-syntax-string-08> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-08" ;
+ rdfs:comment "long string literal with embedded newline" ;
+ mf:action <turtle-syntax-string-08.ttl> ;
+ .
+
+<#turtle-syntax-string-09> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-09" ;
+ rdfs:comment "squote long string literal with embedded single- and double-quotes" ;
+ mf:action <turtle-syntax-string-09.ttl> ;
+ .
+
+<#turtle-syntax-string-10> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-10" ;
+ rdfs:comment "long langString literal with embedded newline" ;
+ mf:action <turtle-syntax-string-10.ttl> ;
+ .
+
+<#turtle-syntax-string-11> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-string-11" ;
+ rdfs:comment "squote long langString literal with embedded newline" ;
+ mf:action <turtle-syntax-string-11.ttl> ;
+ .
+
+<#turtle-syntax-str-esc-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-str-esc-01" ;
+ rdfs:comment "string literal with escaped newline" ;
+ mf:action <turtle-syntax-str-esc-01.ttl> ;
+ .
+
+<#turtle-syntax-str-esc-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-str-esc-02" ;
+ rdfs:comment "string literal with Unicode escape" ;
+ mf:action <turtle-syntax-str-esc-02.ttl> ;
+ .
+
+<#turtle-syntax-str-esc-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-str-esc-03" ;
+ rdfs:comment "string literal with long Unicode escape" ;
+ mf:action <turtle-syntax-str-esc-03.ttl> ;
+ .
+
+<#turtle-syntax-pname-esc-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-pname-esc-01" ;
+ rdfs:comment "pname with back-slash escapes" ;
+ mf:action <turtle-syntax-pname-esc-01.ttl> ;
+ .
+
+<#turtle-syntax-pname-esc-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-pname-esc-02" ;
+ rdfs:comment "pname with back-slash escapes (2)" ;
+ mf:action <turtle-syntax-pname-esc-02.ttl> ;
+ .
+
+<#turtle-syntax-pname-esc-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-pname-esc-03" ;
+ rdfs:comment "pname with back-slash escapes (3)" ;
+ mf:action <turtle-syntax-pname-esc-03.ttl> ;
+ .
+
+<#turtle-syntax-bnode-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-01" ;
+ rdfs:comment "bnode subject" ;
+ mf:action <turtle-syntax-bnode-01.ttl> ;
+ .
+
+<#turtle-syntax-bnode-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-02" ;
+ rdfs:comment "bnode object" ;
+ mf:action <turtle-syntax-bnode-02.ttl> ;
+ .
+
+<#turtle-syntax-bnode-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-03" ;
+ rdfs:comment "bnode property list object" ;
+ mf:action <turtle-syntax-bnode-03.ttl> ;
+ .
+
+<#turtle-syntax-bnode-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-04" ;
+ rdfs:comment "bnode property list object (2)" ;
+ mf:action <turtle-syntax-bnode-04.ttl> ;
+ .
+
+<#turtle-syntax-bnode-05> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-05" ;
+ rdfs:comment "bnode property list subject" ;
+ mf:action <turtle-syntax-bnode-05.ttl> ;
+ .
+
+<#turtle-syntax-bnode-06> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-06" ;
+ rdfs:comment "labeled bnode subject" ;
+ mf:action <turtle-syntax-bnode-06.ttl> ;
+ .
+
+<#turtle-syntax-bnode-07> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-07" ;
+ rdfs:comment "labeled bnode subject and object" ;
+ mf:action <turtle-syntax-bnode-07.ttl> ;
+ .
+
+<#turtle-syntax-bnode-08> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-08" ;
+ rdfs:comment "bare bnode property list" ;
+ mf:action <turtle-syntax-bnode-08.ttl> ;
+ .
+
+<#turtle-syntax-bnode-09> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-09" ;
+ rdfs:comment "bnode property list" ;
+ mf:action <turtle-syntax-bnode-09.ttl> ;
+ .
+
+<#turtle-syntax-bnode-10> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-bnode-10" ;
+ rdfs:comment "mixed bnode property list and triple" ;
+ mf:action <turtle-syntax-bnode-10.ttl> ;
+ .
+
+<#turtle-syntax-number-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-01" ;
+ rdfs:comment "integer literal" ;
+ mf:action <turtle-syntax-number-01.ttl> ;
+ .
+
+<#turtle-syntax-number-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-02" ;
+ rdfs:comment "negative integer literal" ;
+ mf:action <turtle-syntax-number-02.ttl> ;
+ .
+
+<#turtle-syntax-number-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-03" ;
+ rdfs:comment "positive integer literal" ;
+ mf:action <turtle-syntax-number-03.ttl> ;
+ .
+
+<#turtle-syntax-number-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-04" ;
+ rdfs:comment "decimal literal" ;
+ mf:action <turtle-syntax-number-04.ttl> ;
+ .
+
+<#turtle-syntax-number-05> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-05" ;
+ rdfs:comment "decimal literal (no leading digits)" ;
+ mf:action <turtle-syntax-number-05.ttl> ;
+ .
+
+<#turtle-syntax-number-06> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-06" ;
+ rdfs:comment "negative decimal literal" ;
+ mf:action <turtle-syntax-number-06.ttl> ;
+ .
+
+<#turtle-syntax-number-07> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-07" ;
+ rdfs:comment "positive decimal literal" ;
+ mf:action <turtle-syntax-number-07.ttl> ;
+ .
+
+<#turtle-syntax-number-08> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-08" ;
+ rdfs:comment "integer literal with decimal lexical confusion" ;
+ mf:action <turtle-syntax-number-08.ttl> ;
+ .
+
+<#turtle-syntax-number-09> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-09" ;
+ rdfs:comment "double literal" ;
+ mf:action <turtle-syntax-number-09.ttl> ;
+ .
+
+<#turtle-syntax-number-10> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-10" ;
+ rdfs:comment "negative double literal" ;
+ mf:action <turtle-syntax-number-10.ttl> ;
+ .
+
+<#turtle-syntax-number-11> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-number-11" ;
+ rdfs:comment "double literal no fraction" ;
+ mf:action <turtle-syntax-number-11.ttl> ;
+ .
+
+<#turtle-syntax-datatypes-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-datatypes-01" ;
+ rdfs:comment "xsd:byte literal" ;
+ mf:action <turtle-syntax-datatypes-01.ttl> ;
+ .
+
+<#turtle-syntax-datatypes-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-datatypes-02" ;
+ rdfs:comment "integer as xsd:string" ;
+ mf:action <turtle-syntax-datatypes-02.ttl> ;
+ .
+
+<#turtle-syntax-kw-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-kw-01" ;
+ rdfs:comment "boolean literal (true)" ;
+ mf:action <turtle-syntax-kw-01.ttl> ;
+ .
+
+<#turtle-syntax-kw-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-kw-02" ;
+ rdfs:comment "boolean literal (false)" ;
+ mf:action <turtle-syntax-kw-02.ttl> ;
+ .
+
+<#turtle-syntax-kw-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-kw-03" ;
+ rdfs:comment "'a' as keyword" ;
+ mf:action <turtle-syntax-kw-03.ttl> ;
+ .
+
+<#turtle-syntax-struct-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-struct-01" ;
+ rdfs:comment "object list" ;
+ mf:action <turtle-syntax-struct-01.ttl> ;
+ .
+
+<#turtle-syntax-struct-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-struct-02" ;
+ rdfs:comment "predicate list with object list" ;
+ mf:action <turtle-syntax-struct-02.ttl> ;
+ .
+
+<#turtle-syntax-struct-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-struct-03" ;
+ rdfs:comment "predicate list with object list and dangling ';'" ;
+ mf:action <turtle-syntax-struct-03.ttl> ;
+ .
+
+<#turtle-syntax-struct-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-struct-04" ;
+ rdfs:comment "predicate list with multiple ;;" ;
+ mf:action <turtle-syntax-struct-04.ttl> ;
+ .
+
+<#turtle-syntax-struct-05> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-struct-05" ;
+ rdfs:comment "predicate list with multiple ;;" ;
+ mf:action <turtle-syntax-struct-05.ttl> ;
+ .
+
+<#turtle-syntax-lists-01> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-lists-01" ;
+ rdfs:comment "empty list" ;
+ mf:action <turtle-syntax-lists-01.ttl> ;
+ .
+
+<#turtle-syntax-lists-02> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-lists-02" ;
+ rdfs:comment "mixed list" ;
+ mf:action <turtle-syntax-lists-02.ttl> ;
+ .
+
+<#turtle-syntax-lists-03> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-lists-03" ;
+ rdfs:comment "isomorphic list as subject and object" ;
+ mf:action <turtle-syntax-lists-03.ttl> ;
+ .
+
+<#turtle-syntax-lists-04> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-lists-04" ;
+ rdfs:comment "lists of lists" ;
+ mf:action <turtle-syntax-lists-04.ttl> ;
+ .
+
+<#turtle-syntax-lists-05> rdf:type rdft:TestTurtlePositiveSyntax ;
+ mf:name "turtle-syntax-lists-05" ;
+ rdfs:comment "mixed lists with embedded lists" ;
+ mf:action <turtle-syntax-lists-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-uri-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-uri-01" ;
+ rdfs:comment "Bad IRI : space (negative test)" ;
+ mf:action <turtle-syntax-bad-uri-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-uri-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-uri-02" ;
+ rdfs:comment "Bad IRI : bad escape (negative test)" ;
+ mf:action <turtle-syntax-bad-uri-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-uri-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-uri-03" ;
+ rdfs:comment "Bad IRI : bad long escape (negative test)" ;
+ mf:action <turtle-syntax-bad-uri-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-uri-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-uri-04" ;
+ rdfs:comment "Bad IRI : character escapes not allowed (negative test)" ;
+ mf:action <turtle-syntax-bad-uri-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-uri-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-uri-05" ;
+ rdfs:comment "Bad IRI : character escapes not allowed (2) (negative test)" ;
+ mf:action <turtle-syntax-bad-uri-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-prefix-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-prefix-01" ;
+ rdfs:comment "No prefix (negative test)" ;
+ mf:action <turtle-syntax-bad-prefix-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-prefix-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-prefix-02" ;
+ rdfs:comment "No prefix (2) (negative test)" ;
+ mf:action <turtle-syntax-bad-prefix-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-prefix-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-prefix-03" ;
+ rdfs:comment "@prefix without URI (negative test)" ;
+ mf:action <turtle-syntax-bad-prefix-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-prefix-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-prefix-04" ;
+ rdfs:comment "@prefix without prefix name (negative test)" ;
+ mf:action <turtle-syntax-bad-prefix-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-prefix-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-prefix-05" ;
+ rdfs:comment "@prefix without ':' (negative test)" ;
+ mf:action <turtle-syntax-bad-prefix-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-base-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-base-01" ;
+ rdfs:comment "@base without URI (negative test)" ;
+ mf:action <turtle-syntax-bad-base-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-base-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-base-02" ;
+ rdfs:comment "@base in wrong case (negative test)" ;
+ mf:action <turtle-syntax-bad-base-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-base-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-base-03" ;
+ rdfs:comment "BASE without URI (negative test)" ;
+ mf:action <turtle-syntax-bad-base-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-01" ;
+ rdfs:comment "Turtle is not TriG (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-02" ;
+ rdfs:comment "Turtle is not N3 (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-03" ;
+ rdfs:comment "Turtle is not NQuads (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-04" ;
+ rdfs:comment "Turtle does not allow literals-as-subjects (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-05" ;
+ rdfs:comment "Turtle does not allow literals-as-predicates (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-06> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-06" ;
+ rdfs:comment "Turtle does not allow bnodes-as-predicates (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-06.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-07> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-07" ;
+ rdfs:comment "Turtle does not allow labeled bnodes-as-predicates (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-07.ttl> ;
+ .
+
+<#turtle-syntax-bad-kw-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-kw-01" ;
+ rdfs:comment "'A' is not a keyword (negative test)" ;
+ mf:action <turtle-syntax-bad-kw-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-kw-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-kw-02" ;
+ rdfs:comment "'a' cannot be used as subject (negative test)" ;
+ mf:action <turtle-syntax-bad-kw-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-kw-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-kw-03" ;
+ rdfs:comment "'a' cannot be used as object (negative test)" ;
+ mf:action <turtle-syntax-bad-kw-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-kw-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-kw-04" ;
+ rdfs:comment "'true' cannot be used as subject (negative test)" ;
+ mf:action <turtle-syntax-bad-kw-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-kw-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-kw-05" ;
+ rdfs:comment "'true' cannot be used as object (negative test)" ;
+ mf:action <turtle-syntax-bad-kw-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-01" ;
+ rdfs:comment "{} fomulae not in Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-02" ;
+ rdfs:comment "= is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-03" ;
+ rdfs:comment "N3 paths not in Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-04" ;
+ rdfs:comment "N3 paths not in Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-05" ;
+ rdfs:comment "N3 is...of not in Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-06> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-06" ;
+ rdfs:comment "N3 paths not in Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-06.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-07> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-07" ;
+ rdfs:comment "@keywords is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-07.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-08> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-08" ;
+ rdfs:comment "@keywords is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-08.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-09> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-09" ;
+ rdfs:comment "=> is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-09.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-10> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-10" ;
+ rdfs:comment "<= is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-10.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-11> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-11" ;
+ rdfs:comment "@forSome is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-11.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-12> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-12" ;
+ rdfs:comment "@forAll is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-12.ttl> ;
+ .
+
+<#turtle-syntax-bad-n3-extras-13> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-n3-extras-13" ;
+ rdfs:comment "@keywords is not Turtle (negative test)" ;
+ mf:action <turtle-syntax-bad-n3-extras-13.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-08> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-08" ;
+ rdfs:comment "missing '.' (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-08.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-09> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-09" ;
+ rdfs:comment "extra '.' (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-09.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-10> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-10" ;
+ rdfs:comment "extra '.' (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-10.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-11> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-11" ;
+ rdfs:comment "trailing ';' no '.' (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-11.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-12> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-12" ;
+ rdfs:comment "subject, predicate, no object (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-12.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-13> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-13" ;
+ rdfs:comment "subject, predicate, no object (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-13.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-14> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-14" ;
+ rdfs:comment "literal as subject (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-14.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-15> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-15" ;
+ rdfs:comment "literal as predicate (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-15.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-16> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-16" ;
+ rdfs:comment "bnode as predicate (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-16.ttl> ;
+ .
+
+<#turtle-syntax-bad-struct-17> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-struct-17" ;
+ rdfs:comment "labeled bnode as predicate (negative test)" ;
+ mf:action <turtle-syntax-bad-struct-17.ttl> ;
+ .
+
+<#turtle-syntax-bad-lang-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-lang-01" ;
+ rdfs:comment "langString with bad lang (negative test)" ;
+ mf:action <turtle-syntax-bad-lang-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-esc-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-esc-01" ;
+ rdfs:comment "Bad string escape (negative test)" ;
+ mf:action <turtle-syntax-bad-esc-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-esc-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-esc-02" ;
+ rdfs:comment "Bad string escape (negative test)" ;
+ mf:action <turtle-syntax-bad-esc-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-esc-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-esc-03" ;
+ rdfs:comment "Bad string escape (negative test)" ;
+ mf:action <turtle-syntax-bad-esc-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-esc-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-esc-04" ;
+ rdfs:comment "Bad string escape (negative test)" ;
+ mf:action <turtle-syntax-bad-esc-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-pname-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-pname-01" ;
+ rdfs:comment "'~' must be escaped in pname (negative test)" ;
+ mf:action <turtle-syntax-bad-pname-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-pname-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-pname-02" ;
+ rdfs:comment "Bad %-sequence in pname (negative test)" ;
+ mf:action <turtle-syntax-bad-pname-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-pname-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-pname-03" ;
+ rdfs:comment "Bad unicode escape in pname (negative test)" ;
+ mf:action <turtle-syntax-bad-pname-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-01" ;
+ rdfs:comment "mismatching string literal open/close (negative test)" ;
+ mf:action <turtle-syntax-bad-string-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-02" ;
+ rdfs:comment "mismatching string literal open/close (negative test)" ;
+ mf:action <turtle-syntax-bad-string-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-03" ;
+ rdfs:comment "mismatching string literal long/short (negative test)" ;
+ mf:action <turtle-syntax-bad-string-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-04" ;
+ rdfs:comment "mismatching long string literal open/close (negative test)" ;
+ mf:action <turtle-syntax-bad-string-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-05" ;
+ rdfs:comment "Long literal with missing end (negative test)" ;
+ mf:action <turtle-syntax-bad-string-05.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-06> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-06" ;
+ rdfs:comment "Long literal with extra quote (negative test)" ;
+ mf:action <turtle-syntax-bad-string-06.ttl> ;
+ .
+
+<#turtle-syntax-bad-string-07> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-string-07" ;
+ rdfs:comment "Long literal with extra squote (negative test)" ;
+ mf:action <turtle-syntax-bad-string-07.ttl> ;
+ .
+
+<#turtle-syntax-bad-num-01> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-num-01" ;
+ rdfs:comment "Bad number format (negative test)" ;
+ mf:action <turtle-syntax-bad-num-01.ttl> ;
+ .
+
+<#turtle-syntax-bad-num-02> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-num-02" ;
+ rdfs:comment "Bad number format (negative test)" ;
+ mf:action <turtle-syntax-bad-num-02.ttl> ;
+ .
+
+<#turtle-syntax-bad-num-03> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-num-03" ;
+ rdfs:comment "Bad number format (negative test)" ;
+ mf:action <turtle-syntax-bad-num-03.ttl> ;
+ .
+
+<#turtle-syntax-bad-num-04> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-num-04" ;
+ rdfs:comment "Bad number format (negative test)" ;
+ mf:action <turtle-syntax-bad-num-04.ttl> ;
+ .
+
+<#turtle-syntax-bad-num-05> rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "turtle-syntax-bad-num-05" ;
+ rdfs:comment "Bad number format (negative test)" ;
+ mf:action <turtle-syntax-bad-num-05.ttl> ;
+ .
+
+<#turtle-eval-struct-01> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-eval-struct-01" ;
+ rdfs:comment "triple with IRIs" ;
+ mf:action <turtle-eval-struct-01.ttl> ;
+ mf:result <turtle-eval-struct-01.nt> ;
+ .
+
+<#turtle-eval-struct-02> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-eval-struct-02" ;
+ rdfs:comment "triple with IRIs and embedded whitespace" ;
+ mf:action <turtle-eval-struct-02.ttl> ;
+ mf:result <turtle-eval-struct-02.nt> ;
+ .
+
+<#turtle-subm-01> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-01" ;
+ rdfs:comment "Blank subject" ;
+ mf:action <turtle-subm-01.ttl> ;
+ mf:result <turtle-subm-01.nt> ;
+ .
+
+<#turtle-subm-02> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-02" ;
+ rdfs:comment "@prefix and qnames" ;
+ mf:action <turtle-subm-02.ttl> ;
+ mf:result <turtle-subm-02.nt> ;
+ .
+
+<#turtle-subm-03> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-03" ;
+ rdfs:comment ", operator" ;
+ mf:action <turtle-subm-03.ttl> ;
+ mf:result <turtle-subm-03.nt> ;
+ .
+
+<#turtle-subm-04> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-04" ;
+ rdfs:comment "; operator" ;
+ mf:action <turtle-subm-04.ttl> ;
+ mf:result <turtle-subm-04.nt> ;
+ .
+
+<#turtle-subm-05> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-05" ;
+ rdfs:comment "empty [] as subject and object" ;
+ mf:action <turtle-subm-05.ttl> ;
+ mf:result <turtle-subm-05.nt> ;
+ .
+
+<#turtle-subm-06> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-06" ;
+ rdfs:comment "non-empty [] as subject and object" ;
+ mf:action <turtle-subm-06.ttl> ;
+ mf:result <turtle-subm-06.nt> ;
+ .
+
+<#turtle-subm-07> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-07" ;
+ rdfs:comment "'a' as predicate" ;
+ mf:action <turtle-subm-07.ttl> ;
+ mf:result <turtle-subm-07.nt> ;
+ .
+
+<#turtle-subm-08> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-08" ;
+ rdfs:comment "simple collection" ;
+ mf:action <turtle-subm-08.ttl> ;
+ mf:result <turtle-subm-08.nt> ;
+ .
+
+<#turtle-subm-09> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-09" ;
+ rdfs:comment "empty collection" ;
+ mf:action <turtle-subm-09.ttl> ;
+ mf:result <turtle-subm-09.nt> ;
+ .
+
+<#turtle-subm-10> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-10" ;
+ rdfs:comment "integer datatyped literal" ;
+ mf:action <turtle-subm-10.ttl> ;
+ mf:result <turtle-subm-10.nt> ;
+ .
+
+<#turtle-subm-11> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-11" ;
+ rdfs:comment "decimal integer canonicalization" ;
+ mf:action <turtle-subm-11.ttl> ;
+ mf:result <turtle-subm-11.nt> ;
+ .
+
+<#turtle-subm-12> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-12" ;
+ rdfs:comment "- and _ in names and qnames" ;
+ mf:action <turtle-subm-12.ttl> ;
+ mf:result <turtle-subm-12.nt> ;
+ .
+
+<#turtle-subm-13> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-13" ;
+ rdfs:comment "tests for rdf:_<numbers> and other qnames starting with _" ;
+ mf:action <turtle-subm-13.ttl> ;
+ mf:result <turtle-subm-13.nt> ;
+ .
+
+<#turtle-subm-14> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-14" ;
+ rdfs:comment "bare : allowed" ;
+ mf:action <turtle-subm-14.ttl> ;
+ mf:result <turtle-subm-14.nt> ;
+ .
+
+<#turtle-subm-15> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-15" ;
+ rdfs:comment "simple long literal" ;
+ mf:action <turtle-subm-15.ttl> ;
+ mf:result <turtle-subm-15.nt> ;
+ .
+
+<#turtle-subm-16> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-16" ;
+ rdfs:comment "long literals with escapes" ;
+ mf:action <turtle-subm-16.ttl> ;
+ mf:result <turtle-subm-16.nt> ;
+ .
+
+<#turtle-subm-17> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-17" ;
+ rdfs:comment "floating point number" ;
+ mf:action <turtle-subm-17.ttl> ;
+ mf:result <turtle-subm-17.nt> ;
+ .
+
+<#turtle-subm-18> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-18" ;
+ rdfs:comment "empty literals, normal and long variant" ;
+ mf:action <turtle-subm-18.ttl> ;
+ mf:result <turtle-subm-18.nt> ;
+ .
+
+<#turtle-subm-19> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-19" ;
+ rdfs:comment "positive integer, decimal and doubles" ;
+ mf:action <turtle-subm-19.ttl> ;
+ mf:result <turtle-subm-19.nt> ;
+ .
+
+<#turtle-subm-20> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-20" ;
+ rdfs:comment "negative integer, decimal and doubles" ;
+ mf:action <turtle-subm-20.ttl> ;
+ mf:result <turtle-subm-20.nt> ;
+ .
+
+<#turtle-subm-21> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-21" ;
+ rdfs:comment "long literal ending in double quote" ;
+ mf:action <turtle-subm-21.ttl> ;
+ mf:result <turtle-subm-21.nt> ;
+ .
+
+<#turtle-subm-22> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-22" ;
+ rdfs:comment "boolean literals" ;
+ mf:action <turtle-subm-22.ttl> ;
+ mf:result <turtle-subm-22.nt> ;
+ .
+
+<#turtle-subm-23> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-23" ;
+ rdfs:comment "comments" ;
+ mf:action <turtle-subm-23.ttl> ;
+ mf:result <turtle-subm-23.nt> ;
+ .
+
+<#turtle-subm-24> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-24" ;
+ rdfs:comment "no final mewline" ;
+ mf:action <turtle-subm-24.ttl> ;
+ mf:result <turtle-subm-24.nt> ;
+ .
+
+<#turtle-subm-25> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-25" ;
+ rdfs:comment "repeating a @prefix changes pname definition" ;
+ mf:action <turtle-subm-25.ttl> ;
+ mf:result <turtle-subm-25.nt> ;
+ .
+
+<#turtle-subm-26> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-26" ;
+ rdfs:comment "Variations on decimal canonicalization" ;
+ mf:action <turtle-subm-26.ttl> ;
+ mf:result <turtle-subm-26.nt> ;
+ .
+
+<#turtle-subm-27> rdf:type rdft:TestTurtleEval ;
+ mf:name "turtle-subm-27" ;
+ rdfs:comment "Repeating @base changes base for relative IRI lookup" ;
+ mf:action <turtle-subm-27.ttl> ;
+ mf:result <turtle-subm-27.nt> ;
+ .
+
+<#turtle-eval-bad-01> rdf:type rdft:TestTurtleNegativeEval ;
+ mf:name "turtle-eval-bad-01" ;
+ rdfs:comment "Bad IRI : good escape, bad charcater (negative evaluation test)" ;
+ mf:action <turtle-eval-bad-01.ttl> ;
+ .
+
+<#turtle-eval-bad-02> rdf:type rdft:TestTurtleNegativeEval ;
+ mf:name "turtle-eval-bad-02" ;
+ rdfs:comment "Bad IRI : hex 3C is < (negative evaluation test)" ;
+ mf:action <turtle-eval-bad-02.ttl> ;
+ .
+
+<#turtle-eval-bad-03> rdf:type rdft:TestTurtleNegativeEval ;
+ mf:name "turtle-eval-bad-03" ;
+ rdfs:comment "Bad IRI : hex 3E is (negative evaluation test)" ;
+ mf:action <turtle-eval-bad-03.ttl> ;
+ .
+
+<#turtle-eval-bad-04> rdf:type rdft:TestTurtleNegativeEval ;
+ mf:name "turtle-eval-bad-04" ;
+ rdfs:comment "Bad IRI : {abc} (negative evaluation test)" ;
+ mf:action <turtle-eval-bad-04.ttl> ;
+ .
diff --git a/tests/tests-ttl/turtle-eval-bad-01.ttl b/tests/tests-ttl/turtle-eval-bad-01.ttl
new file mode 100644
index 00000000..dc58ca82
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-bad-01.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : good escape, bad charcater
+<http://example/\u0020> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-eval-bad-02.ttl b/tests/tests-ttl/turtle-eval-bad-02.ttl
new file mode 100644
index 00000000..ef20d6ae
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-bad-02.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : hex 3C is <
+<http://example/\u003C> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-eval-bad-03.ttl b/tests/tests-ttl/turtle-eval-bad-03.ttl
new file mode 100644
index 00000000..55ecd5b0
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-bad-03.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : hex 3E is >
+<http://example/\u003E> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-eval-bad-04.ttl b/tests/tests-ttl/turtle-eval-bad-04.ttl
new file mode 100644
index 00000000..557418ff
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-bad-04.ttl
@@ -0,0 +1,2 @@
+# Bad IRI
+<http://example/{abc}> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-eval-struct-01.nt b/tests/tests-ttl/turtle-eval-struct-01.nt
new file mode 100644
index 00000000..02e6ba98
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-struct-01.nt
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-eval-struct-01.ttl b/tests/tests-ttl/turtle-eval-struct-01.ttl
new file mode 100644
index 00000000..02e6ba98
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-struct-01.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-eval-struct-02.nt b/tests/tests-ttl/turtle-eval-struct-02.nt
new file mode 100644
index 00000000..a4a5286c
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-struct-02.nt
@@ -0,0 +1,2 @@
+<http://example/s> <http://example/p1> <http://example/o1> .
+<http://example/s> <http://example/p2> <http://example/o2> .
diff --git a/tests/tests-ttl/turtle-eval-struct-02.ttl b/tests/tests-ttl/turtle-eval-struct-02.ttl
new file mode 100644
index 00000000..13231835
--- /dev/null
+++ b/tests/tests-ttl/turtle-eval-struct-02.ttl
@@ -0,0 +1,4 @@
+<http://example/s>
+ <http://example/p1> <http://example/o1> ;
+ <http://example/p2> <http://example/o2> ;
+ .
diff --git a/tests/tests-ttl/turtle-subm-01.nt b/tests/tests-ttl/turtle-subm-01.nt
new file mode 100644
index 00000000..ae545ac3
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-01.nt
@@ -0,0 +1 @@
+_:b1 <http://example/base/turtle-subm-01.ttl#x> <http://example/base/turtle-subm-01.ttl#y> .
diff --git a/tests/tests-ttl/turtle-subm-01.ttl b/tests/tests-ttl/turtle-subm-01.ttl
new file mode 100644
index 00000000..78da35e6
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <#> .
+[] :x :y .
diff --git a/tests/tests-ttl/turtle-subm-02.nt b/tests/tests-ttl/turtle-subm-02.nt
new file mode 100644
index 00000000..5ccb5bd2
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-02.nt
@@ -0,0 +1,3 @@
+<http://example.org/base1#a> <http://example.org/base1#b> <http://example.org/base1#c> .
+<http://example.org/base2#a> <http://example.org/base2#b> <http://example.org/base2#c> .
+<http://example.org/base1#a> <http://example.org/base2#a> <http://example.org/base3#a> .
diff --git a/tests/tests-ttl/turtle-subm-02.ttl b/tests/tests-ttl/turtle-subm-02.ttl
new file mode 100644
index 00000000..9070d2c4
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-02.ttl
@@ -0,0 +1,7 @@
+# Test @prefix and qnames
+@prefix : <http://example.org/base1#> .
+@prefix a: <http://example.org/base2#> .
+@prefix b: <http://example.org/base3#> .
+:a :b :c .
+a:a a:b a:c .
+:a a:a b:a .
diff --git a/tests/tests-ttl/turtle-subm-03.nt b/tests/tests-ttl/turtle-subm-03.nt
new file mode 100644
index 00000000..99732ab3
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-03.nt
@@ -0,0 +1,3 @@
+<http://example.org/base#a> <http://example.org/base#b> <http://example.org/base#c> .
+<http://example.org/base#a> <http://example.org/base#b> <http://example.org/base#d> .
+<http://example.org/base#a> <http://example.org/base#b> <http://example.org/base#e> .
diff --git a/tests/tests-ttl/turtle-subm-03.ttl b/tests/tests-ttl/turtle-subm-03.ttl
new file mode 100644
index 00000000..a623f3c1
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-03.ttl
@@ -0,0 +1,5 @@
+# Test , operator
+@prefix : <http://example.org/base#> .
+:a :b :c,
+ :d,
+ :e .
diff --git a/tests/tests-ttl/turtle-subm-04.nt b/tests/tests-ttl/turtle-subm-04.nt
new file mode 100644
index 00000000..d6ce9e8f
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-04.nt
@@ -0,0 +1,3 @@
+<http://example.org/base#a> <http://example.org/base#b> <http://example.org/base#c> .
+<http://example.org/base#a> <http://example.org/base#d> <http://example.org/base#e> .
+<http://example.org/base#a> <http://example.org/base#f> <http://example.org/base#g> .
diff --git a/tests/tests-ttl/turtle-subm-04.ttl b/tests/tests-ttl/turtle-subm-04.ttl
new file mode 100644
index 00000000..9179fa50
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-04.ttl
@@ -0,0 +1,5 @@
+# Test ; operator
+@prefix : <http://example.org/base#> .
+:a :b :c ;
+ :d :e ;
+ :f :g .
diff --git a/tests/tests-ttl/turtle-subm-05.nt b/tests/tests-ttl/turtle-subm-05.nt
new file mode 100644
index 00000000..d5d01526
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-05.nt
@@ -0,0 +1,2 @@
+_:b1 <http://example.org/base#a> <http://example.org/base#b> .
+<http://example.org/base#c> <http://example.org/base#d> _:b2 .
diff --git a/tests/tests-ttl/turtle-subm-05.ttl b/tests/tests-ttl/turtle-subm-05.ttl
new file mode 100644
index 00000000..c5181479
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-05.ttl
@@ -0,0 +1,4 @@
+# Test empty [] operator; not allowed as predicate
+@prefix : <http://example.org/base#> .
+[] :a :b .
+:c :d [] .
diff --git a/tests/tests-ttl/turtle-subm-06.nt b/tests/tests-ttl/turtle-subm-06.nt
new file mode 100644
index 00000000..d440197f
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-06.nt
@@ -0,0 +1,4 @@
+_:b1 <http://example.org/base#a> <http://example.org/base#b> .
+_:b1 <http://example.org/base#c> <http://example.org/base#d> .
+<http://example.org/base#e> <http://example.org/base#f> _:b2 .
+_:b2 <http://example.org/base#g> <http://example.org/base#h> .
diff --git a/tests/tests-ttl/turtle-subm-06.ttl b/tests/tests-ttl/turtle-subm-06.ttl
new file mode 100644
index 00000000..adcbcabd
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-06.ttl
@@ -0,0 +1,4 @@
+# Test non empty [] operator; not allowed as predicate
+@prefix : <http://example.org/base#> .
+[ :a :b ] :c :d .
+:e :f [ :g :h ] .
diff --git a/tests/tests-ttl/turtle-subm-07.nt b/tests/tests-ttl/turtle-subm-07.nt
new file mode 100644
index 00000000..49961ea6
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-07.nt
@@ -0,0 +1 @@
+<http://example.org/base#a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/base#b> .
diff --git a/tests/tests-ttl/turtle-subm-07.ttl b/tests/tests-ttl/turtle-subm-07.ttl
new file mode 100644
index 00000000..9c1005cc
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-07.ttl
@@ -0,0 +1,3 @@
+# 'a' only allowed as a predicate
+@prefix : <http://example.org/base#> .
+:a a :b .
diff --git a/tests/tests-ttl/turtle-subm-08.nt b/tests/tests-ttl/turtle-subm-08.nt
new file mode 100644
index 00000000..e62cede5
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-08.nt
@@ -0,0 +1,5 @@
+<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> _:b1 .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "banana" .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/tests-ttl/turtle-subm-08.ttl b/tests/tests-ttl/turtle-subm-08.ttl
new file mode 100644
index 00000000..84559403
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-08.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example.org/stuff/1.0/> .
+:a :b ( "apple" "banana" ) .
+
diff --git a/tests/tests-ttl/turtle-subm-09.nt b/tests/tests-ttl/turtle-subm-09.nt
new file mode 100644
index 00000000..a77939cd
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-09.nt
@@ -0,0 +1 @@
+<http://example.org/stuff/1.0/a> <http://example.org/stuff/1.0/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
diff --git a/tests/tests-ttl/turtle-subm-09.ttl b/tests/tests-ttl/turtle-subm-09.ttl
new file mode 100644
index 00000000..adce0a20
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-09.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example.org/stuff/1.0/> .
+:a :b ( ) .
+
diff --git a/tests/tests-ttl/turtle-subm-10.nt b/tests/tests-ttl/turtle-subm-10.nt
new file mode 100644
index 00000000..c7164085
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-10.nt
@@ -0,0 +1,4 @@
+_:hasParent <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Restriction> .
+_:b1 <http://www.w3.org/2002/07/owl#onProperty> _:hasParent .
+_:b1 <http://www.w3.org/2002/07/owl#maxCardinality> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/tests-ttl/turtle-subm-10.ttl b/tests/tests-ttl/turtle-subm-10.ttl
new file mode 100644
index 00000000..0afe1b0a
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-10.ttl
@@ -0,0 +1,10 @@
+# Test integer datatyped literals using an OWL cardinality constraint
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+# based on examples in the OWL Reference
+
+_:hasParent a owl:ObjectProperty .
+
+[] a owl:Restriction ;
+ owl:onProperty _:hasParent ;
+ owl:maxCardinality 2 .
diff --git a/tests/tests-ttl/turtle-subm-11.nt b/tests/tests-ttl/turtle-subm-11.nt
new file mode 100644
index 00000000..ff88aa6f
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-11.nt
@@ -0,0 +1,5 @@
+<http://example.org/res1> <http://example.org/prop1> "000000"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/res2> <http://example.org/prop2> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/res3> <http://example.org/prop3> "000001"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/res4> <http://example.org/prop4> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/res5> <http://example.org/prop5> "4"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/tests/tests-ttl/turtle-subm-11.ttl b/tests/tests-ttl/turtle-subm-11.ttl
new file mode 100644
index 00000000..5d36360e
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-11.ttl
@@ -0,0 +1,5 @@
+<http://example.org/res1> <http://example.org/prop1> 000000 .
+<http://example.org/res2> <http://example.org/prop2> 0 .
+<http://example.org/res3> <http://example.org/prop3> 000001 .
+<http://example.org/res4> <http://example.org/prop4> 2 .
+<http://example.org/res5> <http://example.org/prop5> 4 .
diff --git a/tests/tests-ttl/turtle-subm-12.nt b/tests/tests-ttl/turtle-subm-12.nt
new file mode 100644
index 00000000..f936a5b6
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-12.nt
@@ -0,0 +1,4 @@
+<http://example.org/ex1#foo-bar> <http://example.org/ex1#foo_bar> "a" .
+<http://example.org/ex2#foo-bar> <http://example.org/ex2#foo_bar> "b" .
+<http://example.org/ex3#foo-bar> <http://example.org/ex3#foo_bar> "c" .
+<http://example.org/ex4#foo-bar> <http://example.org/ex4#foo_bar> "d" .
diff --git a/tests/tests-ttl/turtle-subm-12.ttl b/tests/tests-ttl/turtle-subm-12.ttl
new file mode 100644
index 00000000..3de1a43f
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-12.ttl
@@ -0,0 +1,10 @@
+# Tests for - and _ in names, qnames
+@prefix ex1: <http://example.org/ex1#> .
+@prefix ex-2: <http://example.org/ex2#> .
+@prefix ex3_: <http://example.org/ex3#> .
+@prefix ex4-: <http://example.org/ex4#> .
+
+ex1:foo-bar ex1:foo_bar "a" .
+ex-2:foo-bar ex-2:foo_bar "b" .
+ex3_:foo-bar ex3_:foo_bar "c" .
+ex4-:foo-bar ex4-:foo_bar "d" .
diff --git a/tests/tests-ttl/turtle-subm-13.nt b/tests/tests-ttl/turtle-subm-13.nt
new file mode 100644
index 00000000..67404a59
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-13.nt
@@ -0,0 +1,4 @@
+<http://example.org/ex#foo> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.org/ex#foo> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.org/ex#foo> <http://example.org/myprop#_abc> "def" .
+<http://example.org/ex#foo> <http://example.org/myprop#_345> "678" .
diff --git a/tests/tests-ttl/turtle-subm-13.ttl b/tests/tests-ttl/turtle-subm-13.ttl
new file mode 100644
index 00000000..1fed9f5e
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-13.ttl
@@ -0,0 +1,9 @@
+# Tests for rdf:_<numbers> and other qnames starting with _
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ex: <http://example.org/ex#> .
+@prefix : <http://example.org/myprop#> .
+
+ex:foo rdf:_1 "1" .
+ex:foo rdf:_2 "2" .
+ex:foo :_abc "def" .
+ex:foo :_345 "678" .
diff --git a/tests/tests-ttl/turtle-subm-14.nt b/tests/tests-ttl/turtle-subm-14.nt
new file mode 100644
index 00000000..195a1af7
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-14.nt
@@ -0,0 +1,2 @@
+_:b1 <http://example.org/ron> _:b2 .
+<http://example.org/ron> <http://example.org/ron> <http://example.org/ron> .
diff --git a/tests/tests-ttl/turtle-subm-14.ttl b/tests/tests-ttl/turtle-subm-14.ttl
new file mode 100644
index 00000000..a8be95be
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-14.ttl
@@ -0,0 +1,7 @@
+# Test for : allowed
+@prefix : <http://example.org/ron> .
+
+[] : [] .
+
+: : : .
+
diff --git a/tests/tests-ttl/turtle-subm-15.nt b/tests/tests-ttl/turtle-subm-15.nt
new file mode 100644
index 00000000..466edbb2
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-15.nt
@@ -0,0 +1 @@
+<http://example.org/ex#a> <http://example.org/ex#b> "a long\n\tliteral\nwith\nnewlines" .
diff --git a/tests/tests-ttl/turtle-subm-15.ttl b/tests/tests-ttl/turtle-subm-15.ttl
new file mode 100644
index 00000000..86c453bd
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-15.ttl
@@ -0,0 +1,6 @@
+# Test long literal
+@prefix : <http://example.org/ex#> .
+:a :b """a long
+ literal
+with
+newlines""" .
diff --git a/tests/tests-ttl/turtle-subm-16.nt b/tests/tests-ttl/turtle-subm-16.nt
new file mode 100644
index 00000000..7726bbfc
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-16.nt
@@ -0,0 +1,2 @@
+<http://example.org/foo#a> <http://example.org/foo#b> "\nthis \ris a \U00012451long\t\nliteral\uABCD\n" .
+<http://example.org/foo#d> <http://example.org/foo#e> "\tThis \uABCDis\r \U00012451another\n\none\n" .
diff --git a/tests/tests-ttl/turtle-subm-16.ttl b/tests/tests-ttl/turtle-subm-16.ttl
new file mode 100644
index 00000000..f5482d4a
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-16.ttl
@@ -0,0 +1,20 @@
+@prefix : <http://example.org/foo#> .
+
+## \U00015678 is a not a legal codepoint
+## :a :b """\nthis \ris a \U00015678long\t
+## literal\uABCD
+## """ .
+##
+## :d :e """\tThis \uABCDis\r \U00015678another\n
+## one
+## """ .
+
+# \U00015678 is a not a legal codepoint
+# \U00012451 in Cuneiform numeric ban 3
+:a :b """\nthis \ris a \U00012451long\t
+literal\uABCD
+""" .
+
+:d :e """\tThis \uABCDis\r \U00012451another\n
+one
+""" .
diff --git a/tests/tests-ttl/turtle-subm-17.nt b/tests/tests-ttl/turtle-subm-17.nt
new file mode 100644
index 00000000..2e2dbe40
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-17.nt
@@ -0,0 +1 @@
+<http://example.org/#a> <http://example.org/#b> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
diff --git a/tests/tests-ttl/turtle-subm-17.ttl b/tests/tests-ttl/turtle-subm-17.ttl
new file mode 100644
index 00000000..9de0c07b
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-17.ttl
@@ -0,0 +1,4 @@
+@prefix : <http://example.org/#> .
+
+:a :b 1.0 .
+
diff --git a/tests/tests-ttl/turtle-subm-18.nt b/tests/tests-ttl/turtle-subm-18.nt
new file mode 100644
index 00000000..fff2da56
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-18.nt
@@ -0,0 +1,2 @@
+<http://example.org/#a> <http://example.org/#b> "" .
+<http://example.org/#c> <http://example.org/#d> "" .
diff --git a/tests/tests-ttl/turtle-subm-18.ttl b/tests/tests-ttl/turtle-subm-18.ttl
new file mode 100644
index 00000000..37a9a4f3
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-18.ttl
@@ -0,0 +1,6 @@
+@prefix : <http://example.org/#> .
+
+:a :b "" .
+
+:c :d """""" .
+
diff --git a/tests/tests-ttl/turtle-subm-19.nt b/tests/tests-ttl/turtle-subm-19.nt
new file mode 100644
index 00000000..d5dca690
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-19.nt
@@ -0,0 +1,3 @@
+<http://example.org#a> <http://example.org#b> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org#c> <http://example.org#d> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org#e> <http://example.org#f> "1.0e0"^^<http://www.w3.org/2001/XMLSchema#double> .
diff --git a/tests/tests-ttl/turtle-subm-19.ttl b/tests/tests-ttl/turtle-subm-19.ttl
new file mode 100644
index 00000000..a8e8dc15
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-19.ttl
@@ -0,0 +1,4 @@
+@prefix : <http://example.org#> .
+:a :b 1.0 .
+:c :d 1 .
+:e :f 1.0e0 .
diff --git a/tests/tests-ttl/turtle-subm-20.nt b/tests/tests-ttl/turtle-subm-20.nt
new file mode 100644
index 00000000..3d0f970e
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-20.nt
@@ -0,0 +1,3 @@
+<http://example.org#a> <http://example.org#b> "-1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org#c> <http://example.org#d> "-1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org#e> <http://example.org#f> "-1.0e0"^^<http://www.w3.org/2001/XMLSchema#double> .
diff --git a/tests/tests-ttl/turtle-subm-20.ttl b/tests/tests-ttl/turtle-subm-20.ttl
new file mode 100644
index 00000000..9b1a725a
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-20.ttl
@@ -0,0 +1,4 @@
+@prefix : <http://example.org#> .
+:a :b -1.0 .
+:c :d -1 .
+:e :f -1.0e0 .
diff --git a/tests/tests-ttl/turtle-subm-21.nt b/tests/tests-ttl/turtle-subm-21.nt
new file mode 100644
index 00000000..fde31312
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-21.nt
@@ -0,0 +1 @@
+<http://example.org/ex#a> <http://example.org/ex#b> "John said: \"Hello World!\"" .
diff --git a/tests/tests-ttl/turtle-subm-21.ttl b/tests/tests-ttl/turtle-subm-21.ttl
new file mode 100644
index 00000000..9f5360af
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-21.ttl
@@ -0,0 +1,3 @@
+# Test long literal
+@prefix : <http://example.org/ex#> .
+:a :b """John said: "Hello World!\"""" .
diff --git a/tests/tests-ttl/turtle-subm-22.nt b/tests/tests-ttl/turtle-subm-22.nt
new file mode 100644
index 00000000..5a70bff1
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-22.nt
@@ -0,0 +1,2 @@
+<http://example.org#a> <http://example.org#b> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.org#c> <http://example.org#d> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
diff --git a/tests/tests-ttl/turtle-subm-22.ttl b/tests/tests-ttl/turtle-subm-22.ttl
new file mode 100644
index 00000000..25f3b757
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-22.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example.org#> .
+:a :b true .
+:c :d false .
diff --git a/tests/tests-ttl/turtle-subm-23.nt b/tests/tests-ttl/turtle-subm-23.nt
new file mode 100644
index 00000000..1a38415f
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-23.nt
@@ -0,0 +1,7 @@
+<http://example.org/#a> <http://example.org/#b> <http://example.org/#c> .
+<http://example.org/#d> <http://example.org/#e> <http://example.org/#f> .
+<http://example.org/#g> <http://example.org/#h> <http://example.org/#i> .
+<http://example.org/#g> <http://example.org/#h> <http://example.org/#j> .
+<http://example.org/#k> <http://example.org/#l> <http://example.org/#m> .
+<http://example.org/#k> <http://example.org/#n> <http://example.org/#o> .
+<http://example.org/#k> <http://example.org/#p> <http://example.org/#q> .
diff --git a/tests/tests-ttl/turtle-subm-23.ttl b/tests/tests-ttl/turtle-subm-23.ttl
new file mode 100644
index 00000000..310349da
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-23.ttl
@@ -0,0 +1,14 @@
+# comment test
+@prefix : <http://example.org/#> .
+:a :b :c . # end of line comment
+:d # ignore me
+ :e # and me
+ :f # and me
+ .
+:g :h #ignore me
+ :i, # and me
+ :j . # and me
+
+:k :l :m ; #ignore me
+ :n :o ; # and me
+ :p :q . # and me
diff --git a/tests/tests-ttl/turtle-subm-24.nt b/tests/tests-ttl/turtle-subm-24.nt
new file mode 100644
index 00000000..ad105cf4
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-24.nt
@@ -0,0 +1 @@
+<http://example.org/#a> <http://example.org/#b> <http://example.org/#c> .
diff --git a/tests/tests-ttl/turtle-subm-24.ttl b/tests/tests-ttl/turtle-subm-24.ttl
new file mode 100644
index 00000000..0667c6b4
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-24.ttl
@@ -0,0 +1,4 @@
+# comment line with no final newline test
+@prefix : <http://example.org/#> .
+:a :b :c .
+#foo
diff --git a/tests/tests-ttl/turtle-subm-25.nt b/tests/tests-ttl/turtle-subm-25.nt
new file mode 100644
index 00000000..7da0635b
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-25.nt
@@ -0,0 +1 @@
+<http://example.org/bar#blah> <http://example.org/bar#blah> <http://example.org/bar#blah> .
diff --git a/tests/tests-ttl/turtle-subm-25.ttl b/tests/tests-ttl/turtle-subm-25.ttl
new file mode 100644
index 00000000..569023c8
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-25.ttl
@@ -0,0 +1,5 @@
+@prefix foo: <http://example.org/foo#> .
+@prefix foo: <http://example.org/bar#> .
+
+foo:blah foo:blah foo:blah .
+
diff --git a/tests/tests-ttl/turtle-subm-26.nt b/tests/tests-ttl/turtle-subm-26.nt
new file mode 100644
index 00000000..7357dd40
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-26.nt
@@ -0,0 +1,22 @@
+<http://example.org/foo> <http://example.org/bar> "2.345"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1."^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1.000000000"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.3"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1.2345678901234567890123457890"^^<http://www.w3.org/2001/XMLSchema#decimal> .
diff --git a/tests/tests-ttl/turtle-subm-26.ttl b/tests/tests-ttl/turtle-subm-26.ttl
new file mode 100644
index 00000000..7357dd40
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-26.ttl
@@ -0,0 +1,22 @@
+<http://example.org/foo> <http://example.org/bar> "2.345"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1."^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1.000000000"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.3"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.234000000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.2340000000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "2.23400000000000000000005"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.org/foo> <http://example.org/bar> "1.2345678901234567890123457890"^^<http://www.w3.org/2001/XMLSchema#decimal> .
diff --git a/tests/tests-ttl/turtle-subm-27.nt b/tests/tests-ttl/turtle-subm-27.nt
new file mode 100644
index 00000000..c7f5baf4
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-27.nt
@@ -0,0 +1,5 @@
+<http://example/base/a1> <http://example/base/b1> <http://example/base/c1> .
+<http://example.org/ns/a2> <http://example.org/ns/b2> <http://example.org/ns/c2> .
+<http://example.org/ns/foo/a3> <http://example.org/ns/foo/b3> <http://example.org/ns/foo/c3> .
+<http://example.org/ns/foo/bar#a4> <http://example.org/ns/foo/bar#b4> <http://example.org/ns/foo/bar#c4> .
+<http://example.org/ns2#a5> <http://example.org/ns2#b5> <http://example.org/ns2#c5> .
diff --git a/tests/tests-ttl/turtle-subm-27.ttl b/tests/tests-ttl/turtle-subm-27.ttl
new file mode 100644
index 00000000..6721ec24
--- /dev/null
+++ b/tests/tests-ttl/turtle-subm-27.ttl
@@ -0,0 +1,12 @@
+# In-scope base URI is http://www.w3.org/2001/sw/DataAccess/df1/tests/ at this point
+<a1> <b1> <c1> .
+@base <http://example.org/ns/> .
+# In-scope base URI is http://example.org/ns/ at this point
+<a2> <http://example.org/ns/b2> <c2> .
+@base <foo/> .
+# In-scope base URI is http://example.org/ns/foo/ at this point
+<a3> <b3> <c3> .
+@prefix : <bar#> .
+:a4 :b4 :c4 .
+@prefix : <http://example.org/ns2#> .
+:a5 :b5 :c5 .
diff --git a/tests/tests-ttl/turtle-syntax-bad-base-01.ttl b/tests/tests-ttl/turtle-syntax-bad-base-01.ttl
new file mode 100644
index 00000000..7b0412f8
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-base-01.ttl
@@ -0,0 +1,2 @@
+# @base without URI.
+@base .
diff --git a/tests/tests-ttl/turtle-syntax-bad-base-02.ttl b/tests/tests-ttl/turtle-syntax-bad-base-02.ttl
new file mode 100644
index 00000000..1b2e4845
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-base-02.ttl
@@ -0,0 +1,2 @@
+# @base in wrong case.
+@BASE <http://example/> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-base-03.ttl b/tests/tests-ttl/turtle-syntax-bad-base-03.ttl
new file mode 100644
index 00000000..b5ef61dd
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-base-03.ttl
@@ -0,0 +1,3 @@
+# @base without URI.
+BASE <http://example/> .
+<s> <p> <o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-esc-01.ttl b/tests/tests-ttl/turtle-syntax-bad-esc-01.ttl
new file mode 100644
index 00000000..f7a88add
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-esc-01.ttl
@@ -0,0 +1,2 @@
+# Bad string escape
+<http://example/s> <http://example/p> "a\zb" .
diff --git a/tests/tests-ttl/turtle-syntax-bad-esc-02.ttl b/tests/tests-ttl/turtle-syntax-bad-esc-02.ttl
new file mode 100644
index 00000000..72711d49
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-esc-02.ttl
@@ -0,0 +1,2 @@
+# Bad string escape
+<http://example/s> <http://example/p> "\uWXYZ" .
diff --git a/tests/tests-ttl/turtle-syntax-bad-esc-03.ttl b/tests/tests-ttl/turtle-syntax-bad-esc-03.ttl
new file mode 100644
index 00000000..3a4522fc
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-esc-03.ttl
@@ -0,0 +1,2 @@
+# Bad string escape
+<http://example/s> <http://example/p> "\U0000WXYZ" .
diff --git a/tests/tests-ttl/turtle-syntax-bad-esc-04.ttl b/tests/tests-ttl/turtle-syntax-bad-esc-04.ttl
new file mode 100644
index 00000000..3a4522fc
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-esc-04.ttl
@@ -0,0 +1,2 @@
+# Bad string escape
+<http://example/s> <http://example/p> "\U0000WXYZ" .
diff --git a/tests/tests-ttl/turtle-syntax-bad-kw-01.ttl b/tests/tests-ttl/turtle-syntax-bad-kw-01.ttl
new file mode 100644
index 00000000..f2e3927f
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-kw-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s A :C .
diff --git a/tests/tests-ttl/turtle-syntax-bad-kw-02.ttl b/tests/tests-ttl/turtle-syntax-bad-kw-02.ttl
new file mode 100644
index 00000000..ab5bf1e7
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-kw-02.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+a :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-kw-03.ttl b/tests/tests-ttl/turtle-syntax-bad-kw-03.ttl
new file mode 100644
index 00000000..1be7e34a
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-kw-03.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p a .
diff --git a/tests/tests-ttl/turtle-syntax-bad-kw-04.ttl b/tests/tests-ttl/turtle-syntax-bad-kw-04.ttl
new file mode 100644
index 00000000..11cb50b5
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-kw-04.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+true :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-kw-05.ttl b/tests/tests-ttl/turtle-syntax-bad-kw-05.ttl
new file mode 100644
index 00000000..12e3a4cb
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-kw-05.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s true :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-lang-01.ttl b/tests/tests-ttl/turtle-syntax-bad-lang-01.ttl
new file mode 100644
index 00000000..a4d952c8
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-lang-01.ttl
@@ -0,0 +1,2 @@
+# Bad lang tag
+<http://example/s> <http://example/p> "string"@1 .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-01.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-01.ttl
new file mode 100644
index 00000000..7a429acd
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-01.ttl
@@ -0,0 +1,5 @@
+# {} fomulae not in Turtle
+@prefix : <http://example/> .
+
+{ :a :q :c . } :p :z .
+
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-02.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-02.ttl
new file mode 100644
index 00000000..510cd226
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-02.ttl
@@ -0,0 +1,4 @@
+# = is not Turtle
+@prefix : <http://example/> .
+
+:a = :b .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-03.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-03.ttl
new file mode 100644
index 00000000..1f7e0df1
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-03.ttl
@@ -0,0 +1,7 @@
+# N3 paths
+@prefix : <http://example/> .
+@prefix ns: <http://example/p#> .
+
+:x.
+ ns:p.
+ ns:q :p :z .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-04.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-04.ttl
new file mode 100644
index 00000000..151db2da
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-04.ttl
@@ -0,0 +1,5 @@
+# N3 paths
+@prefix : <http://example/> .
+@prefix ns: <http://example/p#> .
+
+:x^ns:p :p :z .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-05.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-05.ttl
new file mode 100644
index 00000000..76d03261
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-05.ttl
@@ -0,0 +1,4 @@
+# N3 is...of
+@prefix : <http://example/> .
+
+:z is :p of :x .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-06.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-06.ttl
new file mode 100644
index 00000000..12bdd9ef
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-06.ttl
@@ -0,0 +1,4 @@
+# = is not Turtle
+@prefix : <http://example/> .
+
+:a.:b.:c .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-07.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-07.ttl
new file mode 100644
index 00000000..419f7cad
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-07.ttl
@@ -0,0 +1,3 @@
+# @keywords is not Turtle
+@keywords a .
+x a Item .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-08.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-08.ttl
new file mode 100644
index 00000000..419f7cad
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-08.ttl
@@ -0,0 +1,3 @@
+# @keywords is not Turtle
+@keywords a .
+x a Item .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-09.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-09.ttl
new file mode 100644
index 00000000..390ef6d2
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-09.ttl
@@ -0,0 +1,3 @@
+# => is not Turtle
+@prefix : <http://example/> .
+:s => :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-10.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-10.ttl
new file mode 100644
index 00000000..efef5f6b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-10.ttl
@@ -0,0 +1,3 @@
+# <= is not Turtle
+@prefix : <http://example/> .
+:s <= :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-11.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-11.ttl
new file mode 100644
index 00000000..dabadf02
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-11.ttl
@@ -0,0 +1,3 @@
+# @forSome is not Turtle
+@prefix : <http://example/> .
+@forSome :x .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-12.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-12.ttl
new file mode 100644
index 00000000..5a6c3562
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-12.ttl
@@ -0,0 +1,3 @@
+# @forAll is not Turtle
+@prefix : <http://example/> .
+@forAll :x .
diff --git a/tests/tests-ttl/turtle-syntax-bad-n3-extras-13.ttl b/tests/tests-ttl/turtle-syntax-bad-n3-extras-13.ttl
new file mode 100644
index 00000000..5f719a24
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-n3-extras-13.ttl
@@ -0,0 +1,3 @@
+# @keywords is not Turtle
+@keywords .
+x @a Item .
diff --git a/tests/tests-ttl/turtle-syntax-bad-num-01.ttl b/tests/tests-ttl/turtle-syntax-bad-num-01.ttl
new file mode 100644
index 00000000..817809f6
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-num-01.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 123.abc .
diff --git a/tests/tests-ttl/turtle-syntax-bad-num-02.ttl b/tests/tests-ttl/turtle-syntax-bad-num-02.ttl
new file mode 100644
index 00000000..dca36d2b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-num-02.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 123e .
diff --git a/tests/tests-ttl/turtle-syntax-bad-num-03.ttl b/tests/tests-ttl/turtle-syntax-bad-num-03.ttl
new file mode 100644
index 00000000..e9ea90c9
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-num-03.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 123abc .
diff --git a/tests/tests-ttl/turtle-syntax-bad-num-04.ttl b/tests/tests-ttl/turtle-syntax-bad-num-04.ttl
new file mode 100644
index 00000000..363755f0
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-num-04.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 0x123 .
diff --git a/tests/tests-ttl/turtle-syntax-bad-num-05.ttl b/tests/tests-ttl/turtle-syntax-bad-num-05.ttl
new file mode 100644
index 00000000..d8fab1ab
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-num-05.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> +-1 .
diff --git a/tests/tests-ttl/turtle-syntax-bad-pname-01.ttl b/tests/tests-ttl/turtle-syntax-bad-pname-01.ttl
new file mode 100644
index 00000000..90e42197
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-pname-01.ttl
@@ -0,0 +1,3 @@
+# ~ must be escaped.
+@prefix : <http://example/> .
+:a~b :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-pname-02.ttl b/tests/tests-ttl/turtle-syntax-bad-pname-02.ttl
new file mode 100644
index 00000000..ff3e35c8
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-pname-02.ttl
@@ -0,0 +1,3 @@
+# Bad %-sequence
+@prefix : <http://example/> .
+:a%2 :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-pname-03.ttl b/tests/tests-ttl/turtle-syntax-bad-pname-03.ttl
new file mode 100644
index 00000000..cb358bd0
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-pname-03.ttl
@@ -0,0 +1,3 @@
+# No \u (x39 is "9")
+@prefix : <http://example/> .
+:a\u0039 :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bad-prefix-01.ttl b/tests/tests-ttl/turtle-syntax-bad-prefix-01.ttl
new file mode 100644
index 00000000..97021d96
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-prefix-01.ttl
@@ -0,0 +1,2 @@
+# No prefix
+:s <http://example/p> "x" .
diff --git a/tests/tests-ttl/turtle-syntax-bad-prefix-02.ttl b/tests/tests-ttl/turtle-syntax-bad-prefix-02.ttl
new file mode 100644
index 00000000..69271456
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-prefix-02.ttl
@@ -0,0 +1,3 @@
+# No prefix
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+<http://example/s> rdf:type :C .
diff --git a/tests/tests-ttl/turtle-syntax-bad-prefix-03.ttl b/tests/tests-ttl/turtle-syntax-bad-prefix-03.ttl
new file mode 100644
index 00000000..1ab01e7b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-prefix-03.ttl
@@ -0,0 +1,2 @@
+# @prefix without URI.
+@prefix ex: .
diff --git a/tests/tests-ttl/turtle-syntax-bad-prefix-04.ttl b/tests/tests-ttl/turtle-syntax-bad-prefix-04.ttl
new file mode 100644
index 00000000..dbbda05b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-prefix-04.ttl
@@ -0,0 +1,2 @@
+# @prefix without prefix name .
+@prefix <http://example/> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-prefix-05.ttl b/tests/tests-ttl/turtle-syntax-bad-prefix-05.ttl
new file mode 100644
index 00000000..6d145e07
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-prefix-05.ttl
@@ -0,0 +1,2 @@
+# @prefix without :
+@prefix x <http://example/> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-01.ttl b/tests/tests-ttl/turtle-syntax-bad-string-01.ttl
new file mode 100644
index 00000000..7e8da141
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p "abc' .
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-02.ttl b/tests/tests-ttl/turtle-syntax-bad-string-02.ttl
new file mode 100644
index 00000000..d2866d25
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-02.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p 'abc" .
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-03.ttl b/tests/tests-ttl/turtle-syntax-bad-string-03.ttl
new file mode 100644
index 00000000..610446b2
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-03.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p '''abc' .
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-04.ttl b/tests/tests-ttl/turtle-syntax-bad-string-04.ttl
new file mode 100644
index 00000000..6643614c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-04.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p """abc''' .
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-05.ttl b/tests/tests-ttl/turtle-syntax-bad-string-05.ttl
new file mode 100644
index 00000000..e25a4927
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-05.ttl
@@ -0,0 +1,4 @@
+# Long literal with missing end
+@prefix : <http://example/> .
+:s :p """abc
+def
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-06.ttl b/tests/tests-ttl/turtle-syntax-bad-string-06.ttl
new file mode 100644
index 00000000..2c717b5e
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-06.ttl
@@ -0,0 +1,3 @@
+# Long literal with 4"
+@prefix : <http://example/> .
+:s :p """abc""""@en .
diff --git a/tests/tests-ttl/turtle-syntax-bad-string-07.ttl b/tests/tests-ttl/turtle-syntax-bad-string-07.ttl
new file mode 100644
index 00000000..ce6f7a7d
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-string-07.ttl
@@ -0,0 +1,3 @@
+# Long literal with 4'
+@prefix : <http://example/> .
+:s :p '''abc''''@en .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-01.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-01.ttl
new file mode 100644
index 00000000..7594edc4
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-01.ttl
@@ -0,0 +1,2 @@
+# Turtle is not TriG
+{ <http://example/s> <http://example/p> <http://example/o> }
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-02.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-02.ttl
new file mode 100644
index 00000000..e447c376
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-02.ttl
@@ -0,0 +1,2 @@
+# Turtle is not N3
+<http://example/s> = <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-03.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-03.ttl
new file mode 100644
index 00000000..76d57aee
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-03.ttl
@@ -0,0 +1,2 @@
+# Turtle is not NQuads
+<http://example/s> <http://example/p> <http://example/o> <http://example/g> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-04.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-04.ttl
new file mode 100644
index 00000000..6c675a0c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-04.ttl
@@ -0,0 +1,2 @@
+# Turtle does not allow literals-as-subjects
+"hello" <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-05.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-05.ttl
new file mode 100644
index 00000000..c7a3552d
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-05.ttl
@@ -0,0 +1,2 @@
+# Turtle does not allow literals-as-predicates
+<http://example/s> "hello" <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-06.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-06.ttl
new file mode 100644
index 00000000..dd663288
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-06.ttl
@@ -0,0 +1,2 @@
+# Turtle does not allow bnodes-as-predicates
+<http://example/s> [] <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-07.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-07.ttl
new file mode 100644
index 00000000..c1e4aa7c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-07.ttl
@@ -0,0 +1,2 @@
+# Turtle does not allow bnodes-as-predicates
+<http://example/s> _:p <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-08.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-08.ttl
new file mode 100644
index 00000000..5449ad93
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-08.ttl
@@ -0,0 +1,2 @@
+# No DOT
+<http://example/s> <http://example/p> <http://example/o>
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-09.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-09.ttl
new file mode 100644
index 00000000..33159c97
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-09.ttl
@@ -0,0 +1,2 @@
+# Too many DOT
+<http://example/s> <http://example/p> <http://example/o> . .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-10.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-10.ttl
new file mode 100644
index 00000000..8fcc7fea
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-10.ttl
@@ -0,0 +1,3 @@
+# Too many DOT
+<http://example/s> <http://example/p> <http://example/o> . .
+<http://example/s1> <http://example/p1> <http://example/o1> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-11.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-11.ttl
new file mode 100644
index 00000000..2351eb87
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-11.ttl
@@ -0,0 +1,2 @@
+# Trailing ;
+<http://example/s> <http://example/p> <http://example/o> ;
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-12.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-12.ttl
new file mode 100644
index 00000000..b11d7f53
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-12.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p>
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-13.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-13.ttl
new file mode 100644
index 00000000..b11d7f53
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-13.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p>
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-14.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-14.ttl
new file mode 100644
index 00000000..039f96d4
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-14.ttl
@@ -0,0 +1,2 @@
+# Literal as subject
+"abc" <http://example/p> <http://example/p> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-15.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-15.ttl
new file mode 100644
index 00000000..c3b147ca
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-15.ttl
@@ -0,0 +1,2 @@
+# Literal as predicate
+<http://example/s> "abc" <http://example/p> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-16.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-16.ttl
new file mode 100644
index 00000000..f8621e9c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-16.ttl
@@ -0,0 +1,2 @@
+# BNode as predicate
+<http://example/s> [] <http://example/p> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-struct-17.ttl b/tests/tests-ttl/turtle-syntax-bad-struct-17.ttl
new file mode 100644
index 00000000..194c0f0e
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-struct-17.ttl
@@ -0,0 +1,2 @@
+# BNode as predicate
+<http://example/s> _:a <http://example/p> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-uri-01.ttl b/tests/tests-ttl/turtle-syntax-bad-uri-01.ttl
new file mode 100644
index 00000000..0e69dc0c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-uri-01.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : space.
+<http://example/ space> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-uri-02.ttl b/tests/tests-ttl/turtle-syntax-bad-uri-02.ttl
new file mode 100644
index 00000000..36d91af9
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-uri-02.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : bad escape
+<http://example/\u00ZZ11> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-uri-03.ttl b/tests/tests-ttl/turtle-syntax-bad-uri-03.ttl
new file mode 100644
index 00000000..f512345f
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-uri-03.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : bad escape
+<http://example/\U00ZZ1111> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-uri-04.ttl b/tests/tests-ttl/turtle-syntax-bad-uri-04.ttl
new file mode 100644
index 00000000..5cab062c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-uri-04.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : character escapes not allowed.
+<http://example/\n> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-bad-uri-05.ttl b/tests/tests-ttl/turtle-syntax-bad-uri-05.ttl
new file mode 100644
index 00000000..be0a21e0
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bad-uri-05.ttl
@@ -0,0 +1,2 @@
+# Bad IRI : character escapes not allowed.
+<http://example/\/> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-base-01.ttl b/tests/tests-ttl/turtle-syntax-base-01.ttl
new file mode 100644
index 00000000..dff1b3b4
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-base-01.ttl
@@ -0,0 +1 @@
+@base <http://example/> .
diff --git a/tests/tests-ttl/turtle-syntax-base-02.ttl b/tests/tests-ttl/turtle-syntax-base-02.ttl
new file mode 100644
index 00000000..04f1bfdb
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-base-02.ttl
@@ -0,0 +1 @@
+BASE <http://example/>
diff --git a/tests/tests-ttl/turtle-syntax-base-03.ttl b/tests/tests-ttl/turtle-syntax-base-03.ttl
new file mode 100644
index 00000000..19414dd0
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-base-03.ttl
@@ -0,0 +1,2 @@
+@base <http://example/> .
+<s> <p> <o> .
diff --git a/tests/tests-ttl/turtle-syntax-base-04.ttl b/tests/tests-ttl/turtle-syntax-base-04.ttl
new file mode 100644
index 00000000..f9f136dc
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-base-04.ttl
@@ -0,0 +1,2 @@
+base <http://example/>
+<s> <p> <o> .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-01.ttl b/tests/tests-ttl/turtle-syntax-bnode-01.ttl
new file mode 100644
index 00000000..2d0a548a
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+[] :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-02.ttl b/tests/tests-ttl/turtle-syntax-bnode-02.ttl
new file mode 100644
index 00000000..8d681582
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-02.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p [] .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-03.ttl b/tests/tests-ttl/turtle-syntax-bnode-03.ttl
new file mode 100644
index 00000000..58719441
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-03.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p [ :q :o ] .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-04.ttl b/tests/tests-ttl/turtle-syntax-bnode-04.ttl
new file mode 100644
index 00000000..09f096d1
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-04.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p [ :q1 :o1 ; :q2 :o2 ] .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-05.ttl b/tests/tests-ttl/turtle-syntax-bnode-05.ttl
new file mode 100644
index 00000000..6eec0b5f
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-05.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+[ :q1 :o1 ; :q2 :o2 ] :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-06.ttl b/tests/tests-ttl/turtle-syntax-bnode-06.ttl
new file mode 100644
index 00000000..a930b24c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-06.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+_:a :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-07.ttl b/tests/tests-ttl/turtle-syntax-bnode-07.ttl
new file mode 100644
index 00000000..19462a69
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-07.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example/> .
+:s :p _:a .
+_:a :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-08.ttl b/tests/tests-ttl/turtle-syntax-bnode-08.ttl
new file mode 100644
index 00000000..e379819d
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-08.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+[ :p :o ] .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-09.ttl b/tests/tests-ttl/turtle-syntax-bnode-09.ttl
new file mode 100644
index 00000000..568be4e3
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-09.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example/> .
+[ :p :o1,:2 ] .
+:s :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-bnode-10.ttl b/tests/tests-ttl/turtle-syntax-bnode-10.ttl
new file mode 100644
index 00000000..9d1ba060
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-bnode-10.ttl
@@ -0,0 +1,5 @@
+@prefix : <http://example/> .
+
+:s1 :p :o .
+[ :p1 :o1 ; :p2 :o2 ] .
+:s2 :p :o .
diff --git a/tests/tests-ttl/turtle-syntax-datatypes-01.ttl b/tests/tests-ttl/turtle-syntax-datatypes-01.ttl
new file mode 100644
index 00000000..9e273c51
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-datatypes-01.ttl
@@ -0,0 +1,2 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+<s> <p> "123"^^xsd:byte .
diff --git a/tests/tests-ttl/turtle-syntax-datatypes-02.ttl b/tests/tests-ttl/turtle-syntax-datatypes-02.ttl
new file mode 100644
index 00000000..477bd73c
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-datatypes-02.ttl
@@ -0,0 +1,3 @@
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+<s> <p> "123"^^xsd:string .
diff --git a/tests/tests-ttl/turtle-syntax-file-01.ttl b/tests/tests-ttl/turtle-syntax-file-01.ttl
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-file-01.ttl
diff --git a/tests/tests-ttl/turtle-syntax-file-02.ttl b/tests/tests-ttl/turtle-syntax-file-02.ttl
new file mode 100644
index 00000000..e6d327d5
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-file-02.ttl
@@ -0,0 +1 @@
+#Empty file.
diff --git a/tests/tests-ttl/turtle-syntax-file-03.ttl b/tests/tests-ttl/turtle-syntax-file-03.ttl
new file mode 100644
index 00000000..a9ca0358
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-file-03.ttl
@@ -0,0 +1,2 @@
+#One comment, one empty line.
+
diff --git a/tests/tests-ttl/turtle-syntax-kw-01.ttl b/tests/tests-ttl/turtle-syntax-kw-01.ttl
new file mode 100644
index 00000000..854c7568
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-kw-01.ttl
@@ -0,0 +1 @@
+<s> <p> true .
diff --git a/tests/tests-ttl/turtle-syntax-kw-02.ttl b/tests/tests-ttl/turtle-syntax-kw-02.ttl
new file mode 100644
index 00000000..c948160b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-kw-02.ttl
@@ -0,0 +1 @@
+<s> <p> false .
diff --git a/tests/tests-ttl/turtle-syntax-kw-03.ttl b/tests/tests-ttl/turtle-syntax-kw-03.ttl
new file mode 100644
index 00000000..ca35f7a5
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-kw-03.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s a :C .
diff --git a/tests/tests-ttl/turtle-syntax-lists-01.ttl b/tests/tests-ttl/turtle-syntax-lists-01.ttl
new file mode 100644
index 00000000..438a4711
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-lists-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p () .
diff --git a/tests/tests-ttl/turtle-syntax-lists-02.ttl b/tests/tests-ttl/turtle-syntax-lists-02.ttl
new file mode 100644
index 00000000..20ddd626
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-lists-02.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p (1 "2" :o) .
diff --git a/tests/tests-ttl/turtle-syntax-lists-03.ttl b/tests/tests-ttl/turtle-syntax-lists-03.ttl
new file mode 100644
index 00000000..5656dca3
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-lists-03.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+(1) :p (1) .
diff --git a/tests/tests-ttl/turtle-syntax-lists-04.ttl b/tests/tests-ttl/turtle-syntax-lists-04.ttl
new file mode 100644
index 00000000..2adee236
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-lists-04.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+(()) :p (()) .
diff --git a/tests/tests-ttl/turtle-syntax-lists-05.ttl b/tests/tests-ttl/turtle-syntax-lists-05.ttl
new file mode 100644
index 00000000..84f6e722
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-lists-05.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+(1 2 (1 2)) :p (( "a") "b" :o) .
diff --git a/tests/tests-ttl/turtle-syntax-number-01.ttl b/tests/tests-ttl/turtle-syntax-number-01.ttl
new file mode 100644
index 00000000..016fa8f2
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-01.ttl
@@ -0,0 +1 @@
+<s> <p> 123 .
diff --git a/tests/tests-ttl/turtle-syntax-number-02.ttl b/tests/tests-ttl/turtle-syntax-number-02.ttl
new file mode 100644
index 00000000..66d1b389
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-02.ttl
@@ -0,0 +1 @@
+<s> <p> -123 .
diff --git a/tests/tests-ttl/turtle-syntax-number-03.ttl b/tests/tests-ttl/turtle-syntax-number-03.ttl
new file mode 100644
index 00000000..44142857
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-03.ttl
@@ -0,0 +1 @@
+<s> <p> +123 .
diff --git a/tests/tests-ttl/turtle-syntax-number-04.ttl b/tests/tests-ttl/turtle-syntax-number-04.ttl
new file mode 100644
index 00000000..ab48cbc6
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-04.ttl
@@ -0,0 +1,2 @@
+# This is a decimal.
+<s> <p> 123.0 .
diff --git a/tests/tests-ttl/turtle-syntax-number-05.ttl b/tests/tests-ttl/turtle-syntax-number-05.ttl
new file mode 100644
index 00000000..a8d5845a
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-05.ttl
@@ -0,0 +1,2 @@
+# This is a decimal.
+<s> <p> .1 .
diff --git a/tests/tests-ttl/turtle-syntax-number-06.ttl b/tests/tests-ttl/turtle-syntax-number-06.ttl
new file mode 100644
index 00000000..cb3a2b06
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-06.ttl
@@ -0,0 +1,2 @@
+# This is a decimal.
+<s> <p> -123.0 .
diff --git a/tests/tests-ttl/turtle-syntax-number-07.ttl b/tests/tests-ttl/turtle-syntax-number-07.ttl
new file mode 100644
index 00000000..8b0050e6
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-07.ttl
@@ -0,0 +1,2 @@
+# This is a decimal.
+<s> <p> +123.0 .
diff --git a/tests/tests-ttl/turtle-syntax-number-08.ttl b/tests/tests-ttl/turtle-syntax-number-08.ttl
new file mode 100644
index 00000000..70ddeed3
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-08.ttl
@@ -0,0 +1,2 @@
+# This is an integer
+<s> <p> 123.
diff --git a/tests/tests-ttl/turtle-syntax-number-09.ttl b/tests/tests-ttl/turtle-syntax-number-09.ttl
new file mode 100644
index 00000000..386b819f
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-09.ttl
@@ -0,0 +1 @@
+<s> <p> 123.0e1 .
diff --git a/tests/tests-ttl/turtle-syntax-number-10.ttl b/tests/tests-ttl/turtle-syntax-number-10.ttl
new file mode 100644
index 00000000..46875e94
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-10.ttl
@@ -0,0 +1 @@
+<s> <p> -123e-1 .
diff --git a/tests/tests-ttl/turtle-syntax-number-11.ttl b/tests/tests-ttl/turtle-syntax-number-11.ttl
new file mode 100644
index 00000000..1d8c367e
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-number-11.ttl
@@ -0,0 +1 @@
+<s> <p> 123.E+1 .
diff --git a/tests/tests-ttl/turtle-syntax-pname-esc-01.ttl b/tests/tests-ttl/turtle-syntax-pname-esc-01.ttl
new file mode 100644
index 00000000..46f3b3d9
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-pname-esc-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p :\~\.\-\!\$\&\'\(\)\*\+\,\;\=\/\?\#\@\_\%AA .
diff --git a/tests/tests-ttl/turtle-syntax-pname-esc-02.ttl b/tests/tests-ttl/turtle-syntax-pname-esc-02.ttl
new file mode 100644
index 00000000..518feb67
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-pname-esc-02.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p :0123\~\.\-\!\$\&\'\(\)\*\+\,\;\=\/\?\#\@\_\%AA123 .
diff --git a/tests/tests-ttl/turtle-syntax-pname-esc-03.ttl b/tests/tests-ttl/turtle-syntax-pname-esc-03.ttl
new file mode 100644
index 00000000..e259f345
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-pname-esc-03.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:xyz\~ :abc\.: : .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-01.ttl b/tests/tests-ttl/turtle-syntax-prefix-01.ttl
new file mode 100644
index 00000000..89e08cc7
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-01.ttl
@@ -0,0 +1 @@
+@prefix : <http://example/> .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-02.ttl b/tests/tests-ttl/turtle-syntax-prefix-02.ttl
new file mode 100644
index 00000000..5869e8bd
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-02.ttl
@@ -0,0 +1 @@
+PreFIX : <http://example/>
diff --git a/tests/tests-ttl/turtle-syntax-prefix-03.ttl b/tests/tests-ttl/turtle-syntax-prefix-03.ttl
new file mode 100644
index 00000000..f9c0a3f3
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-03.ttl
@@ -0,0 +1,2 @@
+PREFIX : <http://example/>
+:s :p :123 .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-04.ttl b/tests/tests-ttl/turtle-syntax-prefix-04.ttl
new file mode 100644
index 00000000..3d1b4097
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-04.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p :%20 .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-05.ttl b/tests/tests-ttl/turtle-syntax-prefix-05.ttl
new file mode 100644
index 00000000..36b46fcc
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-05.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+: : : .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-06.ttl b/tests/tests-ttl/turtle-syntax-prefix-06.ttl
new file mode 100644
index 00000000..eb21c253
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-06.ttl
@@ -0,0 +1,4 @@
+# colon is a legal pname character
+@prefix : <http://example/> .
+@prefix x: <http://example/> .
+:a:b:c x:d:e:f :::: .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-07.ttl b/tests/tests-ttl/turtle-syntax-prefix-07.ttl
new file mode 100644
index 00000000..bb498d91
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-07.ttl
@@ -0,0 +1,3 @@
+# dash is a legal pname character
+@prefix x: <http://example/> .
+x:a-b-c x:p x:o .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-08.ttl b/tests/tests-ttl/turtle-syntax-prefix-08.ttl
new file mode 100644
index 00000000..e5ecff2b
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-08.ttl
@@ -0,0 +1,3 @@
+# underscore is a legal pname character
+@prefix x: <http://example/> .
+x:_ x:p_1 x:o .
diff --git a/tests/tests-ttl/turtle-syntax-prefix-09.ttl b/tests/tests-ttl/turtle-syntax-prefix-09.ttl
new file mode 100644
index 00000000..6f6345e1
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-prefix-09.ttl
@@ -0,0 +1,4 @@
+# percents
+@prefix : <http://example/> .
+@prefix x: <http://example/> .
+:a%3E x:%25 :a%3Eb .
diff --git a/tests/tests-ttl/turtle-syntax-str-esc-01.ttl b/tests/tests-ttl/turtle-syntax-str-esc-01.ttl
new file mode 100644
index 00000000..3925f2ec
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-str-esc-01.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> "a\n" .
diff --git a/tests/tests-ttl/turtle-syntax-str-esc-02.ttl b/tests/tests-ttl/turtle-syntax-str-esc-02.ttl
new file mode 100644
index 00000000..e7d032f0
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-str-esc-02.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> "a\u0020b" .
diff --git a/tests/tests-ttl/turtle-syntax-str-esc-03.ttl b/tests/tests-ttl/turtle-syntax-str-esc-03.ttl
new file mode 100644
index 00000000..b8588c79
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-str-esc-03.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> "a\U00000020b" .
diff --git a/tests/tests-ttl/turtle-syntax-string-01.ttl b/tests/tests-ttl/turtle-syntax-string-01.ttl
new file mode 100644
index 00000000..5333aefe
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-01.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> "string" .
diff --git a/tests/tests-ttl/turtle-syntax-string-02.ttl b/tests/tests-ttl/turtle-syntax-string-02.ttl
new file mode 100644
index 00000000..1ab55a33
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-02.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> "string"@en .
diff --git a/tests/tests-ttl/turtle-syntax-string-03.ttl b/tests/tests-ttl/turtle-syntax-string-03.ttl
new file mode 100644
index 00000000..b34ca0f6
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-03.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> "string"@en-uk .
diff --git a/tests/tests-ttl/turtle-syntax-string-04.ttl b/tests/tests-ttl/turtle-syntax-string-04.ttl
new file mode 100644
index 00000000..09ebaa1f
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-04.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 'string' .
diff --git a/tests/tests-ttl/turtle-syntax-string-05.ttl b/tests/tests-ttl/turtle-syntax-string-05.ttl
new file mode 100644
index 00000000..b7d3978d
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-05.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 'string'@en .
diff --git a/tests/tests-ttl/turtle-syntax-string-06.ttl b/tests/tests-ttl/turtle-syntax-string-06.ttl
new file mode 100644
index 00000000..da99bc28
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-06.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> 'string'@en-uk .
diff --git a/tests/tests-ttl/turtle-syntax-string-07.ttl b/tests/tests-ttl/turtle-syntax-string-07.ttl
new file mode 100644
index 00000000..b848eead
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-07.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> """abc""def''ghi""" .
diff --git a/tests/tests-ttl/turtle-syntax-string-08.ttl b/tests/tests-ttl/turtle-syntax-string-08.ttl
new file mode 100644
index 00000000..c7376d44
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-08.ttl
@@ -0,0 +1,2 @@
+<http://example/s> <http://example/p> """abc
+def""" .
diff --git a/tests/tests-ttl/turtle-syntax-string-09.ttl b/tests/tests-ttl/turtle-syntax-string-09.ttl
new file mode 100644
index 00000000..fd300f4a
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-09.ttl
@@ -0,0 +1,2 @@
+<http://example/s> <http://example/p> '''abc
+def''' .
diff --git a/tests/tests-ttl/turtle-syntax-string-10.ttl b/tests/tests-ttl/turtle-syntax-string-10.ttl
new file mode 100644
index 00000000..a0ead0cf
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-10.ttl
@@ -0,0 +1,2 @@
+<http://example/s> <http://example/p> """abc
+def"""@en .
diff --git a/tests/tests-ttl/turtle-syntax-string-11.ttl b/tests/tests-ttl/turtle-syntax-string-11.ttl
new file mode 100644
index 00000000..fb722b6f
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-string-11.ttl
@@ -0,0 +1,2 @@
+<http://example/s> <http://example/p> '''abc
+def'''@en .
diff --git a/tests/tests-ttl/turtle-syntax-struct-01.ttl b/tests/tests-ttl/turtle-syntax-struct-01.ttl
new file mode 100644
index 00000000..0674e0ab
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-struct-01.ttl
@@ -0,0 +1,2 @@
+@prefix : <http://example/> .
+:s :p :o1 , :o2 .
diff --git a/tests/tests-ttl/turtle-syntax-struct-02.ttl b/tests/tests-ttl/turtle-syntax-struct-02.ttl
new file mode 100644
index 00000000..ccbf36e8
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-struct-02.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example/> .
+:s :p1 :o1 ;
+ :p2 :o2 .
diff --git a/tests/tests-ttl/turtle-syntax-struct-03.ttl b/tests/tests-ttl/turtle-syntax-struct-03.ttl
new file mode 100644
index 00000000..503ee6e9
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-struct-03.ttl
@@ -0,0 +1,4 @@
+@prefix : <http://example/> .
+:s :p1 :o1 ;
+ :p2 :o2 ;
+ .
diff --git a/tests/tests-ttl/turtle-syntax-struct-04.ttl b/tests/tests-ttl/turtle-syntax-struct-04.ttl
new file mode 100644
index 00000000..8e771a54
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-struct-04.ttl
@@ -0,0 +1,4 @@
+@prefix : <http://example/> .
+:s :p1 :o1 ;;
+ :p2 :o2
+ .
diff --git a/tests/tests-ttl/turtle-syntax-struct-05.ttl b/tests/tests-ttl/turtle-syntax-struct-05.ttl
new file mode 100644
index 00000000..53757297
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-struct-05.ttl
@@ -0,0 +1,4 @@
+@prefix : <http://example/> .
+:s :p1 :o1 ;
+ :p2 :o2 ;;
+ .
diff --git a/tests/tests-ttl/turtle-syntax-uri-01.ttl b/tests/tests-ttl/turtle-syntax-uri-01.ttl
new file mode 100644
index 00000000..02e6ba98
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-uri-01.ttl
@@ -0,0 +1 @@
+<http://example/s> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-uri-02.ttl b/tests/tests-ttl/turtle-syntax-uri-02.ttl
new file mode 100644
index 00000000..664feea1
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-uri-02.ttl
@@ -0,0 +1,2 @@
+# x53 is capital S
+<http://example/\u0053> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-uri-03.ttl b/tests/tests-ttl/turtle-syntax-uri-03.ttl
new file mode 100644
index 00000000..b5aeb26e
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-uri-03.ttl
@@ -0,0 +1,2 @@
+# x53 is capital S
+<http://example/\U00000053> <http://example/p> <http://example/o> .
diff --git a/tests/tests-ttl/turtle-syntax-uri-04.ttl b/tests/tests-ttl/turtle-syntax-uri-04.ttl
new file mode 100644
index 00000000..bd042040
--- /dev/null
+++ b/tests/tests-ttl/turtle-syntax-uri-04.ttl
@@ -0,0 +1,3 @@
+# IRI with all chars in it.
+<http://example/s> <http://example/p>
+<scheme:!$%25&'()*+,-./0123456789:/@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#> .
diff --git a/waf b/waf
index 53731d29..d94cdf48 100755
--- a/waf
+++ b/waf
Binary files differ
diff --git a/wscript b/wscript
index 54505cab..14d4785b 100644
--- a/wscript
+++ b/wscript
@@ -264,9 +264,101 @@ def file_equals(patha, pathb, subst_from='', subst_to=''):
fb.close()
return True
+def earl_assertion(test, passed, asserter):
+ import datetime
+
+ return '''
+[]
+ a earl:Assertion ;%s
+ earl:subject <http://drobilla.net/sw/serd> ;
+ earl:test <%s> ;
+ earl:result [
+ a earl:TestResult ;
+ earl:outcome %s ;
+ dc:date "%s"^^xsd:dateTime
+ ] .
+''' % (('\n\tearl:assertedBy <%s> ;' % asserter) if asserter else '',
+ test,
+ "earl:passed" if passed else "earl:failed",
+ datetime.datetime.now().replace(microsecond=0).isoformat())
+
+def test_manifest(ctx, srcdir, testdir, report, test_base, parse_base=None):
+ import rdflib
+ import urlparse
+
+ if not parse_base:
+ parse_base = test_base
+
+ rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
+ rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#')
+ mf = rdflib.Namespace('http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#')
+ rdft = rdflib.Namespace('http://www.w3.org/ns/rdftest#')
+ earl = rdflib.Namespace('http://www.w3.org/ns/earl#')
+
+ model = rdflib.ConjunctiveGraph()
+ model.parse(os.path.join(srcdir, 'tests', testdir, 'manifest.ttl'),
+ rdflib.URIRef(test_base + 'manifest.ttl'),
+ format='n3')
+
+ is_drobilla = (os.getenv('USER') == 'drobilla')
+ asserter = 'http://drobilla.net/drobilla#me' if is_drobilla else ''
+
+ for i in sorted(model.triples([None, rdf.type, rdft.TestTurtlePositiveSyntax])):
+ test = i[0]
+ name = model.value(test, mf.name, None)
+ action_node = model.value(test, mf.action, None)[len(test_base):]
+
+ output = os.path.join('tests', testdir, action_node + '.out')
+ action = os.path.join(srcdir, 'tests', testdir, action_node)
+
+ rel = os.path.relpath(action, os.path.join(srcdir, 'tests', testdir))
+ command = 'serdi_static -f "%s" "%s" > %s' % (action, parse_base + rel, output)
+ passed = autowaf.run_test(ctx, APPNAME, command, 0, name=name)
+
+ report.write(earl_assertion(test, passed, asserter))
+
+ for i in sorted(model.triples([None, rdf.type, rdft.TestTurtleNegativeSyntax])):
+ test = i[0]
+ name = model.value(test, mf.name, None)
+ action_node = model.value(test, mf.action, None)[len(test_base):]
+
+ output = os.path.join('tests', testdir, action_node + '.out')
+ action = os.path.join(srcdir, 'tests', testdir, action_node)
+
+ rel = os.path.relpath(action, os.path.join(srcdir, 'tests', testdir))
+ command = 'serdi_static -f "%s" "%s" > %s' % (action, parse_base + rel, output)
+ passed = autowaf.run_test(ctx, APPNAME, command, 1, name=name)
+
+ report.write(earl_assertion(test, passed, asserter))
+
+ for i in sorted(model.triples([None, rdf.type, rdft.TestTurtleEval])):
+ test = i[0]
+ name = model.value(test, mf.name, None)
+ action_node = model.value(test, mf.action, None)[len(test_base):]
+ result_node = model.value(test, mf.result, None)[len(test_base):]
+
+ output = os.path.join('tests', testdir, action_node + '.out')
+ action = os.path.join(srcdir, 'tests', testdir, action_node)
+ result = os.path.join(srcdir, 'tests', testdir, result_node)
+
+ rel = os.path.relpath(action, os.path.join(srcdir, 'tests', testdir))
+ command = 'serdi_static -f "%s" "%s" > %s' % (action, test_base + rel, output)
+ passed = autowaf.run_test(ctx, APPNAME, command, 0, name=name)
+ if passed:
+ if not os.access(output, os.F_OK):
+ passed = False
+ Logs.pprint('RED', 'FAIL: %s output %s is missing' % (name, output))
+ elif not file_equals(result, output):
+ passed = False
+ Logs.pprint('RED', 'FAIL: %s\n != %s' % (os.path.abspath(output), result))
+ else:
+ Logs.pprint('GREEN', '** Pass %s' % output)
+
+ report.write(earl_assertion(test, passed, asserter))
+
def test(ctx):
blddir = autowaf.build_dir(APPNAME, 'tests')
- for i in ['', 'bad', 'good']:
+ for i in ['', 'bad', 'good', 'new', 'tests-ttl']:
try:
os.makedirs(os.path.join(blddir, i))
except:
@@ -340,7 +432,7 @@ def test(ctx):
for test in tests:
path = os.path.join('tests', tdir, test)
commands += [ 'serdi_static -f "%s" "%s" > %s.out' % (
- os.path.join(srcdir, path), test_base(test), path) ]
+ os.path.join('..', path), test_base(test), path) ]
autowaf.run_tests(ctx, APPNAME, commands, 0, name=tdir)
@@ -364,10 +456,12 @@ def test(ctx):
autowaf.run_tests(ctx, APPNAME, commands, 1, name='bad')
+ # Don't do a round-trip test for test-id.ttl, IDs have changed
+ good_tests['good'].remove('test-id.ttl')
+
# Round-trip good tests
for tdir, tests in good_tests.items():
thru_tests = tests;
- thru_tests.remove('test-id.ttl') # IDs are mapped so files won't match
commands = []
num = 0
@@ -403,5 +497,26 @@ def test(ctx):
Logs.pprint('RED', 'FAIL: %s is incorrect' % out_filename)
else:
Logs.pprint('GREEN', 'Pass: %s' % test)
+
+ try:
+ report = open('earl.ttl', 'w')
+ report.write('''@prefix earl: <http://www.w3.org/ns/earl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n''')
+
+ serd_ttl = open(os.path.join(srcdir, 'serd.ttl'))
+ for line in serd_ttl:
+ report.write(line)
+ serd_ttl.close()
+ rdf_turtle = 'https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/'
+ test_manifest(ctx, srcdir, 'new', report,
+ rdf_turtle + 'coverage/tests/')
+ test_manifest(ctx, srcdir, 'tests-ttl', report,
+ rdf_turtle + 'coverage/tests/', 'http://example/base/')
+
+ report.close()
+
+ except Exception as e:
+ print "error:", e
+ pass
autowaf.post_test(ctx, APPNAME)