Open jeswr opened 2 years ago
At the same time we should probably implement this as a stream parser (perhaps based on the ttl parser in the N3 package). In particular the tests that we should get passing are
it('Should error on invalid rules', async () => { await expect(actor.run(createMediaTypedAction('->', false))).resolves.toThrowError(); await expect(actor.run(createMediaTypedAction('invalid1'))).resolves.toThrowError(); await expect(actor.run(createMediaTypedAction('invalid2'))).resolves.toThrowError(); await expect(actor.run(createMediaTypedAction('invalid3'))).resolves.toThrowError(); });
and possibly the following commented out tests in the following test suite
it('should test', async() => { expect(await actor.test(createMediaTypedAction('rdfs'))).toEqual({ handle: true }); // Expect(await actor.test(createMediaTypedAction('invalid1'))).toEqual({ handle: false }); // expect(await actor.test(createMediaTypedAction('invalid2'))).toEqual({ handle: false }); // expect(await actor.test(createMediaTypedAction('invalid3'))).toEqual({ handle: false }); });
In addition the Hylar parser will produce incorrect outputs if '->', '^', '(' or ')' occurs in a string or url
At the same time we should probably implement this as a stream parser (perhaps based on the ttl parser in the N3 package). In particular the tests that we should get passing are
and possibly the following commented out tests in the following test suite