Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make pivot models / rich relationships / edges in Atomic Data #132

Open
joepio opened this issue Aug 19, 2022 · 2 comments
Open

How to make pivot models / rich relationships / edges in Atomic Data #132

joepio opened this issue Aug 19, 2022 · 2 comments

Comments

@joepio
Copy link
Member

joepio commented Aug 19, 2022

We often want to provide more information about the relationships between resources:

  • Say I want to describe the friendship between two people. I could create a friendship Property that simply points from one Person to the next Person. But what if I want to describe details about this friendship, such as when it started?
  • Alice is a Manager at AcmeInc. Her role is what connects her relationship to the organization.

In labeled property graph databases, you'd probably model these in an edge. In Atomic Data (and RDF), relationships can't have their own properties.

This means we need a pivot model.

  • The friendship, for example, could have a from and to attribute, as well as a startDate.
  • The role could have an person, organisation, roleType, and startDate

Some questions about this:

  • How do we deal with relationships where the from and to are really no different? Using two different properties is confusing, and makes it harder to perform queries (we need to run queries in both directions to answer any question). Do we us a links property that is a resourceArray containing a maximum of two resources?
  • Should these relationships be instances of new Classes? In our examples, a Friendship and Role class would probably make a lot of sense. But maybe a more constrained model is more appropriate for these pivot type models?
@jonassmedegaard
Copy link

jonassmedegaard commented Aug 19, 2022 via email

@joepio
Copy link
Member Author

joepio commented Aug 19, 2022

Maybe friendship isn't that great of an example, as you could indeed argue that friendship only exists if two individuals agree on its existence.

I'll add some more examples in the issue to illustrate the more abstract problem I'm trying to solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants