@@ -1983,6 +1983,7 @@ describe('Parser', () => {
19831983
19841984 describe ( 'A Parser instance for the N3 format' , ( ) => {
19851985 function parser ( ) { return new Parser ( { baseIRI : BASE_IRI , format : 'N3' } ) ; }
1986+ function parserIsImpliedBy ( ) { return new Parser ( { baseIRI : BASE_IRI , format : 'N3' , isImpliedBy : true } ) ; }
19861987
19871988 it (
19881989 'should parse a single triple' ,
@@ -2046,6 +2047,12 @@ describe('Parser', () => {
20462047 [ 'b' , 'http://www.w3.org/2000/10/swap/log#implies' , 'a' ] ) ,
20472048 ) ;
20482049
2050+ it (
2051+ 'should parse a simple left implication' ,
2052+ shouldParse ( parserIsImpliedBy , '<a> <= <b>.' ,
2053+ [ 'a' , 'http://www.w3.org/2000/10/swap/log#isImpliedBy' , 'b' ] ) ,
2054+ ) ;
2055+
20492056 it (
20502057 'should parse a right implication between one-triple graphs' ,
20512058 shouldParse ( parser , '{ ?a ?b <c>. } => { <d> <e> ?a }.' ,
@@ -2054,6 +2061,14 @@ describe('Parser', () => {
20542061 [ 'd' , 'e' , '?a' , '_:b1' ] ) ,
20552062 ) ;
20562063
2064+ it (
2065+ 'should parse a right implication between one-triple graphs' ,
2066+ shouldParse ( parserIsImpliedBy , '{ ?a ?b <c>. } => { <d> <e> ?a }.' ,
2067+ [ '_:b0' , 'http://www.w3.org/2000/10/swap/log#implies' , '_:b1' ] ,
2068+ [ '?a' , '?b' , 'c' , '_:b0' ] ,
2069+ [ 'd' , 'e' , '?a' , '_:b1' ] ) ,
2070+ ) ;
2071+
20572072 it (
20582073 'should parse a right implication between two-triple graphs' ,
20592074 shouldParse ( parser , '{ ?a ?b <c>. <d> <e> <f>. } => { <d> <e> ?a, <f> }.' ,
@@ -2072,6 +2087,14 @@ describe('Parser', () => {
20722087 [ 'd' , 'e' , '?a' , '_:b1' ] ) ,
20732088 ) ;
20742089
2090+ it (
2091+ 'should parse a left implication between one-triple graphs' ,
2092+ shouldParse ( parserIsImpliedBy , '{ ?a ?b <c>. } <= { <d> <e> ?a }.' ,
2093+ [ '_:b0' , 'http://www.w3.org/2000/10/swap/log#isImpliedBy' , '_:b1' ] ,
2094+ [ '?a' , '?b' , 'c' , '_:b0' ] ,
2095+ [ 'd' , 'e' , '?a' , '_:b1' ] ) ,
2096+ ) ;
2097+
20752098 it (
20762099 'should parse a left implication between two-triple graphs' ,
20772100 shouldParse ( parser , '{ ?a ?b <c>. <d> <e> <f>. } <= { <d> <e> ?a, <f> }.' ,
0 commit comments