@@ -1864,6 +1864,48 @@ describe('Parser', () => {
1864
1864
shouldParse ( parser , '@forSome <x>. <x> <x> <x>.' ,
1865
1865
[ '_:b0' , '_:b0' , '_:b0' ] ) ) ;
1866
1866
1867
+ describe ( 'should parse a named graph in a list' ,
1868
+ shouldParse ( parser , '<s> <p> ({<a> <b> <c>}) .' ,
1869
+ [ 's' , 'p' , '_:b1' ] ,
1870
+ ...list ( [ '_:b1' , '_:b0' ] ) ,
1871
+ [ 'a' , 'b' , 'c' , '_:b0' ]
1872
+ ) ) ;
1873
+
1874
+ describe ( 'should parse a named graph as the second element in a list' ,
1875
+ shouldParse ( parser , '<s> <p> (<x> {<a> <b> <c>}) .' ,
1876
+ [ 's' , 'p' , '_:b0' ] ,
1877
+ ...list ( [ '_:b0' , 'x' ] , [ '_:b2' , '_:b1' ] ) ,
1878
+ [ 'a' , 'b' , 'c' , '_:b1' ]
1879
+ ) ) ;
1880
+
1881
+ describe ( 'should parse a named graph as the second element in a list of 3 elements' ,
1882
+ shouldParse ( parser , '<s> <p> (<x> {<a> <b> <c>} <y>) .' ,
1883
+ [ 's' , 'p' , '_:b0' ] ,
1884
+ ...list ( [ '_:b0' , 'x' ] , [ '_:b2' , '_:b1' ] , [ '_:b3' , 'y' ] ) ,
1885
+ [ 'a' , 'b' , 'c' , '_:b1' ]
1886
+ ) ) ;
1887
+
1888
+ describe ( 'should parse a named graph in a subject list' ,
1889
+ shouldParse ( parser , '({<a> <b> <c>}) <p> <o> .' ,
1890
+ [ '_:b1' , 'p' , 'o' ] ,
1891
+ ...list ( [ '_:b1' , '_:b0' ] ) ,
1892
+ [ 'a' , 'b' , 'c' , '_:b0' ]
1893
+ ) ) ;
1894
+
1895
+ describe ( 'should parse a named graph as the second element in a subject list' ,
1896
+ shouldParse ( parser , '(<x> {<a> <b> <c>}) <p> <o> .' ,
1897
+ [ '_:b0' , 'p' , 'o' ] ,
1898
+ ...list ( [ '_:b0' , 'x' ] , [ '_:b2' , '_:b1' ] ) ,
1899
+ [ 'a' , 'b' , 'c' , '_:b1' ]
1900
+ ) ) ;
1901
+
1902
+ describe ( 'should parse a named graph as the second element in a subject list with 3 elements' ,
1903
+ shouldParse ( parser , '(<x> {<a> <b> <c>} <y>) <p> <o> .' ,
1904
+ [ '_:b0' , 'p' , 'o' ] ,
1905
+ ...list ( [ '_:b0' , 'x' ] , [ '_:b2' , '_:b1' ] , [ '_:b3' , 'y' ] ) ,
1906
+ [ 'a' , 'b' , 'c' , '_:b1' ]
1907
+ ) ) ;
1908
+
1867
1909
describe ( 'should parse a @forSome statement with multiple entities' ,
1868
1910
shouldParse ( parser , '@prefix a: <a:>. @base <b:>. @forSome a:x, <y>, a:z. a:x <y> a:z.' ,
1869
1911
[ '_:b0' , '_:b1' , '_:b2' ] ) ) ;
@@ -2154,7 +2196,7 @@ describe('Parser', () => {
2154
2196
describe ( 'should parse a formula as list item' ,
2155
2197
shouldParse ( parser , '<a> <findAll> ( <b> { <b> a <type>. <b> <something> <foo> } <o> ).' ,
2156
2198
[ 'a' , 'findAll' , '_:b0' ] ,
2157
- ...list ( [ '_:b0' , 'b' ] , [ '_:b2' , 'o' ] ) ,
2199
+ ...list ( [ '_:b0' , 'b' ] , [ '_:b2' , '_:b1' ] , [ '_:b3' , ' o'] ) ,
2158
2200
[ 'b' , 'something' , 'foo' , '_:b1' ] ,
2159
2201
[ 'b' , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' , 'type' , '_:b1' ]
2160
2202
) ) ;
0 commit comments