Discussion Forum

How to insert entity with nested attributes?

Let’s say we have

person sub entity,
owns name,
owns measurement;

measurement sub attribute,
owns height,
owns weight,
owns mdate,
value string;
height sub attribute,
owns units,
value integer;
weight sub attribute,
owns units,
value integer;
units sub attribute, value string;
mdate sub attribute, value datetime;

Suppose we need to insert the entity with name first, then insert the measurement(s).

First my understanding is that this schema allows insertion of multiple measurements per person. Correct?
Then we will need to give the measurements some unique values, at least unique for Fred?

Assume person with name “Fred” been inserted.

I presume this will be some sort of match-insert

match
$p isa person, has name “Fred”;
insert
??? this is where I am unsure

I think I’m getting it.

Hello! Can you show how you did it. I’m having this challenge too. Thanks