m-ld / m-ld-js

m-ld Javascript engine
https://js.m-ld.org
MIT License
34 stars 2 forks source link

Should construct a subject with no properties #146

Open Peeja opened 1 year ago

Peeja commented 1 year ago
test('constructs a subject with no properties', async () => {
  await api.write<Subject>({ '@id': 'fred', name: 'Fred' });
  await api.write<Subject>({ '@id': 'wilma', name: 'Wilma' });
  await expect(api.read<Construct>({
    '@construct': { '@id': '?' }
  })).resolves.toMatchObject([{ '@id': 'fred' }, { '@id': 'wilma' }]);
});

Instead, we get: [{ "@id": "_:b704b2" }]

Potentially, we should get [], but we definitely shouldn't get one empty blank node.