@@ -325,6 +325,24 @@ describe('N3Parser', function () {
325325 [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , 'x' ] ,
326326 [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
327327
328+ it ( 'should parse a list with a literal' ,
329+ shouldParse ( '<a> <b> ("x").' ,
330+ [ 'a' , 'b' , '_:b0' ] ,
331+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"x"' ] ,
332+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
333+
334+ it ( 'should parse a list with a typed literal' ,
335+ shouldParse ( '<a> <b> ("x"^^<y>).' ,
336+ [ 'a' , 'b' , '_:b0' ] ,
337+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"x"^^y' ] ,
338+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
339+
340+ it ( 'should parse a list with a language-tagged literal' ,
341+ shouldParse ( '<a> <b> ("x"@en-GB).' ,
342+ [ 'a' , 'b' , '_:b0' ] ,
343+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"x"@en-gb' ] ,
344+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
345+
328346 it ( 'should parse statements with a multi-element list in the subject' ,
329347 shouldParse ( '(<x> <y>) <a> <b>.' ,
330348 [ '_:b0' , 'a' , 'b' ] ,
@@ -341,6 +359,16 @@ describe('N3Parser', function () {
341359 [ '_:b1' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , 'y' ] ,
342360 [ '_:b1' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
343361
362+ it ( 'should parse statements with a multi-element literal list in the object' ,
363+ shouldParse ( '<a> <b> ("x" "y"@en-GB "z"^^<t>).' ,
364+ [ 'a' , 'b' , '_:b0' ] ,
365+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"x"' ] ,
366+ [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , '_:b1' ] ,
367+ [ '_:b1' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"y"@en-gb' ] ,
368+ [ '_:b1' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , '_:b2' ] ,
369+ [ '_:b2' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"z"^^t' ] ,
370+ [ '_:b2' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
371+
344372 it ( 'should parse statements with prefixed names in lists' ,
345373 shouldParse ( '@prefix a: <a#>. <a> <b> (a:x a:y).' ,
346374 [ 'a' , 'b' , '_:b0' ] ,
@@ -361,12 +389,6 @@ describe('N3Parser', function () {
361389 [ '_:b1' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '_:b0_y' ] ,
362390 [ '_:b1' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
363391
364- it ( 'should parse statements with a list containing strings' ,
365- shouldParse ( '("y") <a> <b>.' ,
366- [ '_:b0' , 'a' , 'b' ] ,
367- [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first' , '"y"' ] ,
368- [ '_:b0' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' ] ) ) ;
369-
370392 it ( 'should parse statements with a nested empty list' ,
371393 shouldParse ( '<a> <b> (<x> ()).' ,
372394 [ 'a' , 'b' , '_:b0' ] ,
0 commit comments