Skip to content

Commit

Permalink
Update to Turtle tests for reified triples, triple terms, and other T…
Browse files Browse the repository at this point in the history
…urtle syntax.
  • Loading branch information
gkellogg committed Aug 15, 2024
1 parent 74ade4e commit 5ebe8db
Show file tree
Hide file tree
Showing 26 changed files with 141 additions and 52 deletions.
2 changes: 1 addition & 1 deletion rdf/rdf12/rdf-turtle/eval/turtle-star-eval-03.ttl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PREFIX : <http://example/>

<< :i | :s :p :o >> :q :z .
<< :s :p :o ~ :i >> :q :z .
2 changes: 1 addition & 1 deletion rdf/rdf12/rdf-turtle/eval/turtle-star-eval-04.ttl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PREFIX : <http://example/>

:a :q << :i | :s :p :o >> .
:a :q << :s :p :o ~ :i >> .
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PREFIX : <http://example/>

:s :p :o {| :i | :r :z |} .
:s :p :o ~ :i {| :r :z |} .
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PREFIX : <http://example/>

:s :p :o {| :i | :r :z |} .
:s :p :o ~ :i {| :r :z |} .
156 changes: 110 additions & 46 deletions rdf/rdf12/rdf-turtle/syntax/manifest.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ trs:manifest rdf:type mf:Manifest ;
(
trs:turtle-star-1
trs:turtle-star-2
trs:turtle-star-3
trs:turtle-star-4
trs:turtle-star-5
trs:turtle-star-6

trs:turtle-star-inside-1
trs:turtle-star-inside-2
Expand All @@ -42,16 +46,16 @@ trs:manifest rdf:type mf:Manifest ;
trs:turtle-star-bnode-3

trs:turtle-star-bad-1
trs:turtle-star-bad-2
trs:turtle-star-bad-3
trs:turtle-star-bad-4
trs:turtle-star-bad-5
trs:turtle-star-bad-6
# trs:turtle-star-bad-6
trs:turtle-star-bad-7
trs:turtle-star-bad-8

trs:turtle-star-ann-1
trs:turtle-star-ann-2
trs:turtle-star-ann-3
trs:turtle-star-ann-4

trs:turtle-star-bad-ann-1
trs:turtle-star-bad-ann-2
Expand All @@ -67,11 +71,16 @@ trs:manifest rdf:type mf:Manifest ;

trs:nt-ttl-star-nested-1

trs:nt-ttl-star-bad-1
trs:nt-ttl-star-bad-2
trs:nt-ttl-star-bad-3
trs:nt-ttl-star-bad-4
trs:nt-ttl-star-bad-5
trs:nt-ttl-star-bad-01
trs:nt-ttl-star-bad-02
trs:nt-ttl-star-bad-03
trs:nt-ttl-star-bad-04
trs:nt-ttl-star-bad-05
trs:nt-ttl-star-bad-06
trs:nt-ttl-star-bad-07
trs:nt-ttl-star-bad-08
trs:nt-ttl-star-bad-09
trs:nt-ttl-star-bad-10

## Base direction

Expand All @@ -85,42 +94,62 @@ trs:manifest rdf:type mf:Manifest ;
## Good Syntax

trs:turtle-star-1 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - subject quoted triple" ;
mf:name "Turtle-star - subject reified triple" ;
mf:action <turtle-star-syntax-basic-01.ttl> ;
.

trs:turtle-star-2 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - object quoted triple" ;
mf:name "Turtle-star - object reified triple" ;
mf:action <turtle-star-syntax-basic-02.ttl> ;
.

trs:turtle-star-3 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - triple term object" ;
mf:action <turtle-star-syntax-basic-03.ttl> ;
.

trs:turtle-star-4 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - reified triple outside triple" ;
mf:action <turtle-star-syntax-basic-04.ttl> ;
.

trs:turtle-star-5 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - reified with list object" ;
mf:action <turtle-star-syntax-basic-05.ttl> ;
.

trs:turtle-star-6 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - compound blank node expression";
mf:action <turtle-star-syntax-basic-06.ttl> ;
.

trs:turtle-star-inside-1 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - quoted triple inside blankNodePropertyList" ;
mf:name "Turtle-star - reified triple inside blankNodePropertyList" ;
mf:action <turtle-star-syntax-inside-01.ttl> ;
.

trs:turtle-star-inside-2 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - quoted triple inside collection" ;
mf:name "Turtle-star - reified triple inside collection" ;
mf:action <turtle-star-syntax-inside-02.ttl> ;
.

trs:turtle-star-inside-3 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - quoted triple with IRI identifier" ;
mf:name "Turtle-star - reified triple with IRI identifier" ;
mf:action <turtle-star-syntax-inside-03.ttl> ;
.

trs:turtle-star-inside-4 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - quoted triple with blank node identifier" ;
mf:name "Turtle-star - reified triple with blank node identifier" ;
mf:action <turtle-star-syntax-inside-04.ttl> ;
.

trs:turtle-star-nested-1 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - nested quoted triple, subject position" ;
mf:name "Turtle-star - nested reified triple, subject position" ;
mf:action <turtle-star-syntax-nested-01.ttl> ;
.

trs:turtle-star-nested-2 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - nested quoted triple, object position" ;
mf:name "Turtle-star - nested reified triple, object position" ;
mf:action <turtle-star-syntax-nested-02.ttl> ;
.

Expand All @@ -147,42 +176,27 @@ trs:turtle-star-bnode-3 rdf:type rdft:TestTurtlePositiveSyntax ;
## Bad Syntax

trs:turtle-star-bad-1 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - quoted triple as predicate" ;
mf:name "Turtle-star - bad - reified triple as predicate" ;
mf:action <turtle-star-syntax-bad-01.ttl> ;
.

trs:turtle-star-bad-2 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - quoted triple outside triple" ;
mf:action <turtle-star-syntax-bad-02.ttl> ;
.

trs:turtle-star-bad-3 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - collection list in quoted triple" ;
mf:action <turtle-star-syntax-bad-03.ttl> ;
.

trs:turtle-star-bad-4 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - literal in subject position of quoted triple" ;
mf:name "Turtle-star - bad - literal in subject position of reified triple" ;
mf:action <turtle-star-syntax-bad-04.ttl> ;
.

trs:turtle-star-bad-5 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - blank node as predicate in quoted triple";
mf:name "Turtle-star - bad - blank node as predicate in reified triple";
mf:action <turtle-star-syntax-bad-05.ttl> ;
.

trs:turtle-star-bad-6 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - compound blank node expression";
mf:action <turtle-star-syntax-bad-06.ttl> ;
.

trs:turtle-star-bad-7 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - incomplete quoted triple";
mf:name "Turtle-star - bad - incomplete reified triple";
mf:action <turtle-star-syntax-bad-07.ttl> ;
.

trs:turtle-star-bad-8 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "Turtle-star - bad - over-long quoted triple";
mf:name "Turtle-star - bad - over-long reified triple";
mf:action <turtle-star-syntax-bad-08.ttl> ;
.

Expand All @@ -198,6 +212,36 @@ trs:turtle-star-ann-2 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:action <turtle-star-annotation-2.ttl> ;
.

trs:turtle-star-ann-3 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - Annotation predicateObjecetList" ;
mf:action <turtle-star-annotation-3.ttl> ;
.

trs:turtle-star-ann-4 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - Annotation followed by predicate/object" ;
mf:action <turtle-star-annotation-4.ttl> ;
.

trs:turtle-star-ann-5 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - Reifier without annotation block" ;
mf:action <turtle-star-annotation-5.ttl> ;
.

trs:turtle-star-ann-6 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - Empty reifier without annotation block" ;
mf:action <turtle-star-annotation-6.ttl> ;
.

trs:turtle-star-ann-7 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - Reifier with annotation block" ;
mf:action <turtle-star-annotation-7.ttl> ;
.

trs:turtle-star-ann-8 rdf:type rdft:TestTurtlePositiveSyntax ;
mf:name "Turtle-star - Empty reifier with annotation block" ;
mf:action <turtle-star-annotation-8.ttl> ;
.

## Bad annotation syntax

trs:turtle-star-bad-ann-1 rdf:type rdft:TestTurtleNegativeSyntax ;
Expand Down Expand Up @@ -255,29 +299,49 @@ trs:nt-ttl-star-nested-1 rdf:type rdft:TestTurtlePositiveSyntax ;

## Bad syntax

trs:nt-ttl-star-bad-1 rdf:type rdft:TestTurtleNegativeSyntax ;
trs:nt-ttl-star-bad-01 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - triple term as predicate" ;
mf:action <nt-ttl-star-bad-syntax-1.ttl> ;
mf:action <nt-ttl-star-bad-syntax-01.ttl> ;
.

trs:nt-ttl-star-bad-2 rdf:type rdft:TestTurtleNegativeSyntax ;
trs:nt-ttl-star-bad-02 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - triple term, literal subject" ;
mf:action <nt-ttl-star-bad-syntax-2.ttl> ;
mf:action <nt-ttl-star-bad-syntax-02.ttl> ;
.

trs:nt-ttl-star-bad-3 rdf:type rdft:TestTurtleNegativeSyntax ;
trs:nt-ttl-star-bad-03 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - triple term, literal predicate" ;
mf:action <nt-ttl-star-bad-syntax-3.ttl> ;
mf:action <nt-ttl-star-bad-syntax-03.ttl> ;
.

trs:nt-ttl-star-bad-4 rdf:type rdft:TestTurtleNegativeSyntax ;
trs:nt-ttl-star-bad-04 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - triple term, blank node predicate" ;
mf:action <nt-ttl-star-bad-syntax-4.ttl> ;
mf:action <nt-ttl-star-bad-syntax-04.ttl> ;
.

trs:nt-ttl-star-bad-5 rdf:type rdft:TestTurtleNegativeSyntax ;
trs:nt-ttl-star-bad-05 rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - triple term as subject" ;
mf:action <nt-ttl-star-bad-syntax-5.ttl> ;
mf:action <nt-ttl-star-bad-syntax-05.ttl> ;
.

trs:nt-ttl-star-bad-06 rdf:type rdft:TestNTriplesNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - reified triple as predicate" ;
mf:action <nt-ttl-star-bad-syntax-06.ttl> ;
.

trs:nt-ttl-star-bad-07 rdf:type rdft:TestNTriplesNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - reified triple, literal subject" ;
mf:action <nt-ttl-star-bad-syntax-07.ttl> ;
.

trs:nt-ttl-star-bad-08 rdf:type rdft:TestNTriplesNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - reified triple, literal predicate" ;
mf:action <nt-ttl-star-bad-syntax-08.ttl> ;
.

trs:nt-ttl-star-bad-09 rdf:type rdft:TestNTriplesNegativeSyntax ;
mf:name "N-Triples-star as Turtle-star - Bad - reified triple, blank node predicate" ;
mf:action <nt-ttl-star-bad-syntax-09.ttl> ;
.

trs:nt-ttl-base-bad-1 rdf:type rdft:TestTurtleNegativeSyntax ;
Expand Down
1 change: 1 addition & 0 deletions rdf/rdf12/rdf-turtle/syntax/nt-ttl-star-bad-syntax-06.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<http://example/a> <<( <http://example/s> <http://example/p> <http://example/o> )>> <http://example/z> .
1 change: 1 addition & 0 deletions rdf/rdf12/rdf-turtle/syntax/nt-ttl-star-bad-syntax-07.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<< "XYZ" <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
1 change: 1 addition & 0 deletions rdf/rdf12/rdf-turtle/syntax/nt-ttl-star-bad-syntax-08.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<< <http://example/s> "XYZ" <http://example/o> >> <http://example/q> <http://example/z> .
1 change: 1 addition & 0 deletions rdf/rdf12/rdf-turtle/syntax/nt-ttl-star-bad-syntax-09.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<< <http://example/s> _:label <http://example/o> >> <http://example/q> <http://example/z> .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-annotation-3.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p :o {| :q1 :r1 ; :q2 :r2 ; |} .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-annotation-4.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p :o {| :x :y |} ; :q :r .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-annotation-5.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p :o ~:e .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-annotation-6.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p :o ~ .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-annotation-7.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p :o ~:e {| :q :r |} .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-annotation-8.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p :o ~ {| :q :r |} .
3 changes: 3 additions & 0 deletions rdf/rdf12/rdf-turtle/syntax/turtle-star-syntax-basic-03.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PREFIX : <http://example/>

:s :p <<(:s :p :o )>> .
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PREFIX : <http://example/>

:s :p <<:id | :s :p :o1>> .
:s :p << :s :p :o1 ~ :id >> .
:id :q 123 .
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PREFIX : <http://example/>

:s :p <<_:id | :s :p :o1>> .
:s :p <<:s :p :o1 ~_:id>> .
_:id :q 123 .

0 comments on commit 5ebe8db

Please sign in to comment.