TigerGraph modeling: "composite" vertex possible?

80 Views Asked by At

I am exploring TigerGraph and was wondering how to model the following construct. Suppose I have a Work that has 1 or more Authors. Each Author is a Person who is affiliated to an Organisation during a certain period. Instead of connecting a Work to a "Person" I want to connect the Work to the "Person being affiliated to an Organisation".

Maybe the following image helps. enter image description here

The Work should be connected to the "composite" combination of person and organisation instead of just to the person.

One way to solve this is to create an "EmployedPerson" vertex class like this: enter image description here

This is clearly not as "graph-like" as I would want it to be - it makes more sense to add a period attribute to the edge connecting Person and Organisation and connect Person to the edge (in the 1st image) than to create an additional class EmployedPerson (in the 2nd image).

As a beginner with TigerGraph, I could not find any examples of this pattern in the documentation & was wondering what is the most natural fit (e.g. for storing / querying purposes down the road).

1

There are 1 best solutions below

0
On

If it is important to link the person's authorship of a work item with the person's employment (i.e. to highlight the fact that the work was authored during a given employment period), then yes, you need a vertex type linking these three things together.

Although I would call it employment rather than employedPerson, but it's a question of taste/preference.

This link vertex type should contain the start and end date/time of the employment, and you would probably need to generate a primary ID for this by concatenating a few things together (like person ID + a serial number, or person ID + company ID + start_date), rather than using a surrogate key (typically a number).