Nested Attributes in TigerGraph?

Hi there! I’m relatively new to TigerGraph. I was just wondering what might be the best way to model nested attributes in TigerGraph? i.e data in JSON formats?

a Person vertex
{
name: "Bob",
age: 27,
location: {
  long: ...
  lat: ...
},
languages: [
  { 
    name: "English",
    fluent: true
  },
  { 
    name: "French",
    fluent: false
  },
]
}

I would think in this scenario, the best way to handle this would be to make long lat of location attributes of a Person vertex. Though it might not make the most sense, I feel like its the better option rather than putting it on a relationship as attributes or making location a separate node on its own.

Whereas for attributes such as languages, I believe TigerGraph only supports Sets for primitive types, so I think this would be better off as a separate vertex connected to the Person with a relationship.

I was curious to know the opinions from the community and if there are any better ways/ workarounds to model this. Thanks for reading and have a great day ahead!

Rather than taking the set/list approach (1 to many) in Tigergraph, I think a better path is to use the built in ‘flattening’ functions in gsql to create multiple 1to1 mappings. So Bob, who speaks 3-4 languages gets translated to 3-4 tuples of Bob->English, Bob->French etc…

2 Likes