m-ld-js
m-ld-js copied to clipboard
Should be able to `@construct` with a property variable in a nested subject
test('constructs with a property variable in a nested subject', async () => {
await api.write<Subject>({ '@id': 'fred', stats: { height: 5, age: 40 } } );
await expect(api.read<Construct>({
'@construct': { 'stats': { '?': 5 } }
})).resolves.toEqual([{
"@id": "fred",
"stats": {
'@id': expect.stringMatching(genIdRegex),
height: 5
}
}]);
});
Throws:
Error: Unhandled error. (Error: No index compatible with pattern {"subject":{"termType":"NamedNode","value":"http://test.m-ld.org/.well-known/genid/clg5fa9310002n2y11syg04xb"},"object":{"termType":"Literal","value":"5","language":"","datatype":{"termType":"NamedNode","value":"http://www.w3.org/2001/XMLSchema#integer"}},"graph":{"termType":"DefaultGraph","value":""}} and options {}