Add W3C Turtle test suite
This commit is contained in:
parent
529714ec1c
commit
aa62bace10
393 changed files with 3754 additions and 11 deletions
98
test/acceptance/turtle_w3c_test.exs
Normal file
98
test/acceptance/turtle_w3c_test.exs
Normal file
|
@ -0,0 +1,98 @@
|
|||
defmodule RDF.Turtle.W3C.Test do
|
||||
@moduledoc """
|
||||
The official W3C RDF 1.1 Turtles Test Suite.
|
||||
|
||||
from <https://www.w3.org/2013/TurtleTests/>
|
||||
|
||||
see also <https://www.w3.org/2011/rdf-wg/wiki/RDF_Test_Suites#Turtle_Tests>
|
||||
"""
|
||||
|
||||
use ExUnit.Case, async: false
|
||||
ExUnit.Case.register_attribute __ENV__, :test_case
|
||||
|
||||
alias RDF.{Turtle, TestSuite, NTriples}
|
||||
alias TestSuite.NS.RDFT
|
||||
|
||||
@base "http://www.w3.org/2013/TurtleTests/"
|
||||
|
||||
TestSuite.test_cases("Turtle", RDFT.TestTurtleEval, base: @base)
|
||||
|> Enum.each(fn test_case ->
|
||||
@tag test_case: test_case
|
||||
if TestSuite.test_name(test_case) in ~w[
|
||||
anonymous_blank_node_subject
|
||||
anonymous_blank_node_object
|
||||
labeled_blank_node_subject
|
||||
labeled_blank_node_object
|
||||
labeled_blank_node_with_leading_digit
|
||||
labeled_blank_node_with_leading_underscore
|
||||
labeled_blank_node_with_non_leading_extras
|
||||
labeled_blank_node_with_PN_CHARS_BASE_character_boundaries
|
||||
sole_blankNodePropertyList
|
||||
blankNodePropertyList_as_subject
|
||||
blankNodePropertyList_as_object
|
||||
blankNodePropertyList_with_multiple_triples
|
||||
blankNodePropertyList_containing_collection
|
||||
nested_blankNodePropertyLists
|
||||
collection_subject
|
||||
collection_object
|
||||
nested_collection
|
||||
first
|
||||
last
|
||||
turtle-subm-01
|
||||
turtle-subm-05
|
||||
turtle-subm-06
|
||||
turtle-subm-08
|
||||
turtle-subm-10
|
||||
turtle-subm-14
|
||||
] do
|
||||
@tag skip: """
|
||||
The produced graphs are correct, but have different blank node labels than the result graph.
|
||||
TODO: Implement a graph isomorphism algorithm.
|
||||
"""
|
||||
end
|
||||
|
||||
test TestSuite.test_title(test_case), %{test_case: test_case} do
|
||||
with base = to_string(TestSuite.test_input_file(test_case)) do
|
||||
assert (TestSuite.test_input_file_path(test_case, "Turtle") |> Turtle.read_file!(base: base)) ==
|
||||
(TestSuite.test_result_file_path(test_case, "Turtle") |> NTriples.read_file!)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
TestSuite.test_cases("Turtle", RDFT.TestTurtlePositiveSyntax, base: @base)
|
||||
|> Enum.each(fn test_case ->
|
||||
@tag test_case: test_case
|
||||
test TestSuite.test_title(test_case), %{test_case: test_case} do
|
||||
with base = to_string(TestSuite.test_input_file(test_case)) do
|
||||
assert {:ok, _} =
|
||||
TestSuite.test_input_file_path(test_case, "Turtle") |> Turtle.read_file(base: base)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
TestSuite.test_cases("Turtle", RDFT.TestTurtleNegativeSyntax, base: @base)
|
||||
|> Enum.each(fn test_case ->
|
||||
@tag test_case: test_case
|
||||
test TestSuite.test_title(test_case), %{test_case: test_case} do
|
||||
with base = to_string(TestSuite.test_input_file(test_case)) do
|
||||
assert {:error, _} =
|
||||
TestSuite.test_input_file_path(test_case, "Turtle") |> Turtle.read_file(base: base)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
TestSuite.test_cases("Turtle", RDFT.TestTurtleNegativeEval, base: @base)
|
||||
|> Enum.each(fn test_case ->
|
||||
if TestSuite.test_name(test_case) in ~w[turtle-eval-bad-01 turtle-eval-bad-02 turtle-eval-bad-03] do
|
||||
@tag skip: "TODO: IRI validation"
|
||||
end
|
||||
@tag test_case: test_case
|
||||
test TestSuite.test_title(test_case), %{test_case: test_case} do
|
||||
with base = to_string(TestSuite.test_input_file(test_case)) do
|
||||
assert {:error, _} =
|
||||
TestSuite.test_input_file_path(test_case, "Turtle") |> Turtle.read_file(base: base)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
1
test/data/TURTLE-TESTS/HYPHEN_MINUS_in_localName.nt
Normal file
1
test/data/TURTLE-TESTS/HYPHEN_MINUS_in_localName.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s-> <http://a.example/p> <http://a.example/o> .
|
2
test/data/TURTLE-TESTS/HYPHEN_MINUS_in_localName.ttl
Normal file
2
test/data/TURTLE-TESTS/HYPHEN_MINUS_in_localName.ttl
Normal file
|
@ -0,0 +1,2 @@
|
|||
@prefix p: <http://a.example/>.
|
||||
p:s- <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/IRIREF_datatype.nt
Normal file
1
test/data/TURTLE-TESTS/IRIREF_datatype.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
1
test/data/TURTLE-TESTS/IRIREF_datatype.ttl
Normal file
1
test/data/TURTLE-TESTS/IRIREF_datatype.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
1
test/data/TURTLE-TESTS/IRI_spo.nt
Normal file
1
test/data/TURTLE-TESTS/IRI_spo.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/IRI_subject.ttl
Normal file
1
test/data/TURTLE-TESTS/IRI_subject.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/IRI_with_all_punctuation.nt
Normal file
1
test/data/TURTLE-TESTS/IRI_with_all_punctuation.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<scheme:!$%25&'()*+,-./0123456789:/@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#> <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/IRI_with_all_punctuation.ttl
Normal file
1
test/data/TURTLE-TESTS/IRI_with_all_punctuation.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<scheme:!$%25&'()*+,-./0123456789:/@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#> <http://a.example/p> <http://a.example/o> .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/\U00000073> <http://a.example/p> <http://a.example/o> .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/\u0073> <http://a.example/p> <http://a.example/o> .
|
117
test/data/TURTLE-TESTS/LICENSE
Normal file
117
test/data/TURTLE-TESTS/LICENSE
Normal file
|
@ -0,0 +1,117 @@
|
|||
Summary
|
||||
=======
|
||||
|
||||
Distributed under both the W3C Test Suite License[1] and the W3C 3-clause BSD
|
||||
License[2]. To contribute to a W3C Test Suite, see the policies and contribution
|
||||
forms [3]
|
||||
|
||||
1. http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
2. http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
3. http://www.w3.org/2004/10/27-testcases
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS
|
||||
AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT
|
||||
HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING,
|
||||
BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE
|
||||
SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT
|
||||
INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
|
||||
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE
|
||||
OR IMPLEMENTATION OF THE CONTENTS THEREOF.
|
||||
|
||||
|
||||
W3C Test Suite License
|
||||
======================
|
||||
|
||||
This document, Test Suites and other documents that link to this statement are
|
||||
provided by the copyright holders under the following license: By using and/or
|
||||
copying this document, or the W3C document from which this statement is linked,
|
||||
you (the licensee) agree that you have read, understood, and will comply with
|
||||
the following terms and conditions:
|
||||
|
||||
Permission to copy, and distribute the contents of this document, or the W3C
|
||||
document from which this statement is linked, in any medium for any purpose and
|
||||
without fee or royalty is hereby granted, provided that you include the
|
||||
following on ALL copies of the document, or portions thereof, that you use:
|
||||
|
||||
1 A link or URL to the original W3C document.
|
||||
|
||||
2 The pre-existing copyright notice of the original author, or if it doesn't
|
||||
exist, a notice (hypertext is preferred, but a textual representation is
|
||||
permitted) of the form: "Copyright © [$date-of-document] World Wide Web
|
||||
Consortium, (Massachusetts Institute of Technology, European Research
|
||||
Consortium for Informatics and Mathematics, Keio University) and others. All
|
||||
Rights
|
||||
Reserved. http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html"
|
||||
|
||||
3 If it exists, the STATUS of the W3C document.
|
||||
|
||||
4 When space permits, inclusion of the full text of this NOTICE should be
|
||||
provided. We request that authorship attribution be provided in any software,
|
||||
documents, or other items or products that you create pursuant to the
|
||||
implementation of the contents of this document, or any portion thereof.
|
||||
|
||||
|
||||
No right to create modifications or derivatives of W3C documents is granted
|
||||
pursuant to this license. However, if additional requirements (documented in the
|
||||
Copyright FAQ) are satisfied, the right to create modifications or derivatives
|
||||
is sometimes granted by the W3C to individuals complying with those
|
||||
requirements.
|
||||
|
||||
If a Test Suite distinguishes the test harness (or, framework for navigation)
|
||||
and the actual tests, permission is given to remove or alter the harness or
|
||||
navigation if the Test Suite in question allows to do so. The tests themselves
|
||||
shall NOT be changed in any way.
|
||||
|
||||
The name and trademarks of W3C and other copyright holders may NOT be used in
|
||||
advertising or publicity pertaining to this document or other documents that
|
||||
link to this statement without specific, written prior permission. Title to
|
||||
copyright in this document will at all times remain with copyright
|
||||
holders. Permission is given to use the trademarked string W3C within claims of
|
||||
performance concerning W3C Specifications or features described therein, and
|
||||
there only, if the test suite so authorizes.
|
||||
|
||||
THIS WORK IS PROVIDED BY W3C, MIT, ERCIM, KEIO UNIVERSITY, THE COPYRIGHT HOLDERS
|
||||
AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
|
||||
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL W3C, MIT, ERCIM, KEIO
|
||||
UNIVERSITY, THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
W3C 3-clause BSD License
|
||||
========================
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1 Redistributions of works must retain the original copyright notice, this list
|
||||
of conditions and the following disclaimer.
|
||||
|
||||
2 Redistributions in binary form must reproduce the original copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3 Neither the name of the W3C nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this work without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
1
test/data/TURTLE-TESTS/LITERAL1.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL1.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "x" .
|
1
test/data/TURTLE-TESTS/LITERAL1.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL1.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> 'x' .
|
1
test/data/TURTLE-TESTS/LITERAL1_all_controls.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL1_all_controls.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\t\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" .
|
BIN
test/data/TURTLE-TESTS/LITERAL1_all_controls.ttl
Normal file
BIN
test/data/TURTLE-TESTS/LITERAL1_all_controls.ttl
Normal file
Binary file not shown.
1
test/data/TURTLE-TESTS/LITERAL1_all_punctuation.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL1_all_punctuation.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> " !\"#$%&():;<=>?@[]^_`{|}~" .
|
1
test/data/TURTLE-TESTS/LITERAL1_all_punctuation.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL1_all_punctuation.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> ' !"#$%&():;<=>?@[]^_`{|}~' .
|
1
test/data/TURTLE-TESTS/LITERAL1_ascii_boundaries.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL1_ascii_boundaries.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0000\t\u000B\u000C\u000E&([]\u007F" .
|
BIN
test/data/TURTLE-TESTS/LITERAL1_ascii_boundaries.ttl
Normal file
BIN
test/data/TURTLE-TESTS/LITERAL1_ascii_boundaries.ttl
Normal file
Binary file not shown.
1
test/data/TURTLE-TESTS/LITERAL1_with_UTF8_boundaries.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL1_with_UTF8_boundaries.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> '߿ࠀက쿿퀀<EFBFBD>𐀀' .
|
1
test/data/TURTLE-TESTS/LITERAL2.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL2.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "x" .
|
1
test/data/TURTLE-TESTS/LITERAL2_ascii_boundaries.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL2_ascii_boundaries.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0000\t\u000B\u000C\u000E!#[]\u007F" .
|
BIN
test/data/TURTLE-TESTS/LITERAL2_ascii_boundaries.ttl
Normal file
BIN
test/data/TURTLE-TESTS/LITERAL2_ascii_boundaries.ttl
Normal file
Binary file not shown.
1
test/data/TURTLE-TESTS/LITERAL2_with_UTF8_boundaries.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL2_with_UTF8_boundaries.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "߿ࠀက쿿퀀<EFBFBD>𐀀" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG1.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG1.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> '''x''' .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG1_ascii_boundaries.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG1_ascii_boundaries.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0000&([]\u007F" .
|
BIN
test/data/TURTLE-TESTS/LITERAL_LONG1_ascii_boundaries.ttl
Normal file
BIN
test/data/TURTLE-TESTS/LITERAL_LONG1_ascii_boundaries.ttl
Normal file
Binary file not shown.
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_1_squote.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_1_squote.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "x'y" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_1_squote.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_1_squote.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> '''x'y''' .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_2_squotes.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_2_squotes.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "x''y" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_2_squotes.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG1_with_2_squotes.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> '''x''y''' .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> '''߿ࠀက쿿퀀<EFBFBD>𐀀''' .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG2.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG2.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> """x""" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG2_ascii_boundaries.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG2_ascii_boundaries.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0000!#[]\u007F" .
|
BIN
test/data/TURTLE-TESTS/LITERAL_LONG2_ascii_boundaries.ttl
Normal file
BIN
test/data/TURTLE-TESTS/LITERAL_LONG2_ascii_boundaries.ttl
Normal file
Binary file not shown.
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_1_squote.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_1_squote.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "x\"y" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_1_squote.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_1_squote.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> """x"y""" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_2_squotes.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_2_squotes.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "x\"\"y" .
|
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_2_squotes.ttl
Normal file
1
test/data/TURTLE-TESTS/LITERAL_LONG2_with_2_squotes.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> """x""y""" .
|
|
@ -0,0 +1 @@
|
|||
<http://example.org/ns#s> <http://example.org/ns#p1> "test-\\" .
|
|
@ -0,0 +1,3 @@
|
|||
@prefix : <http://example.org/ns#> .
|
||||
|
||||
:s :p1 """test-\\""" .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> """߿ࠀက쿿퀀<EFBFBD>𐀀""" .
|
1
test/data/TURTLE-TESTS/LITERAL_with_UTF8_boundaries.nt
Normal file
1
test/data/TURTLE-TESTS/LITERAL_with_UTF8_boundaries.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0080\u07FF\u0800\u0FFF\u1000\uCFFF\uD000\uD7FF\uE000\uFFFD\U00010000\U0003FFFD\U00040000\U000FFFFD\U00100000\U0010FFFD" .
|
65
test/data/TURTLE-TESTS/README
Normal file
65
test/data/TURTLE-TESTS/README
Normal file
|
@ -0,0 +1,65 @@
|
|||
This README is for the W3C RDF Working Group's Turtle test suite.
|
||||
This test suite contains four kinds of tests:
|
||||
|
||||
132 Evaluation (rdft:TestTurtleEval) - a pair of an input turtle
|
||||
file and reference ntriples file.
|
||||
|
||||
77 Positive syntax (rdft:TestTurtlePositiveSyntax) - an input turtle
|
||||
file with no syntax errors.
|
||||
|
||||
78 Negative syntax (rdft:TestTurtleNegativeSyntax) - an input turtle
|
||||
file with at least one syntax error.
|
||||
|
||||
4 Negative Evaluation (rdft:TestTurtleNegativeEval) - a pair of an
|
||||
input turtle file and reference ntriples file. These tests have the
|
||||
same properties as rdft:TestTurtleNegativeSyntax.
|
||||
|
||||
The manifest.ttl file in this directory lists all of the tests in the
|
||||
RDF WG's Turtle test suite. Each test is one of the above tests. All
|
||||
tests have a name (mf:name) and an input (mf:action). The Evaluation
|
||||
tests have an expected result (mf:result).
|
||||
|
||||
• An implementation passes an Evaluation test if it parses the input
|
||||
into a graph, parses the expecte result into another graph, and
|
||||
those two graphs are isomorphic (see
|
||||
<http://www.w3.org/TR/rdf11-concepts/#graph-isomorphism>).
|
||||
|
||||
• An implementation passes a positive syntax test if it parses the
|
||||
input.
|
||||
|
||||
• An implementation passes a negative syntax test if it fails to parse
|
||||
the input.
|
||||
|
||||
|
||||
RELATIVE IRI RESOLUTION:
|
||||
|
||||
The home of the test suite is <http://www.w3.org/2013/TurtleTests/>.
|
||||
Per RFC 3986 section 5.1.3, the base IRI for parsing each file is the
|
||||
retrieval IRI for that file. For example, the tests turtle-subm-01 and
|
||||
turtle-subm-27 require relative IRI resolution against a base of
|
||||
<http://www.w3.org/2013/TurtleTests/turtle-subm-01.ttl> and
|
||||
<http://www.w3.org/2013/TurtleTests/turtle-subm-27.ttl> respectively.
|
||||
|
||||
|
||||
CHARACTER ENCODING:
|
||||
|
||||
The Turtle language uses UTF-8 encoding. The following tests include
|
||||
non-ascii characters:
|
||||
localName_with_assigned_nfc_bmp_PN_CHARS_BASE_character_boundaries
|
||||
localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries *
|
||||
localName_with_nfc_PN_CHARS_BASE_character_boundaries *
|
||||
labeled_blank_node_with_PN_CHARS_BASE_character_boundaries *
|
||||
LITERAL1_with_UTF8_boundaries *
|
||||
LITERAL_LONG1_with_UTF8_boundaries *
|
||||
LITERAL2_with_UTF8_boundaries *
|
||||
LITERAL_LONG2_with_UTF8_boundaries *
|
||||
|
||||
Those marked with a * include characters with codepoints greater than
|
||||
U+FFFD and are thus expressed as a pair of surrogate characters when
|
||||
represented in UCS2.
|
||||
|
||||
|
||||
See http://www.w3.org/2011/rdf-wg/wiki/Turtle_Test_Suite for more details.
|
||||
|
||||
|
||||
Eric Prud'hommeaux <eric+turtle@w3.org> - 11 June 2013.
|
2
test/data/TURTLE-TESTS/SPARQL_style_base.ttl
Normal file
2
test/data/TURTLE-TESTS/SPARQL_style_base.ttl
Normal file
|
@ -0,0 +1,2 @@
|
|||
BASE <http://a.example/>
|
||||
<s> <http://a.example/p> <http://a.example/o> .
|
2
test/data/TURTLE-TESTS/SPARQL_style_prefix.ttl
Normal file
2
test/data/TURTLE-TESTS/SPARQL_style_prefix.ttl
Normal file
|
@ -0,0 +1,2 @@
|
|||
PREFIX p: <http://a.example/>
|
||||
p:s <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/anonymous_blank_node_object.ttl
Normal file
1
test/data/TURTLE-TESTS/anonymous_blank_node_object.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> [] .
|
1
test/data/TURTLE-TESTS/anonymous_blank_node_subject.ttl
Normal file
1
test/data/TURTLE-TESTS/anonymous_blank_node_subject.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
[] <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/bareword_a_predicate.nt
Normal file
1
test/data/TURTLE-TESTS/bareword_a_predicate.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/bareword_a_predicate.ttl
Normal file
1
test/data/TURTLE-TESTS/bareword_a_predicate.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> a <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/bareword_decimal.nt
Normal file
1
test/data/TURTLE-TESTS/bareword_decimal.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "1.0"^^<http://www.w3.org/2001/XMLSchema#decimal> .
|
1
test/data/TURTLE-TESTS/bareword_decimal.ttl
Normal file
1
test/data/TURTLE-TESTS/bareword_decimal.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> 1.0 .
|
1
test/data/TURTLE-TESTS/bareword_double.nt
Normal file
1
test/data/TURTLE-TESTS/bareword_double.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "1E0"^^<http://www.w3.org/2001/XMLSchema#double> .
|
1
test/data/TURTLE-TESTS/bareword_double.ttl
Normal file
1
test/data/TURTLE-TESTS/bareword_double.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> 1E0 .
|
1
test/data/TURTLE-TESTS/bareword_integer.ttl
Normal file
1
test/data/TURTLE-TESTS/bareword_integer.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> 1 .
|
|
@ -0,0 +1,2 @@
|
|||
<http://a.example/s> <http://a.example/p> _:b1 .
|
||||
_:b1 <http://a.example/p2> <http://a.example/o2> .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> [ <http://a.example/p2> <http://a.example/o2> ] .
|
|
@ -0,0 +1,2 @@
|
|||
_:b1 <http://a.example/p> <http://a.example/o> .
|
||||
_:b1 <http://a.example/p2> <http://a.example/o2> .
|
|
@ -0,0 +1 @@
|
|||
[ <http://a.example/p> <http://a.example/o> ] <http://a.example/p2> <http://a.example/o2> .
|
|
@ -0,0 +1,3 @@
|
|||
_:b1 <http://a.example/p1> _:el1 .
|
||||
_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
|
@ -0,0 +1 @@
|
|||
[ <http://a.example/p1> (1) ] .
|
|
@ -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> .
|
|
@ -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> .
|
3
test/data/TURTLE-TESTS/collection_object.nt
Normal file
3
test/data/TURTLE-TESTS/collection_object.nt
Normal file
|
@ -0,0 +1,3 @@
|
|||
<http://a.example/s> <http://a.example/p> _:el1 .
|
||||
_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
1
test/data/TURTLE-TESTS/collection_object.ttl
Normal file
1
test/data/TURTLE-TESTS/collection_object.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> (1) .
|
3
test/data/TURTLE-TESTS/collection_subject.nt
Normal file
3
test/data/TURTLE-TESTS/collection_subject.nt
Normal file
|
@ -0,0 +1,3 @@
|
|||
_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:el1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
||||
_:el1 <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/collection_subject.ttl
Normal file
1
test/data/TURTLE-TESTS/collection_subject.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
(1) <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/comment_following_PNAME_NS.nt
Normal file
1
test/data/TURTLE-TESTS/comment_following_PNAME_NS.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> <http://a.example/> .
|
3
test/data/TURTLE-TESTS/comment_following_PNAME_NS.ttl
Normal file
3
test/data/TURTLE-TESTS/comment_following_PNAME_NS.ttl
Normal file
|
@ -0,0 +1,3 @@
|
|||
@prefix p: <http://a.example/> .
|
||||
<http://a.example/s> <http://a.example/p> p:#comment
|
||||
.
|
3
test/data/TURTLE-TESTS/comment_following_localName.ttl
Normal file
3
test/data/TURTLE-TESTS/comment_following_localName.ttl
Normal file
|
@ -0,0 +1,3 @@
|
|||
@prefix p: <http://a.example/> .
|
||||
<http://a.example/s> <http://a.example/p> p:o#comment
|
||||
.
|
2
test/data/TURTLE-TESTS/default_namespace_IRI.ttl
Normal file
2
test/data/TURTLE-TESTS/default_namespace_IRI.ttl
Normal file
|
@ -0,0 +1,2 @@
|
|||
@prefix : <http://a.example/>.
|
||||
:s <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/double_lower_case_e.nt
Normal file
1
test/data/TURTLE-TESTS/double_lower_case_e.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "1e0"^^<http://www.w3.org/2001/XMLSchema#double> .
|
1
test/data/TURTLE-TESTS/double_lower_case_e.ttl
Normal file
1
test/data/TURTLE-TESTS/double_lower_case_e.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> 1e0 .
|
1
test/data/TURTLE-TESTS/empty_collection.nt
Normal file
1
test/data/TURTLE-TESTS/empty_collection.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
1
test/data/TURTLE-TESTS/empty_collection.ttl
Normal file
1
test/data/TURTLE-TESTS/empty_collection.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> () .
|
7
test/data/TURTLE-TESTS/first.nt
Normal file
7
test/data/TURTLE-TESTS/first.nt
Normal file
|
@ -0,0 +1,7 @@
|
|||
<http://a.example/s> <http://a.example/p> _:outerEl1 .
|
||||
_:outerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:innerEl1 .
|
||||
_:innerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:innerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
||||
_:outerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:outerEl2 .
|
||||
_:outerEl2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:outerEl2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
1
test/data/TURTLE-TESTS/first.ttl
Normal file
1
test/data/TURTLE-TESTS/first.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> ((1) 2) .
|
1
test/data/TURTLE-TESTS/labeled_blank_node_object.nt
Normal file
1
test/data/TURTLE-TESTS/labeled_blank_node_object.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> _:b1 .
|
1
test/data/TURTLE-TESTS/labeled_blank_node_object.ttl
Normal file
1
test/data/TURTLE-TESTS/labeled_blank_node_object.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> _:o .
|
1
test/data/TURTLE-TESTS/labeled_blank_node_subject.nt
Normal file
1
test/data/TURTLE-TESTS/labeled_blank_node_subject.nt
Normal file
|
@ -0,0 +1 @@
|
|||
_:b1 <http://a.example/p> <http://a.example/o> .
|
1
test/data/TURTLE-TESTS/labeled_blank_node_subject.ttl
Normal file
1
test/data/TURTLE-TESTS/labeled_blank_node_subject.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
_:s <http://a.example/p> <http://a.example/o> .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> _:AZazÀÖØöø˿ͰͽͿ⁰Ⰰ、豈﷏ﷰ<EFBFBD>𐀀 .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> _:0 .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> _:_ .
|
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> _:a·̀ͯ‿.⁀ .
|
1
test/data/TURTLE-TESTS/langtagged_LONG.ttl
Normal file
1
test/data/TURTLE-TESTS/langtagged_LONG.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> """chat"""@en .
|
1
test/data/TURTLE-TESTS/langtagged_LONG_with_subtag.nt
Normal file
1
test/data/TURTLE-TESTS/langtagged_LONG_with_subtag.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://example.org/ex#a> <http://example.org/ex#b> "Cheers"@en-UK .
|
3
test/data/TURTLE-TESTS/langtagged_LONG_with_subtag.ttl
Normal file
3
test/data/TURTLE-TESTS/langtagged_LONG_with_subtag.ttl
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Test long literal with lang tag
|
||||
@prefix : <http://example.org/ex#> .
|
||||
:a :b """Cheers"""@en-UK .
|
1
test/data/TURTLE-TESTS/langtagged_non_LONG.nt
Normal file
1
test/data/TURTLE-TESTS/langtagged_non_LONG.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "chat"@en .
|
1
test/data/TURTLE-TESTS/langtagged_non_LONG.ttl
Normal file
1
test/data/TURTLE-TESTS/langtagged_non_LONG.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "chat"@en .
|
1
test/data/TURTLE-TESTS/lantag_with_subtag.nt
Normal file
1
test/data/TURTLE-TESTS/lantag_with_subtag.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "chat"@en-us .
|
1
test/data/TURTLE-TESTS/lantag_with_subtag.ttl
Normal file
1
test/data/TURTLE-TESTS/lantag_with_subtag.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "chat"@en-us-us .
|
7
test/data/TURTLE-TESTS/last.nt
Normal file
7
test/data/TURTLE-TESTS/last.nt
Normal file
|
@ -0,0 +1,7 @@
|
|||
<http://a.example/s> <http://a.example/p> _:outerEl1 .
|
||||
_:outerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:outerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:outerEl2 .
|
||||
_:outerEl2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:innerEl1 .
|
||||
_:innerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
|
||||
_:innerEl1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
||||
_:outerEl2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
|
1
test/data/TURTLE-TESTS/last.ttl
Normal file
1
test/data/TURTLE-TESTS/last.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> (1 (2)) .
|
1
test/data/TURTLE-TESTS/literal_false.nt
Normal file
1
test/data/TURTLE-TESTS/literal_false.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
|
1
test/data/TURTLE-TESTS/literal_false.ttl
Normal file
1
test/data/TURTLE-TESTS/literal_false.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> false .
|
1
test/data/TURTLE-TESTS/literal_true.nt
Normal file
1
test/data/TURTLE-TESTS/literal_true.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
|
1
test/data/TURTLE-TESTS/literal_true.ttl
Normal file
1
test/data/TURTLE-TESTS/literal_true.ttl
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> true .
|
1
test/data/TURTLE-TESTS/literal_with_BACKSPACE.nt
Normal file
1
test/data/TURTLE-TESTS/literal_with_BACKSPACE.nt
Normal file
|
@ -0,0 +1 @@
|
|||
<http://a.example/s> <http://a.example/p> "\u0008" .
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue