feat: Allow querying metadata.

This commit is contained in:
Ruben Verborgh
2021-01-05 22:47:23 +01:00
parent f9a20799eb
commit 3b63786ae0
2 changed files with 13 additions and 3 deletions

View File

@@ -75,6 +75,11 @@ describe('A RepresentationMetadata', (): void => {
expect(metadata.quads()).toBeRdfIsomorphic(inputQuads);
});
it('can query quads.', async(): Promise<void> => {
expect(metadata.quads(null, namedNode('has'), null)).toHaveLength(3);
expect(metadata.quads(null, null, literal('otherData'))).toHaveLength(2);
});
it('can change the stored identifier.', async(): Promise<void> => {
const newIdentifier = namedNode('newNode');
metadata.identifier = newIdentifier;