Closed gsvarovsky closed 1 year ago
If a requested property is missing but the subject does exist, these queries do not return the subject.
Tests (MeldClone/basic reads):
test('gets if any available property', async () => { await api.write<Subject>({ '@id': 'fred', name: 'Fred' }); await expect(api.get('fred', 'age', 'name')) .resolves.toEqual({ '@id': 'fred', name: 'Fred' }); });
=> Received: undefined
Received: undefined
test('constructs with missing property', async () => { await api.write<Subject>({ '@id': 'fred', name: 'Fred', age: undefined }); await expect(api.read<Construct>({ '@construct': { '@id': 'fred', name: '?', age: '?' } })).resolves.toMatchObject([{ '@id': 'fred', name: 'Fred' }]); });
=> Received: SubjectGraph []
Received: SubjectGraph []
This is SPARQL's must-match behaviour for variables.
Possible fix: make ConstructTemplate.pattern create a UNION. However this is complicated by nested subjects.
ConstructTemplate.pattern
If a requested property is missing but the subject does exist, these queries do not return the subject.
Tests (MeldClone/basic reads):
=>
Received: undefined
=>
Received: SubjectGraph []