Graph Change Announcement
*Since DSNP version 1.2, social graph changes use [User Data](../UserData.md) operations as described in the [Graph](../Graph.md) section.*A Graph Change Announcement is for publishing relationship state changes for a user.
Fields
Field | Description | Data Type | Serialization | Parquet Type | Bloom Filter |
---|---|---|---|---|---|
announcementType | Announcement Type Enum (1 ) | enum | decimal | INT32 | no |
changeType | Type of relationship change | enum | decimal | INT32 | no |
fromId | Id of the user creating the relationship | 64-bit unsigned integer | decimal | UINT_64 | YES |
objectId | Id of the target of the relationship | 64-bit unsigned integer | decimal | UINT_64 | YES |
Field Requirements
announcementType
- MUST be fixed to
1
changeType
- MUST be one of the Change Type Enum
Change Type Enum
Different change types have different meanings.
Value | Name | Description |
---|---|---|
0 | Unfollow | Remove a Follow relationship |
1 | Follow | Create a Follow relationship |
fromId
- MUST be a DSNP User Id
- MUST have authorized the creation of the Announcement, either directly or via a transparent chain of delegation
objectId
- MUST be a DSNP User Id
Non-Normative
Graph Retrieval, Ordering and Reading
Each Graph Change event represents a state transition for the graph. The state of the graph at any time is given by taking the state of the graph at a previous time and applying all Graph Change events not previously applied in the order specified by Announcement Ordering.
Once those Graph Change events are retrieved, they can be ordered to reflect the current graph state (i.e. Charlie has followed Bob, then he unfollowed him, and then followed him again. The graph state reflects that Charlie is following Bob.)
To retrieve the graph, do the following:
- Retrieve the events with announcementType matching the enum for Graph Change.
- Filter the events to a particular DSNP User Id to retrieve information about the respective graph.
- Order the retrieved data by Announcement Ordering.