W3C Standard Selection ‐ Activity Streams - bounswe/bounswe2024group4 GitHub Wiki

What is Activity Streams Standard for?

W3C Activity Streams is a standard format developed by the World Wide Web Consortium (W3C) to represent social activities and interactions on the web in a structured, consistent way. Essentially, it provides a way to define and share information about actions taken by users in a way that can be easily understood and utilized by various systems.

The purpose of Activity Streams is to make it easy to share and track actions across different applications and platforms in a standardized way. It is particularly useful for systems with user-generated content, interactions, and real-time updates, allowing different systems to interpret and display user actions consistently.

Its Benefits:

1. Interoperability Across Platforms: Allows different platforms to share and understand user activities, useful for decentralized networks.

2. Standardization and Consistency: Provides a common structure for representing activities, reducing custom development work and ensuring uniformity.

3. Easier Integration and Aggregation: Simplifies combining activities from multiple sources into unified feeds or dashboards.

4. Improved User Experience: Enables engaging, real-time feeds that keep users informed and encourage interaction.

5. Facilitates Personalization: Helps platforms tailor content based on user interests, making feeds more relevant.

6. Transparency and Accountability in Collaborative Environments: Shows team activities in real-time, improving collaboration and communication in work tools.

7. Enhanced Data Portability: Supports user rights by allowing activity data to be transferred between services.

8. Analytics and Insights: Enables tracking of user behavior to gain insights and improve platform features.

9. Evidence of Activity: Activity Streams offer a chronological record of user actions, including timestamps and activity details, which can serve as evidence in legal disputes.

The Requirements of Activity Streams

1. Good Design Patterns

  • Interoperability: The design must facilitate seamless interaction and data exchange between different systems, like social media platforms or project management tools.
  • Consistency: The representation of activities should follow consistent rules to be understood universally.
  • Flexibility: The system should be flexible enough to accommodate various types of activities, objects, and actors.

2. Standardized Components

  • **Actors, Verbs, and Objects: **These are the core elements of any activity. Each activity should clearly specify:
    • Actor: Who is performing the action.
    • Verb: What action is being performed (e.g., Add, Delete, Update, View).
    • Object: What is being acted upon.
  • ** Context:** The activity should provide additional information or context to clarify the action when necessary.

3. Protocols and Data Formats

  • ** Use of JSON-LD:** Activity Streams data must be serialized using JSON-LD to make it machine-readable and easily interpretable by applications.
  • **Namespace Support: **Activity Streams should use namespaces to ensure that terms and definitions are well-defined and unambiguous.

4. Notification System

  • Subscription and Notification Mechanisms: Applications should allow users to subscribe to updates and receive notifications when relevant activities occur. This includes:
    • Real-time Updates: The system should efficiently notify subscribers of changes.
    • Observer Pattern: Implements the Observer Design Pattern, where state changes in one object trigger notifications to other dependent objects.

5. Minimal Coupling

  • The subject (actor) should only know about the abstract interface of observers (subscribers), not the concrete implementations. This ensures a low level of dependency, making the system more maintainable and scalable.

6. Handling State Changes

  • When the state of a subject changes (e.g., a user views the profile page of another user), this change must trigger appropriate updates to observers (e.g., the user whose profile page is viewed). The system must handle state changes efficiently to maintain data consistency.

7. Response Types and Codes

  • The system should define and adhere to standard response types and status codes. For example, it should specify success or error codes when processing activities.

8. Compliance with Vocabulary and Specifications

  • The system must adhere to the Activity Streams 2.0 vocabulary, using predefined object and activity types (like Person, Delete, Follow, etc.) as outlined in the standard.
  • ** Serialization:** It should use JSON-LD serialization to ensure data compatibility and efficient parsing.

9. Scalability and Performance

  • The implementation must be optimized to handle large volumes of activity data and provide efficient real-time updates when needed.

10. Security and Privacy

  • The system must ensure that sensitive information is protected and that users have control over their activity data and who can see or subscribe to it.
  • Authentication and Authorization: Must be implemented to restrict unauthorized access to data.

How will Activity Streams be enforced in practice in our project?

We will keep track of the following activities:

Profile View

  • Why?: We are aiming to inform users how popular they are among the community via notifying them how many people viewed their profile in some period of time.
{
 "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Sally viewed Buse profile.",
  "type": "View",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Person",
    "name": "Buse"
  },
  "published": "2024-10-10T23:00:00Z"
}

Rating

  • Why?: We are aiming to suggest recently the most highly rated members to everyone.
{
 "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Sally rated Buse 5.",
  "type": "Update",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Person",
    "name": "Buse"
  },
  "rating": 5,
  "published": "2024-10-10T23:00:00Z"
}

Post Deletion

  • Why?: In case of an unpleasant event such as abusement takes place, we want to keep track of the problematic post from the user for everyone's security.
{
 "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Ceyhun deleted post.",
  "type": "Delete",
  "actor": {
    "type": "Person",
    "name": "Ceyhun"
  },
  "object": {
    "type": "Object",
    "content": "I hate everyone.",
    "id": 342
  },
  "deleted": "2024-10-10T23:00:00Z"
}

Comment Deletion

  • Why?: In case of an unpleasant event such as abusement takes place, we want to keep track of the problematic post from the user for everyone's security.
{
 "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Ceyhun deleted comment.",
  "type": "Delete",
  "actor": {
    "type": "Person",
    "name": "Ceyhun"
  },
  "object": {
    "type": "Object",
    "content": "I hate everyone.",
    "id": 3253
  },
  "deleted": "2024-10-10T23:00:00Z"
}

View Meal

  • Why?: We are aiming to inform users how popular they are among the community via notifying them how many people viewed their meals in some period of time. We also want to suggest similar meals to the person who viewed using this data.
{
 "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Sally viewed Buse's meal.",
  "type": "View",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Object",
    "generated": {
       "Person": "Buse",
       "type": "meal",
       "id": 37482
    }
  },
  "published": "2024-10-10T23:00:00Z"
}

View Exercise

  • Why?: We are aiming to inform users how popular they are among the community via notifying them how many people viewed their exercise programs in some period of time. We also want to suggest similar exercises to the person who viewed using this data.
{
 "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "Sally viewed Buse's exercise.",
  "type": "View",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Object",
    "generated": {
       "Person": "Buse",
       "type": "exercise",
       "id": 934892
    }
  },
  "published": "2024-10-10T23:00:00Z"
}