# Label Participants

_Last Revision:20th March 2021_

This document is about the LabelParticipant node in the knowledge graph implemented using the Neo4j Graph Database.

## Why the LabelParticipant entity exists?

The Orchard as a distributor gathers a ton of metadata information from its clients (Labels, Artists, etc) to help distribute and present that information out to retailers such as Spotify.
Over the past few years, the information collected around Artists have led to a typical scattered data problem. It became harder and harder to determine a unique artist profile,
since this information was scattered and duplicated on fields like Project Artist, Product Artist, Track Artist, Featuring, Remixer, etc based on the artist’s contribution.

We created the concept of a Lael Participant to uniquely identify an artist/band within a label’s catalog.

## How a LabelParticipant entity is created?

There are two main ways to create a LabelParticipant node.

- When a user creates a new artist in Workstation on the project page or on the product page via dropdown component (with the search in Spotify and Apple Music) a new LabelParticipant node is created.
  The dropdown hits this GraphQL mutation [https://github.com/theorchard/graphql-participant/blob/master/src/schema/Mutation.graphql#L2](https://github.com/theorchard/graphql-participant/blob/master/src/schema/Mutation.graphql#L2)

- When in art_relations db a new record appears in any of the following tables: artist_info, release_artist, track_artist, track_writer, participant_identifier it triggers the creation of a new LabelParticipant node. The synchronization is based on Maxwell's daemon + AWS Kinesis + Lambda. The lambda code can be found here [https://github.com/theorchard/lambda-kinesis-to-neo4j/blob/master/lambda/kinesis-to-neo4j/logic/record_handlers.py#L21](https://github.com/theorchard/lambda-kinesis-to-neo4j/blob/master/lambda/kinesis-to-neo4j/logic/record_handlers.py#L21)

## How LabelParticipant is used in access control?

Labels have the authority to share their private data with 3rd parties and even other contracted parties as they see fit.
A Global Participant uniquely identifies an artist across the industry. A Label Participant by contrast uniquely identifies an artist within the scope of a single label.
Label Participants are linked to all the content a particular label has released by that artist. Therefore, if a label wants to share data about an artist with a 3rd part they would do so by granting them access to their Label Participant.

Since Label Participants are directly connected to Labels, we are able to utilize that relationship to understand what content a Label has access to.
On a variety of applications across our eco-system, it’s important that we don’t accidentally end up disclosing one label’s content & related information to another.

The publicly available information around artists is linked to their GlobalParticipant entities. This information is totally fine to be disclosed across various labels.
However, information that The Orchard collects on behalf of the label via our partners, is deemed confidential. This information should only be connected to the LabelParticipant entities.

## How LabelParticipant and GlobalParticipant are related?

A GlobalParticipant is a unique representation of an Artist/Band across multiple labels. Over an artist’s lifetime, they engage with multiple labels, sign a variety of deals to distribute their content. To group up their content across these labels and present it back to our audience via Insights and OrchardGo, we introduced the concept of a GlobalParticipant.
GlobalParticipants are the public personas of these artists. We also create these entities when we get some publicly available information about them via data coming in from aggregators like Chartmetric.
The relationship between GlobalParticipant to LabelParticipants is one-to-many and will only exist if The Orchard has any private data about that particular artist.

## Entity-Relation diagram for LabelParticipant

![ER Diagram for LabelParticipant](images/label-participant-er-diagram.png)
