I am trying to make a one to many links where a user can put in multiple addresses after their name. For example the data can look like this:
name: "Robert Cane"
address:
location: 555 Fake Street
description: Primary address
is_residence: True
location: 123 Foobar Ave.
description: Mailing address
is_residence: False
There are two ways I can do this. Is it better to setup the database this way (similar to writing tables for SQL databases):
type Address {
required property location -> str;
description -> str;
is_residence ->bool;
}
type Person {
required property name -> str;
required multi link address -> Address{
constraint exclusive;
}
}
or this way using the properties inside the multi link (similar to a relationship inside a Graph database). Also note that this is a single, optional entry according to the docs:
type Address {
required property location -> str;
is_residence -> bool;
}
type Person {
required property name -> str;
required multi link address -> Address{
property description -> str;
constraint exclusive;
}
}
My question is are there best practices to do this? Is doing it one way more advantageous in query speed over the other?