diff options
48 files changed, 638 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index d75ff26e..140c6e80 100644 --- a/configure.ac +++ b/configure.ac @@ -1289,6 +1289,7 @@ tests/Makefile tests/feeds/Makefile tests/grddl/Makefile tests/ntriples/Makefile +tests/ntriples-2013/Makefile tests/rdfa/Makefile tests/rdfa11/Makefile tests/json/Makefile diff --git a/tests/ntriples-2013/Makefile.am b/tests/ntriples-2013/Makefile.am new file mode 100644 index 00000000..489f2556 --- /dev/null +++ b/tests/ntriples-2013/Makefile.am @@ -0,0 +1,168 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Triples 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +RDFCOMPARE=$(srcdir)/../../scripts/rdfcompare + +RDFXML_DIR = ../rdfxml + +TEST_GOOD_FILES = \ + nt-syntax-file-01.nt \ + nt-syntax-file-02.nt \ + nt-syntax-file-03.nt \ + nt-syntax-uri-01.nt \ + nt-syntax-uri-02.nt \ + nt-syntax-uri-03.nt \ + nt-syntax-uri-04.nt \ + nt-syntax-string-01.nt \ + nt-syntax-string-02.nt \ + nt-syntax-string-03.nt \ + nt-syntax-str-esc-01.nt \ + nt-syntax-str-esc-02.nt \ + nt-syntax-str-esc-03.nt \ + nt-syntax-bnode-01.nt \ + nt-syntax-bnode-02.nt \ + nt-syntax-datatypes-01.nt \ + nt-syntax-datatypes-02.nt \ + nt-syntax-subm-01.nt + + +TEST_BAD_FILES = \ + nt-syntax-bad-uri-01.nt \ + nt-syntax-bad-uri-02.nt \ + nt-syntax-bad-uri-03.nt \ + nt-syntax-bad-uri-04.nt \ + nt-syntax-bad-uri-05.nt \ + nt-syntax-bad-uri-06.nt \ + nt-syntax-bad-uri-07.nt \ + nt-syntax-bad-uri-08.nt \ + nt-syntax-bad-uri-09.nt \ + nt-syntax-bad-prefix-01.nt \ + nt-syntax-bad-base-01.nt \ + nt-syntax-bad-struct-01.nt \ + nt-syntax-bad-struct-02.nt \ + nt-syntax-bad-lang-01.nt \ + nt-syntax-bad-esc-01.nt \ + nt-syntax-bad-esc-02.nt \ + nt-syntax-bad-esc-03.nt \ + nt-syntax-bad-string-01.nt \ + nt-syntax-bad-string-02.nt \ + nt-syntax-bad-string-03.nt \ + nt-syntax-bad-string-04.nt \ + nt-syntax-bad-string-05.nt \ + nt-syntax-bad-string-06.nt \ + nt-syntax-bad-string-07.nt \ + nt-syntax-bad-num-01.nt \ + nt-syntax-bad-num-02.nt \ + nt-syntax-bad-num-03.nt + +# Used to make N-triples output consistent +BASE_URI=http://www.w3.org/2013/N-TriplesTests/ +# for rdf-schema.ttl +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +ALL_TEST_FILES= \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-ntriples check-bad-ntriples + +if MAINTAINER_MODE +check_good_ntriples_deps = $(TEST_GOOD_FILES) +endif + +check-good-ntriples: build-rapper $(check_good_ntriples_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good N-Triples syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_bad_ntriples_deps = $(TEST_BAD_FILES) +endif + +check-bad-ntriples: build-rapper $(check_bad_ntriples_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad N-Triples fails"; \ + for test in $(TEST_BAD_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result diff --git a/tests/ntriples-2013/manifest.ttl b/tests/ntriples-2013/manifest.ttl new file mode 100644 index 00000000..236c7c99 --- /dev/null +++ b/tests/ntriples-2013/manifest.ttl @@ -0,0 +1,329 @@ +# N-Triples Syntax tests + +@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 "N-Triples tests" ; + mf:entries + ( + <#nt-syntax-file-01> + <#nt-syntax-file-02> + <#nt-syntax-file-03> + <#nt-syntax-uri-01> + <#nt-syntax-uri-02> + <#nt-syntax-uri-03> + <#nt-syntax-uri-04> + <#nt-syntax-string-01> + <#nt-syntax-string-02> + <#nt-syntax-string-03> + <#nt-syntax-str-esc-01> + <#nt-syntax-str-esc-02> + <#nt-syntax-str-esc-03> + <#nt-syntax-bnode-01> + <#nt-syntax-bnode-02> + <#nt-syntax-datatypes-01> + <#nt-syntax-datatypes-02> + <#nt-syntax-bad-uri-01> + <#nt-syntax-bad-uri-02> + <#nt-syntax-bad-uri-03> + <#nt-syntax-bad-uri-04> + <#nt-syntax-bad-uri-05> + <#nt-syntax-bad-uri-06> + <#nt-syntax-bad-uri-07> + <#nt-syntax-bad-uri-08> + <#nt-syntax-bad-uri-09> + <#nt-syntax-bad-prefix-01> + <#nt-syntax-bad-base-01> + <#nt-syntax-bad-struct-01> + <#nt-syntax-bad-struct-02> + <#nt-syntax-bad-lang-01> + <#nt-syntax-bad-esc-01> + <#nt-syntax-bad-esc-02> + <#nt-syntax-bad-esc-03> + <#nt-syntax-bad-string-01> + <#nt-syntax-bad-string-02> + <#nt-syntax-bad-string-03> + <#nt-syntax-bad-string-04> + <#nt-syntax-bad-string-05> + <#nt-syntax-bad-string-06> + <#nt-syntax-bad-string-07> + <#nt-syntax-bad-num-01> + <#nt-syntax-bad-num-02> + <#nt-syntax-bad-num-03> + <#nt-syntax-subm-01> + ) . + +<#nt-syntax-file-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-file-01" ; + rdfs:comment "Empty file" ; + mf:action <nt-syntax-file-01.nt> ; + . + +<#nt-syntax-file-02> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-file-02" ; + rdfs:comment "Only comment" ; + mf:action <nt-syntax-file-02.nt> ; + . + +<#nt-syntax-file-03> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-file-03" ; + rdfs:comment "One comment, one empty line" ; + mf:action <nt-syntax-file-03.nt> ; + . + +<#nt-syntax-uri-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-uri-01" ; + rdfs:comment "Only IRIs" ; + mf:action <nt-syntax-uri-01.nt> ; + . + +<#nt-syntax-uri-02> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-uri-02" ; + rdfs:comment "IRIs with Unicode escape" ; + mf:action <nt-syntax-uri-02.nt> ; + . + +<#nt-syntax-uri-03> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-uri-03" ; + rdfs:comment "IRIs with long Unicode escape" ; + mf:action <nt-syntax-uri-03.nt> ; + . + +<#nt-syntax-uri-04> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-uri-04" ; + rdfs:comment "Legal IRIs" ; + mf:action <nt-syntax-uri-04.nt> ; + . + +<#nt-syntax-string-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-string-01" ; + rdfs:comment "string literal" ; + mf:action <nt-syntax-string-01.nt> ; + . + +<#nt-syntax-string-02> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-string-02" ; + rdfs:comment "langString literal" ; + mf:action <nt-syntax-string-02.nt> ; + . + +<#nt-syntax-string-03> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-string-03" ; + rdfs:comment "langString literal with region" ; + mf:action <nt-syntax-string-03.nt> ; + . + +<#nt-syntax-str-esc-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-str-esc-01" ; + rdfs:comment "string literal with escaped newline" ; + mf:action <nt-syntax-str-esc-01.nt> ; + . + +<#nt-syntax-str-esc-02> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-str-esc-02" ; + rdfs:comment "string literal with Unicode escape" ; + mf:action <nt-syntax-str-esc-02.nt> ; + . + +<#nt-syntax-str-esc-03> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-str-esc-03" ; + rdfs:comment "string literal with long Unicode escape" ; + mf:action <nt-syntax-str-esc-03.nt> ; + . + +<#nt-syntax-bnode-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-bnode-01" ; + rdfs:comment "bnode subject" ; + mf:action <nt-syntax-bnode-01.nt> ; + . + +<#nt-syntax-bnode-02> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-bnode-02" ; + rdfs:comment "bnode object" ; + mf:action <nt-syntax-bnode-02.nt> ; + . + +<#nt-syntax-datatypes-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-datatypes-01" ; + rdfs:comment "xsd:byte literal" ; + mf:action <nt-syntax-datatypes-01.nt> ; + . + +<#nt-syntax-datatypes-02> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-datatypes-02" ; + rdfs:comment "integer as xsd:string" ; + mf:action <nt-syntax-datatypes-02.nt> ; + . + +<#nt-syntax-bad-uri-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-01" ; + rdfs:comment "Bad IRI : space (negative test)" ; + mf:action <nt-syntax-bad-uri-01.nt> ; + . + +<#nt-syntax-bad-uri-02> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-02" ; + rdfs:comment "Bad IRI : bad escape (negative test)" ; + mf:action <nt-syntax-bad-uri-02.nt> ; + . + +<#nt-syntax-bad-uri-03> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-03" ; + rdfs:comment "Bad IRI : bad long escape (negative test)" ; + mf:action <nt-syntax-bad-uri-03.nt> ; + . + +<#nt-syntax-bad-uri-04> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-04" ; + rdfs:comment "Bad IRI : character escapes not allowed (negative test)" ; + mf:action <nt-syntax-bad-uri-04.nt> ; + . + +<#nt-syntax-bad-uri-05> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-05" ; + rdfs:comment "Bad IRI : character escapes not allowed (2) (negative test)" ; + mf:action <nt-syntax-bad-uri-05.nt> ; + . + +<#nt-syntax-bad-uri-06> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-06" ; + rdfs:comment "Bad IRI : relative IRI not allowed in subject (negative test)" ; + mf:action <nt-syntax-bad-uri-06.nt> ; + . + +<#nt-syntax-bad-uri-07> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-07" ; + rdfs:comment "Bad IRI : relative IRI not allowed in predicate (negative test)" ; + mf:action <nt-syntax-bad-uri-07.nt> ; + . + +<#nt-syntax-bad-uri-08> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-08" ; + rdfs:comment "Bad IRI : relative IRI not allowed in object (negative test)" ; + mf:action <nt-syntax-bad-uri-08.nt> ; + . + +<#nt-syntax-bad-uri-09> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-uri-09" ; + rdfs:comment "Bad IRI : relative IRI not allowed in datatype (negative test)" ; + mf:action <nt-syntax-bad-uri-09.nt> ; + . + +<#nt-syntax-bad-prefix-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-prefix-01" ; + rdfs:comment "@prefix not allowed in n-triples (negative test)" ; + mf:action <nt-syntax-bad-prefix-01.nt> ; + . + +<#nt-syntax-bad-base-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-base-01" ; + rdfs:comment "@base not allowed in N-Triples (negative test)" ; + mf:action <nt-syntax-bad-base-01.nt> ; + . + +<#nt-syntax-bad-struct-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-struct-01" ; + rdfs:comment "N-Triples does not have objectList (negative test)" ; + mf:action <nt-syntax-bad-struct-01.nt> ; + . + +<#nt-syntax-bad-struct-02> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-struct-02" ; + rdfs:comment "N-Triples does not have predicateObjectList (negative test)" ; + mf:action <nt-syntax-bad-struct-02.nt> ; + . + +<#nt-syntax-bad-lang-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-lang-01" ; + rdfs:comment "langString with bad lang (negative test)" ; + mf:action <nt-syntax-bad-lang-01.nt> ; + . + +<#nt-syntax-bad-esc-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-esc-01" ; + rdfs:comment "Bad string escape (negative test)" ; + mf:action <nt-syntax-bad-esc-01.nt> ; + . + +<#nt-syntax-bad-esc-02> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-esc-02" ; + rdfs:comment "Bad string escape (negative test)" ; + mf:action <nt-syntax-bad-esc-02.nt> ; + . + +<#nt-syntax-bad-esc-03> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-esc-03" ; + rdfs:comment "Bad string escape (negative test)" ; + mf:action <nt-syntax-bad-esc-03.nt> ; + . + +<#nt-syntax-bad-string-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-01" ; + rdfs:comment "mismatching string literal open/close (negative test)" ; + mf:action <nt-syntax-bad-string-01.nt> ; + . + +<#nt-syntax-bad-string-02> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-02" ; + rdfs:comment "mismatching string literal open/close (negative test)" ; + mf:action <nt-syntax-bad-string-02.nt> ; + . + +<#nt-syntax-bad-string-03> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-03" ; + rdfs:comment "single quotes (negative test)" ; + mf:action <nt-syntax-bad-string-03.nt> ; + . + +<#nt-syntax-bad-string-04> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-04" ; + rdfs:comment "long single string literal (negative test)" ; + mf:action <nt-syntax-bad-string-04.nt> ; + . + +<#nt-syntax-bad-string-05> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-05" ; + rdfs:comment "long double string literal (negative test)" ; + mf:action <nt-syntax-bad-string-05.nt> ; + . + +<#nt-syntax-bad-string-06> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-06" ; + rdfs:comment "string literal with no end (negative test)" ; + mf:action <nt-syntax-bad-string-06.nt> ; + . + +<#nt-syntax-bad-string-07> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-string-07" ; + rdfs:comment "string literal with no start (negative test)" ; + mf:action <nt-syntax-bad-string-07.nt> ; + . + +<#nt-syntax-bad-num-01> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-num-01" ; + rdfs:comment "no numbers in N-Triples (integer) (negative test)" ; + mf:action <nt-syntax-bad-num-01.nt> ; + . + +<#nt-syntax-bad-num-02> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-num-02" ; + rdfs:comment "no numbers in N-Triples (decimal) (negative test)" ; + mf:action <nt-syntax-bad-num-02.nt> ; + . + +<#nt-syntax-bad-num-03> rdf:type rdft:TestNTriplesNegativeSyntax, rdft:TestNQuadsNegativeSyntax ; + mf:name "nt-syntax-bad-num-03" ; + rdfs:comment "no numbers in N-Triples (float) (negative test)" ; + mf:action <nt-syntax-bad-num-03.nt> ; + . + +<#nt-syntax-subm-01> rdf:type rdft:TestNTriplesPositiveSyntax, rdft:TestNQuadsPositiveSyntax ; + mf:name "nt-syntax-subm-01" ; + rdfs:comment "Submission test from Original RDF Test Cases" ; + mf:action <nt-syntax-subm-01.nt> ; + . diff --git a/tests/ntriples-2013/nt-syntax-bad-base-01.nt b/tests/ntriples-2013/nt-syntax-bad-base-01.nt new file mode 100644 index 00000000..dff1b3b4 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-base-01.nt @@ -0,0 +1 @@ +@base <http://example/> . diff --git a/tests/ntriples-2013/nt-syntax-bad-esc-01.nt b/tests/ntriples-2013/nt-syntax-bad-esc-01.nt new file mode 100644 index 00000000..f7a88add --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-esc-01.nt @@ -0,0 +1,2 @@ +# Bad string escape +<http://example/s> <http://example/p> "a\zb" . diff --git a/tests/ntriples-2013/nt-syntax-bad-esc-02.nt b/tests/ntriples-2013/nt-syntax-bad-esc-02.nt new file mode 100644 index 00000000..72711d49 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-esc-02.nt @@ -0,0 +1,2 @@ +# Bad string escape +<http://example/s> <http://example/p> "\uWXYZ" . diff --git a/tests/ntriples-2013/nt-syntax-bad-esc-03.nt b/tests/ntriples-2013/nt-syntax-bad-esc-03.nt new file mode 100644 index 00000000..3a4522fc --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-esc-03.nt @@ -0,0 +1,2 @@ +# Bad string escape +<http://example/s> <http://example/p> "\U0000WXYZ" . diff --git a/tests/ntriples-2013/nt-syntax-bad-lang-01.nt b/tests/ntriples-2013/nt-syntax-bad-lang-01.nt new file mode 100644 index 00000000..a4d952c8 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-lang-01.nt @@ -0,0 +1,2 @@ +# Bad lang tag +<http://example/s> <http://example/p> "string"@1 . diff --git a/tests/ntriples-2013/nt-syntax-bad-num-01.nt b/tests/ntriples-2013/nt-syntax-bad-num-01.nt new file mode 100644 index 00000000..2be6f516 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-num-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> 1 . diff --git a/tests/ntriples-2013/nt-syntax-bad-num-02.nt b/tests/ntriples-2013/nt-syntax-bad-num-02.nt new file mode 100644 index 00000000..e1d5b06c --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-num-02.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> 1.0 . diff --git a/tests/ntriples-2013/nt-syntax-bad-num-03.nt b/tests/ntriples-2013/nt-syntax-bad-num-03.nt new file mode 100644 index 00000000..a9be82fc --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-num-03.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> 1.0e0 . diff --git a/tests/ntriples-2013/nt-syntax-bad-prefix-01.nt b/tests/ntriples-2013/nt-syntax-bad-prefix-01.nt new file mode 100644 index 00000000..89e08cc7 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-prefix-01.nt @@ -0,0 +1 @@ +@prefix : <http://example/> . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-01.nt b/tests/ntriples-2013/nt-syntax-bad-string-01.nt new file mode 100644 index 00000000..988af87a --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "abc' . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-02.nt b/tests/ntriples-2013/nt-syntax-bad-string-02.nt new file mode 100644 index 00000000..e1d5b06c --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-02.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> 1.0 . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-03.nt b/tests/ntriples-2013/nt-syntax-bad-string-03.nt new file mode 100644 index 00000000..64d343da --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-03.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> 1.0e1 . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-04.nt b/tests/ntriples-2013/nt-syntax-bad-string-04.nt new file mode 100644 index 00000000..af4ff28f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-04.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> '''abc''' . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-05.nt b/tests/ntriples-2013/nt-syntax-bad-string-05.nt new file mode 100644 index 00000000..75ad4b2b --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-05.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> """abc""" . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-06.nt b/tests/ntriples-2013/nt-syntax-bad-string-06.nt new file mode 100644 index 00000000..56dcbc60 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-06.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "abc . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-07.nt b/tests/ntriples-2013/nt-syntax-bad-string-07.nt new file mode 100644 index 00000000..7f1ee800 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-07.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> abc" . diff --git a/tests/ntriples-2013/nt-syntax-bad-struct-01.nt b/tests/ntriples-2013/nt-syntax-bad-struct-01.nt new file mode 100644 index 00000000..d546d564 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-struct-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> <http://example/o>, <http://example/o2> . diff --git a/tests/ntriples-2013/nt-syntax-bad-struct-02.nt b/tests/ntriples-2013/nt-syntax-bad-struct-02.nt new file mode 100644 index 00000000..1f388c6e --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-struct-02.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> <http://example/o>; <http://example/p2>, <http://example/o2> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-01.nt b/tests/ntriples-2013/nt-syntax-bad-uri-01.nt new file mode 100644 index 00000000..0e69dc0c --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-01.nt @@ -0,0 +1,2 @@ +# Bad IRI : space. +<http://example/ space> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-02.nt b/tests/ntriples-2013/nt-syntax-bad-uri-02.nt new file mode 100644 index 00000000..36d91af9 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-02.nt @@ -0,0 +1,2 @@ +# Bad IRI : bad escape +<http://example/\u00ZZ11> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-03.nt b/tests/ntriples-2013/nt-syntax-bad-uri-03.nt new file mode 100644 index 00000000..f512345f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-03.nt @@ -0,0 +1,2 @@ +# Bad IRI : bad escape +<http://example/\U00ZZ1111> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-04.nt b/tests/ntriples-2013/nt-syntax-bad-uri-04.nt new file mode 100644 index 00000000..5cab062c --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-04.nt @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. +<http://example/\n> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-05.nt b/tests/ntriples-2013/nt-syntax-bad-uri-05.nt new file mode 100644 index 00000000..be0a21e0 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-05.nt @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. +<http://example/\/> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-06.nt b/tests/ntriples-2013/nt-syntax-bad-uri-06.nt new file mode 100644 index 00000000..b4e64592 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-06.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples +<s> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-07.nt b/tests/ntriples-2013/nt-syntax-bad-uri-07.nt new file mode 100644 index 00000000..74534dde --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-07.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples +<http://example/s> <p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-08.nt b/tests/ntriples-2013/nt-syntax-bad-uri-08.nt new file mode 100644 index 00000000..41a953d4 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-08.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples +<http://example/s> <http://example/p> <o> . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-09.nt b/tests/ntriples-2013/nt-syntax-bad-uri-09.nt new file mode 100644 index 00000000..58821da8 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-09.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples +<http://example/s> <http://example/p> "foo"^^<dt> . diff --git a/tests/ntriples-2013/nt-syntax-bnode-01.nt b/tests/ntriples-2013/nt-syntax-bnode-01.nt new file mode 100644 index 00000000..5fb0d0f9 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bnode-01.nt @@ -0,0 +1 @@ +_:a <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-bnode-02.nt b/tests/ntriples-2013/nt-syntax-bnode-02.nt new file mode 100644 index 00000000..737e81b4 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bnode-02.nt @@ -0,0 +1,2 @@ +<http://example/s> <http://example/p> _:a . +_:a <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-datatypes-01.nt b/tests/ntriples-2013/nt-syntax-datatypes-01.nt new file mode 100644 index 00000000..91263091 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-datatypes-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "123"^^<http://www.w3.org/2001/XMLSchema#byte> . diff --git a/tests/ntriples-2013/nt-syntax-datatypes-02.nt b/tests/ntriples-2013/nt-syntax-datatypes-02.nt new file mode 100644 index 00000000..d49cc27d --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-datatypes-02.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "123"^^<http://www.w3.org/2001/XMLSchema#string> . diff --git a/tests/ntriples-2013/nt-syntax-file-01.nt b/tests/ntriples-2013/nt-syntax-file-01.nt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-file-01.nt diff --git a/tests/ntriples-2013/nt-syntax-file-02.nt b/tests/ntriples-2013/nt-syntax-file-02.nt new file mode 100644 index 00000000..e6d327d5 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-file-02.nt @@ -0,0 +1 @@ +#Empty file. diff --git a/tests/ntriples-2013/nt-syntax-file-03.nt b/tests/ntriples-2013/nt-syntax-file-03.nt new file mode 100644 index 00000000..a9ca0358 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-file-03.nt @@ -0,0 +1,2 @@ +#One comment, one empty line. + diff --git a/tests/ntriples-2013/nt-syntax-str-esc-01.nt b/tests/ntriples-2013/nt-syntax-str-esc-01.nt new file mode 100644 index 00000000..3925f2ec --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-str-esc-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "a\n" . diff --git a/tests/ntriples-2013/nt-syntax-str-esc-02.nt b/tests/ntriples-2013/nt-syntax-str-esc-02.nt new file mode 100644 index 00000000..e7d032f0 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-str-esc-02.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "a\u0020b" . diff --git a/tests/ntriples-2013/nt-syntax-str-esc-03.nt b/tests/ntriples-2013/nt-syntax-str-esc-03.nt new file mode 100644 index 00000000..b8588c79 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-str-esc-03.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "a\U00000020b" . diff --git a/tests/ntriples-2013/nt-syntax-string-01.nt b/tests/ntriples-2013/nt-syntax-string-01.nt new file mode 100644 index 00000000..5333aefe --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-string-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "string" . diff --git a/tests/ntriples-2013/nt-syntax-string-02.nt b/tests/ntriples-2013/nt-syntax-string-02.nt new file mode 100644 index 00000000..1ab55a33 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-string-02.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "string"@en . diff --git a/tests/ntriples-2013/nt-syntax-string-03.nt b/tests/ntriples-2013/nt-syntax-string-03.nt new file mode 100644 index 00000000..b34ca0f6 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-string-03.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> "string"@en-uk . diff --git a/tests/ntriples-2013/nt-syntax-subm-01.nt b/tests/ntriples-2013/nt-syntax-subm-01.nt new file mode 100644 index 00000000..91b49889 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-subm-01.nt @@ -0,0 +1,79 @@ +# +# Copyright World Wide Web Consortium, (Massachusetts Institute of +# Technology, Institut National de Recherche en Informatique et en +# Automatique, Keio University). +# +# All Rights Reserved. +# +# Please see the full Copyright clause at +# <http://www.w3.org/Consortium/Legal/copyright-software.html> +# +# Test file with a variety of legal N-Triples +# +# Dave Beckett - http://purl.org/net/dajobe/ +# +# $Id: test.nt,v 1.7 2003/10/06 15:52:19 dbeckett2 Exp $ +# +##################################################################### + +# comment lines + # comment line after whitespace +# empty blank line, then one with spaces and tabs + + +<http://example.org/resource1> <http://example.org/property> <http://example.org/resource2> . +_:anon <http://example.org/property> <http://example.org/resource2> . +<http://example.org/resource2> <http://example.org/property> _:anon . +# spaces and tabs throughout: + <http://example.org/resource3> <http://example.org/property> <http://example.org/resource2> . + +# line ending with CR NL (ASCII 13, ASCII 10) +<http://example.org/resource4> <http://example.org/property> <http://example.org/resource2> . + +# 2 statement lines separated by single CR (ASCII 10) +<http://example.org/resource5> <http://example.org/property> <http://example.org/resource2> . +<http://example.org/resource6> <http://example.org/property> <http://example.org/resource2> . + + +# All literal escapes +<http://example.org/resource7> <http://example.org/property> "simple literal" . +<http://example.org/resource8> <http://example.org/property> "backslash:\\" . +<http://example.org/resource9> <http://example.org/property> "dquote:\"" . +<http://example.org/resource10> <http://example.org/property> "newline:\n" . +<http://example.org/resource11> <http://example.org/property> "return\r" . +<http://example.org/resource12> <http://example.org/property> "tab:\t" . + +# Space is optional before final . +<http://example.org/resource13> <http://example.org/property> <http://example.org/resource2>. +<http://example.org/resource14> <http://example.org/property> "x". +<http://example.org/resource15> <http://example.org/property> _:anon. + +# \u and \U escapes +# latin small letter e with acute symbol \u00E9 - 3 UTF-8 bytes #xC3 #A9 +<http://example.org/resource16> <http://example.org/property> "\u00E9" . +# Euro symbol \u20ac - 3 UTF-8 bytes #xE2 #x82 #xAC +<http://example.org/resource17> <http://example.org/property> "\u20AC" . +# resource18 test removed +# resource19 test removed +# resource20 test removed + +# XML Literals as Datatyped Literals +<http://example.org/resource21> <http://example.org/property> ""^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource22> <http://example.org/property> " "^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource23> <http://example.org/property> "x"^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource23> <http://example.org/property> "\""^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource24> <http://example.org/property> "<a></a>"^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource25> <http://example.org/property> "a <b></b>"^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource26> <http://example.org/property> "a <b></b> c"^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource26> <http://example.org/property> "a\n<b></b>\nc"^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +<http://example.org/resource27> <http://example.org/property> "chat"^^<http://www.w3.org/2000/01/rdf-schema#XMLLiteral> . +# resource28 test removed 2003-08-03 +# resource29 test removed 2003-08-03 + +# Plain literals with languages +<http://example.org/resource30> <http://example.org/property> "chat"@fr . +<http://example.org/resource31> <http://example.org/property> "chat"@en . + +# Typed Literals +<http://example.org/resource32> <http://example.org/property> "abc"^^<http://example.org/datatype1> . +# resource33 test removed 2003-08-03 diff --git a/tests/ntriples-2013/nt-syntax-uri-01.nt b/tests/ntriples-2013/nt-syntax-uri-01.nt new file mode 100644 index 00000000..02e6ba98 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-01.nt @@ -0,0 +1 @@ +<http://example/s> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-uri-02.nt b/tests/ntriples-2013/nt-syntax-uri-02.nt new file mode 100644 index 00000000..664feea1 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-02.nt @@ -0,0 +1,2 @@ +# x53 is capital S +<http://example/\u0053> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-uri-03.nt b/tests/ntriples-2013/nt-syntax-uri-03.nt new file mode 100644 index 00000000..b5aeb26e --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-03.nt @@ -0,0 +1,2 @@ +# x53 is capital S +<http://example/\U00000053> <http://example/p> <http://example/o> . diff --git a/tests/ntriples-2013/nt-syntax-uri-04.nt b/tests/ntriples-2013/nt-syntax-uri-04.nt new file mode 100644 index 00000000..49bacca7 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-04.nt @@ -0,0 +1,2 @@ +# IRI with all chars in it. +<http://example/s> <http://example/p> <scheme:!$%25&'()*+,-./0123456789:/@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~?#> . |