aboutsummaryrefslogtreecommitdiffstats
path: root/tests/good
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-10-21 20:57:33 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commitcd0f6e585a02b26eb42e760fe8fa8b70612cc009 (patch)
treeacff51f98ab8216baa7055bcb6c52354ad7b9e42 /tests/good
parent2c70b584b6b110a85f0a7b1491b40c0de37b7f93 (diff)
downloadserd-cd0f6e585a02b26eb42e760fe8fa8b70612cc009.tar.gz
serd-cd0f6e585a02b26eb42e760fe8fa8b70612cc009.tar.bz2
serd-cd0f6e585a02b26eb42e760fe8fa8b70612cc009.zip
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.
Diffstat (limited to 'tests/good')
-rw-r--r--tests/good/base.ttl1
-rw-r--r--tests/good/pretty.trig98
-rw-r--r--tests/good/qualify-out.ttl1
3 files changed, 98 insertions, 2 deletions
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 @@
<foo>
a <Bar> .
-
diff --git a/tests/good/pretty.trig b/tests/good/pretty.trig
new file mode 100644
index 00000000..140769ce
--- /dev/null
+++ b/tests/good/pretty.trig
@@ -0,0 +1,98 @@
+@prefix : <http://example.org/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+: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
+ ] .
+}
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 .
-