From 89be71eabefcc55a3d0a56d7bed7124c4fdafbd8 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. --- test/good/pretty.trig | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 test/good/pretty.trig (limited to 'test/good/pretty.trig') diff --git a/test/good/pretty.trig b/test/good/pretty.trig new file mode 100644 index 00000000..140769ce --- /dev/null +++ b/test/good/pretty.trig @@ -0,0 +1,98 @@ +@prefix : . +@prefix rdf: . + +:a + :b :c , + :d , + :e ; + :f :g , + :h . + +( + 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 + ] + ) . + +:s + a :Thing ; + :predicate1 :object1 , + [ + a :SubThing ; + :predicate2 :object2 + ] , [ + a :OtherSubThing ; + :p3 :o3 + ] ; + :p4 :o4 . + +eg:graph { + :a + :b :c ; + :d [ + :e :f + ] . +} -- cgit v1.2.1