Activity Streams/Mappings

From W3C Wiki

User Profile Management

https://www.w3.org/wiki/Socialwg/Social_API/User_stories#User_profile_management

"Kim creates a personal profile with her name, avatar picture, and home town."

{
  "@type": "Create",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

{
  "@type": "Add",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": { 
    "@type": "http://example.org/FullName",
    "displayName": "Kim Jones"
  },
  "target": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

{
  "@type": "Add",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": { 
    "@type": "Image",
    "url": "http://example.org/kim.avatar.png",
    "imageOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  },
  "target": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

{
  "@type": "Add",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": { 
    "@type": ["Place", "http://example.org/HomeTown"],
    "displayName": "Fresno, CA"
  },
  "target": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

Here's a challenge: The notion of a "Profile" that describes a person is fundamental to most social platforms... and yet, we have nothing in our vocabulary that represents a Profile as a description of a person. This seems like a problem. The above example is a strawman that breaks the simple one sentence scenario into four distinct Activities: Kim creates a profile. Kim adds her full name to her profile. Kim adds an avatar to her profile. Kim adds her hometown to her profile. Note that the Profile object is used as a Target. It's a container to which items are added. It that sense, a Profile can be viewed as a type of Collection. If you look at most of the examples of profiles in most social platforms, viewing the Profile as type of Collection seems to make the most sense.

We can abbreviate the above example by using multiple object values in a single Activity:

{
  "@type": "Create",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}
//..........
{
  "@type": "Add",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": [
    { 
      "@type": "http://example.org/FullName",
      "displayName": "Kim Jones"
    },
    { 
      "@type": "Image",
      "url": "http://example.org/kim.avatar.png",
      "imageOf": {
        "@type": "Person",
        "displayName": "Kim"
      }
    },
    { 
      "@type": ["Place", "http://example.org/HomeTown"],
      "displayName": "Fresno, CA"
    }
  ],
  "target": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

"Kim updates her profile to include her job title, phone number and company name."

{
  "@type": "Add",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object": [
    { 
      "@type": "http://example.org/Affiliation",
      "displayName": "Director of Marketing",
      "http://example.org/Organization": "Acme, Co",
      "http://example.org/Title": "Director of Marketing"
    },
    {
      "@type": "http://example.org/PhoneNumber",
      "displayName": "555-555-5555"
    }
  ],
  "target": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

"Kim reconsiders her personal privacy boundaries; she updates her profile to remove her phone number."

{
  "@type": "Remove",
  "actor": {
    "@type": "Person",
    "displayName": "Kim"
  },
  "object":  {
    "@type": "http://example.org/PhoneNumber",
    "displayName": "555-555-5555"
  },
  "origin": {
    "@type": "Profile",
    "http://example.org/descriptionOf": {
      "@type": "Person",
      "displayName": "Kim"
    }
  }
}

User Posts a Note

https://www.w3.org/wiki/Socialwg/Social_API/User_stories#User_posts_a_note

"Eric writes a short note to be shared with his followers."

{
  "@type": "Post",
  "actor": {
    "@type": "Person",
    "displayName": "Eric"
  },
  "object": {
    "@type": "Note",
    "@id": "http://example.org/notes/1",
    "content": "This is a short note"
  }
}

"After posting the note, he notices a spelling error. He edits the note and re-posts it."

{
  "@type": "Update",
  "actor": {
    "@type": "Person",
    "displayName": "Eric"
  },
  "object": {
    "@type": "Note",
    "@id": "http://example.org/notes/1",
    "content": "This is a short note"
  }
}

Later, Eric decides that the information in the note is incorrect. He deletes the note.

{
  "@type": "Delete",
  "actor": {
    "@type": "Person",
    "displayName": "Eric"
  },
  "object": {
    "@type": "Note",
    "@id": "http://example.org/notes/1",
    "content": "This is a short note"
  }
}