@@ -746,7 +746,7 @@ describe('Parser', () => {
746746
747747 it ( 'should not parse a single opening brace' ,
748748 shouldNotParse ( '{' ,
749- 'Expected entity but got eof on line 1.' ) ) ;
749+ 'Unexpected "{" on line 1.' ) ) ;
750750
751751 it ( 'should not parse a superfluous closing brace ' ,
752752 shouldNotParse ( '{}}' ,
@@ -1044,6 +1044,46 @@ describe('Parser', () => {
10441044 shouldParse ( '<a> <b> <c> <g>.\n<<<a> <b> <c>>> <d> <e>.' ,
10451045 [ 'a' , 'b' , 'c' , 'g' ] ,
10461046 [ [ 'a' , 'b' , 'c' ] , 'd' , 'e' ] ) ) ;
1047+
1048+ it ( 'should parse an RDF* triple using annotation syntax with one predicate-object' ,
1049+ shouldParse ( '<a> <b> <c> {| <b> <c> |}.' ,
1050+ [ 'a' , 'b' , 'c' ] , [ [ 'a' , 'b' , 'c' ] , 'b' , 'c' ] ) ) ;
1051+
1052+ it ( 'should parse an RDF* triple using annotation syntax with two predicate-objects' ,
1053+ shouldParse ( '<a> <b> <c> {| <b1> <c1>; <b2> <c2> |}.' ,
1054+ [ 'a' , 'b' , 'c' ] , [ [ 'a' , 'b' , 'c' ] , 'b1' , 'c1' ] , [ [ 'a' , 'b' , 'c' ] , 'b2' , 'c2' ] ) ) ;
1055+
1056+ it ( 'should parse an RDF* triple using annotation syntax with one predicate-object followed by regular triples' ,
1057+ shouldParse ( '<a> <b> <c> {| <b> <c> |}.\n<a2> <b2> <c2>.' ,
1058+ [ 'a' , 'b' , 'c' ] , [ [ 'a' , 'b' , 'c' ] , 'b' , 'c' ] , [ 'a2' , 'b2' , 'c2' ] ) ) ;
1059+
1060+ it ( 'should not parse an RDF* triple using annotation syntax with zero predicate-objects' ,
1061+ shouldNotParse ( '<a> <b> <c> {| |}' ,
1062+ 'Expected entity but got |} on line 1.' ) ) ;
1063+
1064+ it ( 'should not parse an RDF* triple using an incomplete annotation syntax' ,
1065+ shouldNotParse ( '<a> <b> <c> {| <b> |}' ,
1066+ 'Expected entity but got |} on line 1.' ) ) ;
1067+
1068+ it ( 'should not parse an RDF* triple using an incomplete annotation syntax after a semicolon' ,
1069+ shouldNotParse ( '<a> <b> <c> {| <b1> <c1>; |}' ,
1070+ 'Expected entity but got |} on line 1.' ) ) ;
1071+
1072+ it ( 'should not parse an RDF* triple using an incomplete annotation syntax after a semicolon and entity' ,
1073+ shouldNotParse ( '<a> <b> <c> {| <b1> <c1>; <b2> |}' ,
1074+ 'Expected entity but got |} on line 1.' ) ) ;
1075+
1076+ it ( 'should not parse an RDF* triple using an incomplete annotation syntax that misses |}' ,
1077+ shouldNotParse ( '<a> <b> <c> {| <b1> <c1>' ,
1078+ 'Expected entity but got eof on line 1.' ) ) ;
1079+
1080+ it ( 'should not parse an RDF* triple using an incomplete annotation syntax that misses |} and starts a new subject' ,
1081+ shouldNotParse ( '<a> <b> <c> {| <b1> <c1>. <a2> <b2> <c2>' ,
1082+ 'Expected entity but got eof on line 1.' ) ) ;
1083+
1084+ it ( 'should not parse an out of place |}' ,
1085+ shouldNotParse ( '<a> <b> <c> |}' ,
1086+ 'Unexpected asserted triple closing on line 1.' ) ) ;
10471087 } ) ;
10481088
10491089 describe ( 'An Parser instance without document IRI' , ( ) => {
@@ -1227,6 +1267,10 @@ describe('Parser', () => {
12271267 it ( 'should not parse RDF* in the object position' ,
12281268 shouldNotParse ( parser , '<a> <b> <<a> <b> <c>>>.' ,
12291269 'Unexpected RDF* syntax on line 1.' ) ) ;
1270+
1271+ it ( 'should not parse RDF* with annotated syntax' ,
1272+ shouldNotParse ( parser , '<a> <b> <c> {| <b> <c> |}.' ,
1273+ 'Unexpected RDF* syntax on line 1.' ) ) ;
12301274 } ) ;
12311275
12321276 describe ( 'A Parser instance for the TurtleStar format' , ( ) => {
@@ -1288,6 +1332,10 @@ describe('Parser', () => {
12881332 it ( 'should not parse RDF* in the object position' ,
12891333 shouldNotParse ( parser , '<a> <b> <<<a> <b> <c>>>.' ,
12901334 'Unexpected RDF* syntax on line 1.' ) ) ;
1335+
1336+ it ( 'should not parse RDF* with annotated syntax' ,
1337+ shouldNotParse ( parser , '<a> <b> <c> {| <b> <c> |}.' ,
1338+ 'Unexpected RDF* syntax on line 1.' ) ) ;
12911339 } ) ;
12921340
12931341 describe ( 'A Parser instance for the TriGStar format' , ( ) => {
@@ -1317,6 +1365,10 @@ describe('Parser', () => {
13171365 shouldNotParse ( parser , '_:a <http://ex.org/b> "c" <http://ex.org/g>.' ,
13181366 'Expected punctuation to follow ""c"" on line 1.' ) ) ;
13191367
1368+ it ( 'should not parse object lists' ,
1369+ shouldNotParse ( parser , '<http://example/s> <http://example/p> <http://example/o>, <http://example/o2> .' ,
1370+ 'Unexpected "," on line 1.' ) ) ;
1371+
13201372 it ( 'should not parse relative IRIs' ,
13211373 shouldNotParse ( parser , '<a> <b> <c>.' , 'Invalid IRI on line 1.' ) ) ;
13221374
@@ -1375,6 +1427,10 @@ describe('Parser', () => {
13751427 it ( 'should not parse nested quads' ,
13761428 shouldNotParse ( parser , '<<_:a <http://ex.org/b> _:b <http://ex.org/b>>> <http://ex.org/b> "c" .' ,
13771429 'Expected >> to follow "_:b0_b" on line 1.' ) ) ;
1430+
1431+ it ( 'should not parse annotated triples' ,
1432+ shouldNotParse ( parser , '_:a <http://ex.org/b> _:c {| <http://ex.org/b1> "c1" |} .' ,
1433+ 'Unexpected "{|" on line 1.' ) ) ;
13781434 } ) ;
13791435
13801436 describe ( 'A Parser instance for the N-Quads format' , ( ) => {
@@ -1430,6 +1486,10 @@ describe('Parser', () => {
14301486 it ( 'should parse RDF*' ,
14311487 shouldParse ( parser , '<<_:a <http://example.org/b> _:c>> <http://example.org/a> _:c .' ,
14321488 [ [ '_:b0_a' , 'b' , '_:b0_c' ] , 'a' , '_:b0_c' ] ) ) ;
1489+
1490+ it ( 'should not parse annotated triples' ,
1491+ shouldNotParse ( parser , '_:a <http://ex.org/b> _:c {| <http://ex.org/b1> "c1" |} .' ,
1492+ 'Unexpected "{|" on line 1.' ) ) ;
14331493 } ) ;
14341494
14351495 describe ( 'A Parser instance for the N3 format' , ( ) => {
@@ -1777,6 +1837,10 @@ describe('Parser', () => {
17771837 it ( 'should not parse RDF* in the object position' ,
17781838 shouldNotParse ( parser , '<a> <b> <<<a> <b> <c>>>.' ,
17791839 'Unexpected RDF* syntax on line 1.' ) ) ;
1840+
1841+ it ( 'should not parse RDF* with annotated syntax' ,
1842+ shouldNotParse ( parser , '<a> <b> <c> {| <b> <c> |}.' ,
1843+ 'Unexpected RDF* syntax on line 1.' ) ) ;
17801844 } ) ;
17811845
17821846 describe ( 'A Parser instance for the N3Star format' , ( ) => {
0 commit comments