From f43066a36f98b89b4d853d3168ff0fe2edeb41d7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 5 Apr 2023 16:30:39 -0400 Subject: Improve pretty-printing of lists and inline subjects --- test/extra/pretty/abbreviation.ttl | 3 ++- test/extra/pretty/anonymous-in-list-object.ttl | 3 ++- test/extra/pretty/graph-abbreviation.trig | 3 ++- test/extra/pretty/inline-blank-subject.ttl | 3 ++- test/extra/pretty/inline-blanks-and-lists.ttl | 17 ++++++++++++++++- test/extra/pretty/inline-list-subject.ttl | 3 ++- test/extra/pretty/list-subject-with-extras.ttl | 9 +++++++++ test/extra/pretty/list-subject-with-list-extras.ttl | 12 ++++++++++++ test/extra/pretty/list-subject.ttl | 3 ++- test/extra/pretty/manifest.ttl | 21 +++++++++++++++++++++ .../pretty/nested-list-object-with-empty-lists.ttl | 11 +++++++++++ test/extra/pretty/nested-list-object.ttl | 3 ++- test/extra/pretty/nested-list-subject.ttl | 6 ++++-- 13 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 test/extra/pretty/list-subject-with-extras.ttl create mode 100644 test/extra/pretty/list-subject-with-list-extras.ttl create mode 100644 test/extra/pretty/nested-list-object-with-empty-lists.ttl (limited to 'test/extra/pretty') diff --git a/test/extra/pretty/abbreviation.ttl b/test/extra/pretty/abbreviation.ttl index bf46f6d5..95f43c88 100644 --- a/test/extra/pretty/abbreviation.ttl +++ b/test/extra/pretty/abbreviation.ttl @@ -51,7 +51,8 @@ eg:s7 eg:listOfResources ( [ eg:value 7 - ] [ + ] + [ eg:value 8 ] ) . diff --git a/test/extra/pretty/anonymous-in-list-object.ttl b/test/extra/pretty/anonymous-in-list-object.ttl index 4f135e29..a6b202f4 100644 --- a/test/extra/pretty/anonymous-in-list-object.ttl +++ b/test/extra/pretty/anonymous-in-list-object.ttl @@ -4,7 +4,8 @@ eg:s eg:p ( [ a eg:Spy - ] [ + ] + [ a eg:Ninja ] ) . diff --git a/test/extra/pretty/graph-abbreviation.trig b/test/extra/pretty/graph-abbreviation.trig index 8ec75f6e..c6d5e32e 100644 --- a/test/extra/pretty/graph-abbreviation.trig +++ b/test/extra/pretty/graph-abbreviation.trig @@ -53,7 +53,8 @@ :lists ( [ rdf:value 7 - ] [ + ] + [ rdf:value 8 ] ) . diff --git a/test/extra/pretty/inline-blank-subject.ttl b/test/extra/pretty/inline-blank-subject.ttl index 8f5de39c..87ea8051 100644 --- a/test/extra/pretty/inline-blank-subject.ttl +++ b/test/extra/pretty/inline-blank-subject.ttl @@ -2,4 +2,5 @@ [ a eg:BlankSubject -] eg:isA eg:Blank . +] + eg:isA eg:Blank . diff --git a/test/extra/pretty/inline-blanks-and-lists.ttl b/test/extra/pretty/inline-blanks-and-lists.ttl index c57482d3..3fdfa4ee 100644 --- a/test/extra/pretty/inline-blanks-and-lists.ttl +++ b/test/extra/pretty/inline-blanks-and-lists.ttl @@ -46,7 +46,22 @@ eg:s2 [] , eg:o22 , () , - eg:o23 . + eg:o23 , + [] , + eg:o24 , + [ + a eg:Child + ] , + [] , + eg:o25 , + [ + a eg:FirstChild + ] , [ + a eg:SecondChild + ] , + () , + eg:o26 , + eg:o27 . eg:s3 a eg:Thing ; diff --git a/test/extra/pretty/inline-list-subject.ttl b/test/extra/pretty/inline-list-subject.ttl index a3f8ac18..7591f0e1 100644 --- a/test/extra/pretty/inline-list-subject.ttl +++ b/test/extra/pretty/inline-list-subject.ttl @@ -3,4 +3,5 @@ ( eg:item1 eg:item2 -) eg:isA eg:List . +) + eg:isA eg:List . diff --git a/test/extra/pretty/list-subject-with-extras.ttl b/test/extra/pretty/list-subject-with-extras.ttl new file mode 100644 index 00000000..dcfb8753 --- /dev/null +++ b/test/extra/pretty/list-subject-with-extras.ttl @@ -0,0 +1,9 @@ +@prefix eg: . + +( + "apple" + "banana" + "cherry" +) + eg:with eg:someProperties ; + a eg:ExampleList . diff --git a/test/extra/pretty/list-subject-with-list-extras.ttl b/test/extra/pretty/list-subject-with-list-extras.ttl new file mode 100644 index 00000000..0a0cd0e0 --- /dev/null +++ b/test/extra/pretty/list-subject-with-list-extras.ttl @@ -0,0 +1,12 @@ +@prefix eg: . + +( + "apple" + "banana" + "cherry" +) + eg:list ( + "asparagus" + "beet" + "carrot" + ) . diff --git a/test/extra/pretty/list-subject.ttl b/test/extra/pretty/list-subject.ttl index 927f56f3..eb1c7a2e 100644 --- a/test/extra/pretty/list-subject.ttl +++ b/test/extra/pretty/list-subject.ttl @@ -4,4 +4,5 @@ "apple" "banana" "cherry" -) a eg:ExampleList . +) + a eg:ExampleList . diff --git a/test/extra/pretty/manifest.ttl b/test/extra/pretty/manifest.ttl index 6921b741..6422c9e0 100644 --- a/test/extra/pretty/manifest.ttl +++ b/test/extra/pretty/manifest.ttl @@ -25,12 +25,15 @@ <#list-in-object> <#list-object> <#list-subject> + <#list-subject-with-extras> + <#list-subject-with-list-extras> <#local-name-escapes> <#long-string-escapes> <#long-string-quotes> <#many-objects> <#named-graph> <#nested-list-object> + <#nested-list-object-with-empty-lists> <#relative-uris> <#short-string-escapes> <#uri-escapes> @@ -145,6 +148,18 @@ mf:name "list-subject" ; mf:result . +<#list-subject-with-extras> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "list-subject-with-extras" ; + mf:result . + +<#list-subject-with-list-extras> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "list-subject-with-list-extras" ; + mf:result . + <#local-name-escapes> a rdft:TestTurtleEval ; mf:action ; @@ -181,6 +196,12 @@ mf:name "nested-list-object" ; mf:result . +<#nested-list-object-with-empty-lists> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "nested-list-object-with-empty-lists" ; + mf:result . + <#nested-list-subject> a rdft:TestTurtleEval ; mf:action ; diff --git a/test/extra/pretty/nested-list-object-with-empty-lists.ttl b/test/extra/pretty/nested-list-object-with-empty-lists.ttl new file mode 100644 index 00000000..4760fd2b --- /dev/null +++ b/test/extra/pretty/nested-list-object-with-empty-lists.ttl @@ -0,0 +1,11 @@ +@prefix eg: . + +eg:s + eg:list ( + ( + () + ) + ( + () + ) + ) . diff --git a/test/extra/pretty/nested-list-object.ttl b/test/extra/pretty/nested-list-object.ttl index d2177ba3..c4b1898f 100644 --- a/test/extra/pretty/nested-list-object.ttl +++ b/test/extra/pretty/nested-list-object.ttl @@ -5,7 +5,8 @@ eg:s ( eg:l1e1 eg:l1e2 - ) ( + ) + ( eg:l2e1 eg:l2e2 ) diff --git a/test/extra/pretty/nested-list-subject.ttl b/test/extra/pretty/nested-list-subject.ttl index 128197c0..b32aa133 100644 --- a/test/extra/pretty/nested-list-subject.ttl +++ b/test/extra/pretty/nested-list-subject.ttl @@ -4,8 +4,10 @@ ( eg:l1e1 eg:l1e2 - ) ( + ) + ( eg:l2e1 eg:l2e2 ) -) a eg:ExampleList . +) + a eg:ExampleList . -- cgit v1.2.1