From 271ba679ed9652ed91c9e3a0c0a13e50f8eb8ae4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Oct 2018 20:57:33 +0200 Subject: Simplify streaming API and improve pretty printing This removes the obligation from the caller to correctly maintain flags to describe the current anonymous context, instead making the writer handle this itself as much as possible. Flags remain for the cases the writer can not infer from context: the start of anonymous subject and object nodes. --- tests/good/base.ttl | 1 - tests/good/pretty.trig | 84 ++++++++++++++++++++++++++++++++++++++++++++++ tests/good/qualify-out.ttl | 1 - 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 tests/good/pretty.trig (limited to 'tests') diff --git a/tests/good/base.ttl b/tests/good/base.ttl index 4c437937..755c1d09 100644 --- a/tests/good/base.ttl +++ b/tests/good/base.ttl @@ -1,3 +1,2 @@ a . - diff --git a/tests/good/pretty.trig b/tests/good/pretty.trig new file mode 100644 index 00000000..a6f8ebcf --- /dev/null +++ b/tests/good/pretty.trig @@ -0,0 +1,84 @@ +@prefix : . +@prefix rdf: . + +:a + :b :c , + :d , + :e . + +( + 1 +) + :isA :List . + +[] + :isA :Blank . + +( + 2 +) + :sameAs ( + 2 + ) . + +[] + :sameAs [] . + +( + 1 + 2 +) + a :List ; + rdf:value 3 . + +( + ( + 3 + ) + ( + 4 + ) +) + a :NestedList ; + :sum 7 . + +[ + a :BlankSubject +] + a rdf:Resource . + +[ + a :BlankSubject +] . + +[] + :blank [ + :nestedEmptyBlank [] ; + :nestedNonEmptyBlanks [ + rdf:value 1 + ] , [ + rdf:value 2 + ] + ] ; + :lists ( + 3 + 4 + ) , ( + 5 + 6 + ) , ( + [ + rdf:value 7 + ] + [ + rdf:value 8 + ] + ) . + +eg:graph { + :a + :b :c ; + :d [ + :e :f + ] . +} diff --git a/tests/good/qualify-out.ttl b/tests/good/qualify-out.ttl index 97f67a53..42e4091a 100644 --- a/tests/good/qualify-out.ttl +++ b/tests/good/qualify-out.ttl @@ -2,4 +2,3 @@ eg:s eg:p eg:o . - -- cgit v1.2.1