From 8c67f9eba47d30913749e607c440b170a5cbd804 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 15 Apr 2021 17:52:44 -0400 Subject: [WIP] Expand URIs in reader This expands relative and prefixed URIs in the reader on the stack, rather than passing them to the caller to be dealt with. This pushes these context-full forms to the edge of the system as much as possible to minimise the headaches they can cause. Towards having stricter guarantees about nodes and eliminating the CURIE node type altogether. --- test/extra/bad/bad-prefix-dot.ttl | 1 + test/extra/bad/manifest.ttl | 8 +++++++- test/extra/full/full-uris.ttl | 6 +++--- test/extra/good/manifest.ttl | 14 ++++++++++++++ test/extra/good/test-local-name-ends-with-dot.nt | 1 + test/extra/good/test-local-name-escapes.nt | 17 +++++++++++++++++ test/extra/good/test-local-name-escapes.ttl | 19 +++++++++++++++++++ 7 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 test/extra/bad/bad-prefix-dot.ttl create mode 100644 test/extra/good/test-local-name-ends-with-dot.nt create mode 100644 test/extra/good/test-local-name-escapes.nt create mode 100644 test/extra/good/test-local-name-escapes.ttl (limited to 'test/extra') diff --git a/test/extra/bad/bad-prefix-dot.ttl b/test/extra/bad/bad-prefix-dot.ttl new file mode 100644 index 00000000..7b02211f --- /dev/null +++ b/test/extra/bad/bad-prefix-dot.ttl @@ -0,0 +1 @@ +@prefix dotted.: . diff --git a/test/extra/bad/manifest.ttl b/test/extra/bad/manifest.ttl index cd4aee24..f930b812 100644 --- a/test/extra/bad/manifest.ttl +++ b/test/extra/bad/manifest.ttl @@ -74,8 +74,9 @@ <#bad-object2> <#bad-paths> <#bad-pn-escape> - <#bad-prefix-missing-colon> <#bad-prefix> + <#bad-prefix-dot> + <#bad-prefix-missing-colon> <#bad-quote-in-uri> <#bad-semicolon-after-subject> <#bad-string> @@ -436,6 +437,11 @@ mf:action ; mf:name "bad-prefix-missing-colon" . +<#bad-prefix-dot> + a rdft:TestTurtleNegativeSyntax ; + mf:action ; + mf:name "bad-prefix-dot" . + <#bad-quote-in-uri> a rdft:TestTurtleNegativeSyntax ; mf:action ; diff --git a/test/extra/full/full-uris.ttl b/test/extra/full/full-uris.ttl index cfb048df..dd6c5144 100644 --- a/test/extra/full/full-uris.ttl +++ b/test/extra/full/full-uris.ttl @@ -1,7 +1,7 @@ @prefix eg: . - eg:prefixed false . + false . -eg:s2 - eg:prefixed true . + + true . diff --git a/test/extra/good/manifest.ttl b/test/extra/good/manifest.ttl index 7c356285..11a7ec5e 100644 --- a/test/extra/good/manifest.ttl +++ b/test/extra/good/manifest.ttl @@ -27,6 +27,8 @@ <#test-id> <#test-list-in-blank> <#test-list-subject> + <#test-local-name-ends-with-dot> + <#test-local-name-escapes> <#test-long-backspace-escape> <#test-long-delete-escape> <#test-long-form-feed-escape> @@ -169,6 +171,18 @@ mf:name "test-list-subject" ; mf:result . +<#test-local-name-ends-with-dot> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "test-local-name-ends-with-dot" ; + mf:result . + +<#test-local-name-escapes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "test-local-name-escapes" ; + mf:result . + <#test-long-backspace-escape> a rdft:TestTurtleEval ; mf:action ; diff --git a/test/extra/good/test-local-name-ends-with-dot.nt b/test/extra/good/test-local-name-ends-with-dot.nt new file mode 100644 index 00000000..3285348a --- /dev/null +++ b/test/extra/good/test-local-name-ends-with-dot.nt @@ -0,0 +1 @@ + . diff --git a/test/extra/good/test-local-name-escapes.nt b/test/extra/good/test-local-name-escapes.nt new file mode 100644 index 00000000..a6362d7a --- /dev/null +++ b/test/extra/good/test-local-name-escapes.nt @@ -0,0 +1,17 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/test/extra/good/test-local-name-escapes.ttl b/test/extra/good/test-local-name-escapes.ttl new file mode 100644 index 00000000..8c5fce37 --- /dev/null +++ b/test/extra/good/test-local-name-escapes.ttl @@ -0,0 +1,19 @@ +@prefix eg: . + +eg:s eg:p eg:o\' . +eg:s eg:p eg:o\! . +eg:s eg:p eg:o\# . +eg:s eg:p eg:o\$ . +eg:s eg:p eg:o\% . +eg:s eg:p eg:o\& . +eg:s eg:p eg:o\( . +eg:s eg:p eg:o\) . +eg:s eg:p eg:o\* . +eg:s eg:p eg:o\+ . +eg:s eg:p eg:o\, . +eg:s eg:p eg:o\/ . +eg:s eg:p eg:o\; . +eg:s eg:p eg:o\= . +eg:s eg:p eg:o\? . +eg:s eg:p eg:o\@ . +eg:s eg:p eg:o\~ . -- cgit v1.2.1