This specification describes the Activity vocabulary.

Editor's Note

This is an Editor's Draft. There are a significant number of changes that have been made to this vocabulary since the publication of the First Public Working Draft. All changes should be considered provisional pending working group discussion and acceptance.

Author's Note

This draft is heavily influenced by the JSON Activity Streams 1.0 specification originally co-authored by Martin Atkins, Will Norris, Chris Messina, Monica Wilkinson, Rob Dolin and James Snell. The author is very thankful for their significant contributions and gladly stands on their shoulders. Some portions of the original text of Activity Streams 1.0 are used in this document.

Introduction

The Activity Streams 2.0 Core Syntax defines the JSON syntax for Activity Streams. This document defines the vocabulary properties.

The Activity Streams 2.0 Vocabulary defines a set of abstract classes and properties that describe past, present and future Activities. The vocabulary is defined in two parts:

  1. A Core set of properties describing the generalized structure of an Activity; and
  2. An Extended set of properties that cover specific types of Activities and Artifacts common to many social Web application systems.

While not all Activity Streams 2.0 implementations are expected to implement support for the Extended properties, all implementations MUST at least be capable of serializing and deserializing the Extended properties in accordance with the Activity Streams 2.0 Core Syntax.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [[!RFC2119]].

Conventions

This specification uses IRIs [[!RFC3987]]. Every URI [[!RFC3986]] is also an IRI, so a URI may be used wherever an IRI is named. There are two special considerations: (1) when an IRI that is not also a URI is given for dereferencing, it MUST be mapped to a URI using the steps in Section 3.1 of [[!RFC3987]] and (2) when an IRI is serving as an "id" value, it MUST NOT be so mapped.

Unless otherwise specified, all properties defined as xsd:dateTime values MUST conform to the "date-time" production in [[!RFC3339]], with an uppercase "T" character used to separate date and time, and an uppercase "Z" character in the absence of a numeric time zone offset. All such timestamps SHOULD be represented relative to Coordinated Universal Time (UTC).

The examples included in this document use the normative JSON serialization defined by this specification along with generally equivalent, non-normative Microdata, RDFa, Microformats, and Turtle serializations. These non-JSON alternatives are included solely for illustrative purposes.

Editor's Note

The Microdata, RDFa and Microformats examples included in this document are purely informative and may not currently reflect actual implementation experience or accepted best practices for each format. These alternate serializations may be removed from future iterations of this document and moved to a separate informative WG Note.

Core Classes

The Activity Vocabulary Core Classes provide the basis for the rest of the vocabulary.

Base URI: http://www.w3.org/ns/activitystreams#.

The Activity Streams 2.0 Core Classes include: Object | Link | Activity | IntransitiveActivity | Actor | Collection | OrderedCollection | CollectionPage | OrderedCollectionPage

Class Description Example
Object URI: http://www.w3.org/ns/activitystreams#Object
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Object",
  "id": "http://www.test.example/object/1",
  "name": "A Simple, non-specific object"
}
Notes: Describes an object of any kind. The Object class serves as the base class for most of the other kinds of objects defined in the Activity Vocabulary, include other Core classes such as Activity, IntransitiveActivity, Actor, Collection and OrderedCollection.
Disjoint With: Link
Properties:

attachment | attributedTo | content | context | name | endTime | generator | icon | image | inReplyTo | location | preview | published | replies | scope | startTime | summary | tag | updated | url | to | bto | cc | bcc | mediaType

Link URI: http://www.w3.org/ns/activitystreams#Link
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Link",
  "href": "http://example.org/abc",
  "hreflang": "en",
  "mediaType": "text/html",
  "name": "An example link"
}
Notes: A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by [[!RFC5988]]. Many of the properties defined by the Activity Vocabulary allow values that are either instances of Object or Link. When a Link is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the href.
Disjoint With: Object
Properties:

href | rel | mediaType | name | hreflang | height | width | duration

Activity URI: http://www.w3.org/ns/activitystreams#Activity
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Activity",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Note",
    "name": "A Note"
  }
}
Notes: An Activity is a subclass of Object that describes some form of action that may happen, is currently happening, or has already happened. The Activity class itself serves as an abstract base class for all types of activities. It is important to note that the Activity class itself does not carry any specific semantics about the kind of action being taken.
Extends: Object
Properties:

actor | object | target | result | origin | instrument

Inherits all properties from Object.

IntransitiveActivity URI: http://www.w3.org/ns/activitystreams#IntransitiveActivity
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Travel",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "target": {
    "type": "Place",
    "name": "Work"
  }
}
Notes: Instances of IntransitiveActivity are a subclass of Activity whose actor property identifies the direct object of the action as opposed to using the object property.
Extends: Activity
Properties:

Inherits all properties from Activity except object.

Actor URI: http://www.w3.org/ns/activitystreams#Actor
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Actor",
  "name": "Sally"
}
Notes: An Actor is any entity that is capable of being the primary actor for an Activity.
Extends: Object
Properties:

Inherits all properties from Object.

Collection URI: http://www.w3.org/ns/activitystreams#Collection
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 2,
  "items": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes:

A Collection is a subclass of Object that represents ordered or unordered sets of Object or Link instances.

Refer to the Activity Streams 2.0 Core specification for a complete description of the Collection type.

Extends: Object
Properties:

totalItems | current | first | last | items

Inherits all properties from Object.

OrderedCollection URI: http://www.w3.org/ns/activitystreams#OrderedCollection
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "OrderedCollection",
  "totalItems": 2,
  "orderedItems": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes:

A subclass of Collection in which members of the logical collection are assumed to always be strictly ordered.

Extends: Collection
Properties:

Inherits all properties from Collection.

CollectionPage URI: http://www.w3.org/ns/activitystreams#CollectionPage
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "CollectionPage",
  "id": "http://example.org/foo?page=1",
  "partOf": "http://example.org/foo",
  "items": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes:

Used to represent distinct subsets of items from a Collection. Refer to the Activity Streams 2.0 Core for a complete description of the CollectionPage object.

Extends: Collection
Properties:

partOf | next | prev

Inherits all properties from Collection.

OrderedCollectionPage URI: http://www.w3.org/ns/activitystreams#OrderedCollectionPage
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "OrderedCollectionPage",
  "id": "http://example.org/foo?page=1",
  "partOf": "http://example.org/foo",
  "orderedItems": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes:

Used to represent ordered subsets of items from an OrderedCollection. Refer to the Activity Streams 2.0 Core for a complete description of the OrderedCollectionPage object.

Extends: OrderedCollection | CollectionPage
Properties:

startIndex

Inherits all properties from OrderedCollection and CollectionPage.

Extended Classes

Base URI: http://www.w3.org/ns/activitystreams#.

The Activity Streams 2.0 Extended Classes include Activity and Object subclasses that are common to many social Web applications. They are divided into three sets:

Support for specific extended vocabulary classes is expected to vary, with implementations only selecting the extended classes and properties that make sense within the specific context and requirements of those applications. However, to avoid possible interoperability issues, implementations MUST avoid using extension classes or properties that unduly overlap with or duplicate the extended vocabulary defined here.

Activity Types

All Activity Types inherit the properties of the base Activity class. Some specific Activity Types are subclasses or specializations of more generalized Activity Types (for instance, the Invite Activity Type is a more specific form of the Offer Activity Type).

The Activity Types include: Accept | Add | Announce | Arrive | Block | Create | Delete | Dislike | Flag | Follow | Ignore | Invite | Join | Leave | Like | Listen | Move | Offer | Question | Reject | Read | Remove | TentativeReject | TentativeAccept | Travel | Undo | Update | View

Class Description Example
Accept URI: http://www.w3.org/ns/activitystreams#Accept
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Accept",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Invite",
    "actor": "http://john.example.org",
    "object": {
      "type": "Event",
      "name": "A Party!"
    }
  }
}
Notes: Indicates that the actor accepts the object. The target property can be used in certain circumstances to indicate the context into which the object has been accepted. For instance, when expressing the activity, "Sally accepted Joe into the Club", the "target" would identify the "Club".
Extends: Activity
Properties: Inherits all properties from Activity.
TentativeAccept URI: http://www.w3.org/ns/activitystreams#TentativeAccept
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "TentativeAccept",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Invite",
    "actor": "http://john.example.org",
    "object": {
      "type": "Event",
      "name": "A Party!"
    }
  }
}
Notes: A specialization of Accept indicating that the acceptance is tentative.
Extends: Accept
Properties: Inherits all properties from Accept.
Add URI: http://www.w3.org/ns/activitystreams#Add
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Add",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/abc"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Add",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Image",
    "name": "A picture of my cat",
    "url": "http://example.org/img/cat.png"
  },
  "target": {
    "type": "Collection",
    "name": "My Cat Pictures"
  }
}
Notes: Indicates that the actor has added the object to the target. If the target property is not explicitly specified, the target would need to be determined implicitly by context. The origin can be used to identify the context from which the object originated.
Extends: Activity
Properties: Inherits all properties from Activity.
Arrive URI: http://www.w3.org/ns/activitystreams#Arrive
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Arrive",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "location": {
    "type": "Place",
    "name": "Work"
  },
  "origin": {
    "type": "Place",
    "name": "Home"
  }
}
Notes: An IntransitiveActivity that indicates that the actor has arrived at the location. The origin can be used to identify the context from which the actor originated. The target typically has no defined meaning.
Extends: IntransitiveActivity
Properties: Inherits all properties fom IntransitiveActivity.
Create URI: http://www.w3.org/ns/activitystreams#Create
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Note",
    "name": "A Simple Note",
    "content": "This is a simple note"
  }
}
Notes:

Indicates that the actor has created the object.

Extends: Activity
Properties: Inherits all properties from Activity.
Delete URI: http://www.w3.org/ns/activitystreams#Delete
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Delete",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/notes/1"
}
Notes: Indicates that the actor has deleted the object. If specified, the origin indicates the context from which the object was deleted.
Extends: Activity
Properties: Inherits all properties from Activity.
Follow URI: http://www.w3.org/ns/activitystreams#Follow
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Follow",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Person",
    "name": "John"
  }
}
Notes: Indicates that the actor is "following" the object. Following is defined in the sense typically used within Social systems in which the actor is interested in any activity performed by or on the object. The target and origin typically have no defined meaning.
Extends: Activity
Properties: Inherits all properties from Activity.
Ignore URI: http://www.w3.org/ns/activitystreams#Ignore
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Ignore",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/notes/1"
}
Notes: Indicates that the actor is ignoring the object. The target and origin typically have no defined meaning.
Extends: Activity
Properties: Inherits all properties from Activity.
Join URI: http://www.w3.org/ns/activitystreams#Join
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Join",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Group",
    "name": "A Simple Group"
  }
}
Notes: Indicates that the actor has joined the object. The target and origin typically have no defined meaning.
Extends: Activity
Properties: Inherits all properties from Activity.
Leave URI: http://www.w3.org/ns/activitystreams#Leave
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Leave",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Place",
    "name": "Work"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Leave",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Group",
    "name": "A Simple Group"
  }
}
Notes: Indicates that the actor has left the object. The target and origin typically have no meaning.
Extends: Activity
Properties: Inherits all properties from Activity.
Like URI: http://www.w3.org/ns/activitystreams#Like
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Like",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/notes/1"
}
Notes:

Indicates that the actor likes, recommends or endorses the object. The target and origin typically have no defined meaning.

Extends: Activity
Properties: Inherits all properties from Activity.
Offer URI: http://www.w3.org/ns/activitystreams#Offer
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "http://www.types.example/ProductOffer",
    "name": "50% Off!"
  }
}
Notes: Indicates that the actor is offering the object. If specified, the target indicates the entity to which the object is being offered.
Extends: Activity
Properties: Inherits all properties from Activity.
Invite URI: http://www.w3.org/ns/activitystreams#Invite
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Invite",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Event",
    "name": "A Party"
  },
  "target": [
    {
      "type": "Person",
      "name": "John"
    },
    {
      "type": "Person",
      "name": "Lisa"
    }
  ]
}
Notes: A specialization of Offer in which the actor is extending an invitation for the object to the target.
Extends: Offer
Properties: Inherits all properties from Offer.
Reject URI: http://www.w3.org/ns/activitystreams#Reject
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Reject",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Invite",
    "actor": "http://john.example.org",
    "object": {
      "type": "Event",
      "name": "A Party!"
    }
  }
}
Notes: Indicates that the actor is rejecting the object. The target and origin typically have no defined meaning.
Extends: Activity
Properties: Inherits all properties from Activity.
TentativeReject URI: http://www.w3.org/ns/activitystreams#TentativeReject
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "TentativeReject",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Invite",
    "actor": "http://john.example.org",
    "object": {
      "type": "Event",
      "name": "A Party!"
    }
  }
}
Notes: A specialization of Reject in which the rejection is considered tentative.
Extends: Reject
Properties: Inherits all properties from Reject.
Remove URI: http://www.w3.org/ns/activitystreams#Remove
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Remove",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/notes/1",
  "target": {
    "type": "Collection",
    "name": "Notes Folder"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Remove",
  "actor": {
    "type": "http://example.org/Role",
    "name": "The Moderator"
  },
  "object": {
    "type": "Person",
    "name": "Sally"
  },
  "origin": {
    "type": "Group",
    "name": "A Simple Group"
  }
}
Notes: Indicates that the actor is removing the object. If specified, the origin indicates the context from which the object is being removed.
Extends: Activity
Properties: Inherits all properties from Activity.
Undo URI: http://www.w3.org/ns/activitystreams#Undo
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Undo",
  "actor": "http://sally.example.org",
  "object": {
    "type": "Offer",
    "actor": "http://sally.example.org",
    "object": "http://example.org/posts/1",
    "target": "http://john.example.org"
  }
}
Notes:

Indicates that the actor is undoing the object. In most cases, the object will be an Activity describing some previously performed action (for instance, a person may have previously "liked" an article but, for whatever reason, might choose to undo that like at some later point in time).

The target and origin typically have no defined meaning.

Extends: Activity
Properties: Inherits all properties from Activity.
Update URI: http://www.w3.org/ns/activitystreams#Update
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Update",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/notes/1"
}
Notes:

Indicates that the actor has updated the object. Note, however, that this vocabulary does not define a mechanism for describing the actual set of modifications made to object.

The target and origin typically have no defined meaning.

Extends: Activity
Properties: Inherits all properties from Activity.
View URI: http://www.w3.org/ns/activitystreams#View
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "View",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": {
    "type": "Article",
    "name": "An article about Activity Streams"
  }
}
Notes: Indicates that the actor has viewed the object.
Extends: Activity
Properties: Inherits all properties from Activity.
Listen URI: http://www.w3.org/ns/activitystreams#Listen
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Listen",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/music.mp3"
}
Notes: Indicates that the actor has listened to the object.
Extends: Activity
Properties: Inherits all properties from Activity.
Read URI: http://www.w3.org/ns/activitystreams#Read
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Read",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/posts/1"
}
Notes: Indicates that the actor has read the object.
Extends: Activity
Properties: Inherits all properties from Activity.
Move URI: http://www.w3.org/ns/activitystreams#Move
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Move",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/posts/1",
  "target": {
    "type": "Collection",
    "name": "List B"
  },
  "origin": {
    "type": "Collection",
    "name": "List A"
  }
}
Notes: Indicates that the actor has moved object from origin to target. If the origin or target are not specified, either can be determined by context.
Extends: Activity
Properties: Inherits all properties from Activity.
Travel URI: http://www.w3.org/ns/activitystreams#Travel
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Travel",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "target": {
    "type": "Place",
    "name": "Home"
  },
  "origin": {
    "type": "Place",
    "name": "Work"
  }
}
Notes: Indicates that the actor is traveling to target from origin. Travel is an IntransitiveObject whose actor specifies the direct object. If the target or origin are not specified, either can be determined by context.
Extends: IntransitiveActivity
Properties: Inherits all properties from IntransitiveActivity.
Announce URI: http://www.w3.org/ns/activitystreams#Announce
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Announce",
  "actor": {
    "type": "Person",
    "id": "http://sally.example.org",
    "name": "Sally"
  },
  "object": {
    "type": "Arrive",
    "actor": "http://sally.example.org",
    "location": {
      "type": "Place",
      "name": "Work"
    }
  }
}
Notes:

Indicates that the actor is calling the target's attention the object.

The origin typically has no defined meaning.

Extends: Activity
Properties: Inherits all properties from Activity.
Block URI: http://www.w3.org/ns/activitystreams#Block
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Block",
  "actor": "http://sally.example.org",
  "object": "http://joe.example.org"
}
Notes: Indicates that the actor is blocking the object. Blocking is a stronger form of Ignore. The typical use is to support social systems that allow one user to block activities or content of other users. The target and origin typically have no defined meaning.
Extends: Ignore
Properties: Inherits all properties from Ignore.
Flag URI: http://www.w3.org/ns/activitystreams#Flag
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Flag",
  "actor": "http://sally.example.org",
  "object": {
    "type": "Note",
    "content": "An inappropriate note"
  }
}
Notes: Indicates that the actor is "flagging" the object. Flagging is defined in the sense common to many social platforms as reporting content as being inappropriate for any number of reasons.
Extends: Activity
Properties: Inherits all properties from Activity.
Dislike URI: http://www.w3.org/ns/activitystreams#Dislike
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Dislike",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1"
}
Notes: Indicates that the actor dislikes the object.
Extends: Activity
Properties: Inherits all properties from Activity.

Actor Types

All Actor Types inherit the properties of the base Actor class. Actors are objects that are capable of performing activities. The value of the actor property MUST be a type of Actor.

The core Actor Types include: Application | Group | Organization | Person | Service

Class Description Properties
Application URI: http://www.w3.org/ns/activitystreams#Application
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Application",
  "name": "My Software Application."
}
Notes: Describes a software application.
Extends: Actor
Properties: Inherits all properties from Actor.
Group URI: http://www.w3.org/ns/activitystreams#Group
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Group",
  "name": "A Simple Group."
}
Notes: Represents a formal or informal collective of Actors.
Extends: Actor
Properties: Inherits all properties from Actor.
Organization URI: http://www.w3.org/ns/activitystreams#Organization
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Organization",
  "name": "Example Co."
}
Notes: Represents an organization.
Extends: Actor
Properties: Inherits all properties from Actor.
Person URI: http://www.w3.org/ns/activitystreams#Person
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Person",
  "name": "Sally Smith."
}
Notes: Represents an individual person.
Extends: Actor
Properties: Inherits all properties from Actor.
Service URI: http://www.w3.org/ns/activitystreams#Service
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Service",
  "name": "Acme Web Service"
}
Notes: Represents a service of any kind.
Extends: Actor
Properties: Inherits all properties from Actor.

Object Types

All Object Types inherit the properties of the base Object class. Some specific Object Types are subclasses or specializations of more generalized Object Types (for instance, the Person Object Type is a more specific form of the Actor class).

The Object Types include: Article | Audio | Content | Document | Event | Image | Mention | Note | Page | Place | Profile | Question | Relationship | Video

Class Description Properties
Relationship URI: http://www.w3.org/ns/activitystreams#Relationship
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Relationship",
  "subject": {
    "type": "Person",
    "name": "Sally"
  },
  "relationship": "http://purl.org/vocab/relationship/closeFriendOf",
  "object": {
    "type": "Person",
    "name": "John"
  }
}
Notes:

Describes a relationship between two individuals. The subject and object properties are used to identify the connected individuals.

See for additional information.

Extends: Object
Properties:

subject | object | relationship

Inherits all properties from Object.

Content URI: http://www.w3.org/ns/activitystreams#Content
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Content",
  "name": "Some generic content",
  "content": "<p>This can be any kind of content</p>",
  "height": 100,
  "width": 100
}
Notes: Describes an entity representing any form of content. Examples include documents, images, etc. Content objects typically are not able to perform activities on their own, yet rather are usually the object or target of activities.
Extends: Object
Properties:

duration | height | width

Inherits all properties from Object.

Article URI: http://www.w3.org/ns/activitystreams#Article
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Article",
  "name": "A Blog Post",
  "content": "<div>... a long blog post</div>",
  "attributedTo": "http://sally.example.org"
}
Notes: Represents any kind of multi-paragraph written work.
Extends: Content
Properties: Inherits all properties from Content.
Document URI: http://www.w3.org/ns/activitystreams#Document
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Document",
  "name": "4Q Sales Forecast",
  "url": "http://example.org/4q-sales-forecast.pdf"
}
Notes: Represents a document of any kind.
Extends: Content
Properties: Inherits all properties from Content.
Audio URI: http://www.w3.org/ns/activitystreams#Audio
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Audio",
  "name": "A Simple Podcast",
  "url": {
    "type": "Link",
    "href": "http://example.org/podcast.mp3",
    "mediaType": "audio/mp3"
  }
}
Notes: Represents an audio document of any kind.
Extends: Document
Properties: Inherits all properties from Document.
Image URI: http://www.w3.org/ns/activitystreams#Image
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Image",
  "name": "A Simple Image",
  "url": [
    {
      "type": "Link",
      "href": "http://example.org/image.jpeg",
      "mediaType": "image/jpeg"
    },
    {
      "type": "Link",
      "href": "http://example.org/image.png",
      "mediaType": "image/png"
    }
  ]
}
Notes: An image document of any kind
Extends: Document
Properties: Inherits all properties from Document.
Video URI: http://www.w3.org/ns/activitystreams#Video
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Video",
  "name": "A Simple Video",
  "url": "http://example.org/video.mkv",
  "duration": "PT2H"
}
Notes: Represents a video document of any kind.
Extends: Document
Properties: Inherits all properties from Document.
Note URI: http://www.w3.org/ns/activitystreams#Note
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "name": "A Short Note",
  "content": "This is a short note"
}
Notes: Represents a short written work typically less than a single paragraph in length.
Extends: Content
Properties: Inherits all properties from Content.
Page URI: http://www.w3.org/ns/activitystreams#Page
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Page",
  "name": "A Webpage",
  "url": "http://example.org/page.html"
}
Notes: Represents a Web Page.
Extends: Document
Properties: Inherits all properties from Document.
Question URI: http://www.w3.org/ns/activitystreams#Question
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Question",
  "name": "What is the answer?",
  "oneOf": [
    {
      "type": "Note",
      "name": "Option A"
    },
    {
      "type": "Note",
      "name": "Option B"
    }
  ]
}
Notes:

Represents a question being asked. Question objects are unique in that they are an extension of both Content and IntransitiveActivity. That is, the Question object is an Activity but the direct object is the question itself.

Either of the anyOf and oneOf properties MAY be used to express possible answers, but a Question object MUST NOT have both properties.

Extends: Content AND IntransitiveActivity.
Properties:

oneOf | anyOf

Inherits all properties from Content and IntransitiveActivity.
Event URI: http://www.w3.org/ns/activitystreams#Event
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Event",
  "name": "A Party!",
  "startTime": "2014-12-31T23:00:00-08:00",
  "endTime": "2015-01-01T06:00:00-08:00"
}
Notes: Represents any kind of event.
Extends: Object
Properties: Inherits all properties from Object.
Place URI: http://www.w3.org/ns/activitystreams#Place
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Work"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Fresno Area",
  "latitude": 36.75,
  "longitude": 119.7667,
  "radius": 15,
  "units": "miles"
}
Notes: Represents a logical or physical location. See for additional information.
Extends: Object
Properties:

accuracy | altitude | latitude | longitude | radius | units

Inherits all properties from Object.
Mention URI: http://www.w3.org/ns/activitystreams#Mention
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Mention",
  "href": "http://example.org/joe",
  "name": "Joe"
}
Notes: A specialized Link that represents an @mention.
Extends: Link
Properties: Inherits all properties from Link.
Profile URI: http://www.w3.org/ns/activitystreams#Profile
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Profile",
  "name": "Sally's Profile",
  "attributedTo": {
    "type": "Person",
    "name": "Sally Smith"
  }
}
Notes: A Profile is a content object that describes another Object, typically used to describe Actor, objects. The describes property is used to reference the object being described by the profile.
Extends: Content
Properties:

describes

Inherits all properties from Content.

Properties

Base URI: http://www.w3.org/ns/activitystreams#.

The common properties include: actor | attachment | attributedTo | bcc | bto | cc | context | current | first | generator | icon | image | inReplyTo | instrument | last | location | items | oneOf | anyOf | origin | next | object | prev | preview | result | replies | scope | tag | target | to | url | accuracy | altitude | content | name | duration | height | href | hreflang | partOf | latitude | longitude | mediaType | endTime | published | startTime | radius | rel | startIndex | summary | totalItems | units | updated | width | subject | relationship | describes

The "Domain" indicates the type of Object the property term applies to. The "Range" indicates the type of value the property term can have. Certain properties are marked as a "Subproperty Of" another term, meaning that the term is a specialization of the referenced term. For instance, actor is a subproperty of attributedTo. Properties marked as being "Functional" can have only one value. Items not marked as "Functional" can have multiple values.

Term Description Example
actor URI: http://www.w3.org/ns/activitystreams#actor
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/foo"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": {
    "type": "Person",
    "id": "http://sally.example.org",
    "name": "Sally"
  },
  "object": "http://example.org/foo"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": [
    "http://joe.example.org",
    {
      "type": "Person",
      "id": "http://sally.example.org",
      "name": "Sally"
    }
  ],
  "object": "http://example.org/foo"
}
Notes: Describes one or more entities that either performed or are expected to perform the activity. Any single activity can have multiple actors. The actor MAY be specified using an indirect Link.
Domain: Activity
Range: Actor | Link
Subproperty Of: attributedTo
attachment URI: http://www.w3.org/ns/activitystreams#attachment
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "name": "A Simple Note",
  "attachment": [
    {
      "type": "Image",
      "content": "A simple Image",
      "url": "http://example.org/cat.jpeg"
    }
  ]
}
Notes: Identifies a resource attached or related to an object that potentially requires special handling. The intent is to provide a model that is at least semantically similar to attachments in email.
Domain: Object
Range: Object | Link
attributedTo URI: http://www.w3.org/ns/activitystreams#attributedTo
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Image",
  "name": "A Simple Image",
  "url": "http://example.org/cat.jpeg",
  "attributedTo": [
    {
      "type": "Person",
      "name": "Sally"
    }
  ]
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Image",
  "name": "A Simple Image",
  "url": "http://example.org/cat.jpeg",
  "attributedTo": [
    "http://joe.example.org",
    {
      "type": "Person",
      "name": "Sally"
    }
  ]
}
Notes: Identifies one or more entities to which this object is attributed. The attributed entities might not be Actors. For instance, an object might be attributed to the completion of another activity.
Domain: Link | Object
Range: Link | Object
bcc URI: http://www.w3.org/ns/activitystreams#bcc
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": "http://john.example.org",
  "bcc": [ "http://joe.example.org" ]
}
Notes: Identifies one or more Actors that are part of the private secondary audience of this Object.
Domain: Object
Range: Actor | Link
bto URI: http://www.w3.org/ns/activitystreams#bto
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": "http://john.example.org",
  "bto": [ "http://joe.example.org" ]
}
Notes: Identifies an Actor that is part of the private primary audience of this Object.
Domain: Object
Range: Actor | Link
cc URI: http://www.w3.org/ns/activitystreams#cc
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": "http://john.example.org",
  "cc": [ "http://joe.example.org" ]
}
Notes: Identifies an Actor that is part of the public secondary audience of this Object.
Domain: Object
Range: Actor | Link
context URI: http://www.w3.org/ns/activitystreams#context
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "items": [
    {
      "type": "Offer",
      "actor": "http://sally.example.org",
      "object": "http://example.org/posts/1",
      "target": "http://john.example.org",
      "context": "http://example.org/contexts/1"
    },
    {
      "type": "Like",
      "actor": "http://joe.example.org",
      "object": "http://example.org/posts/2",
      "context": "http://example.org/contexts/1"
    }
  ]
}
Notes:

Identifies the context within which the object exists or an activity was performed.

The notion of "context" used is intentionally vague. The intended function is to serve as a means of grouping objects and activities that share a common originating context or purpose. An example could be all activities relating to a common project or event.

Domain: Object
Range: Object | Link
current URI: http://www.w3.org/ns/activitystreams#current
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 3,
  "current": "http://example.org/collection",
  "items": [
    "http://example.org/posts/1",
    "http://example.org/posts/2",
    "http://example.org/posts/3"
  ]
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 3,
  "current": {
    "type": "Link",
    "name": "Most Recent Items",
    "href": "http://example.org/collection"
  },
  "items": [
    "http://example.org/posts/1",
    "http://example.org/posts/2",
    "http://example.org/posts/3"
  ]
}
Notes: In a paged Collection, indicates the page that contains the most recently updated member items.
Domain: CollectionPage
Range: CollectionPage | Link
Functional: True
first URI: http://www.w3.org/ns/activitystreams#first
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 3,
  "first": "http://example.org/collection?page=0"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 3,
  "first": {
    "type": "Link",
    "name": "First Page",
    "href": "http://example.org/collection?page=0"
  }
}
Notes: In a paged Collection, indicates the furthest preceeding page of items in the collection.
Domain: CollectionPage
Range: CollectionPage | Link
Functional: True
generator URI: http://www.w3.org/ns/activitystreams#generator
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A simple note",
  "generator": {
    "type": "Application",
    "name": "My Note Application"
  }
}
Notes: Identifies the entity (e.g. an application) that generated the object.
Domain: Object
Range: Object | Link
icon URI: http://www.w3.org/ns/activitystreams#icon
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A Simple note",
  "icon": {
    "type": "Image",
    "name": "Note",
    "url": "http://example.org/note.png",
    "width": 16,
    "height": 16
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A Simple note",
  "icon": [
    {
      "type": "Image",
      "name": "Note (16x16)",
      "url": "http://example.org/note1.png",
      "width": 16,
      "height": 16
    },
    {
      "type": "Image",
      "name": "Note (32x32)",
      "url": "http://example.org/note2.png",
      "width": 32,
      "height": 32
    }
  ]
}
Notes: Indicates an entity that describes an icon for this object. The image should have an aspect ratio of one (horizontal) to one (vertical) and should be suitable for presentation at a small size.
Domain: Object
Range: Image | Link
image URI: http://www.w3.org/ns/activitystreams#image
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A Simple note",
  "image": {
    "type": "Image",
    "name": "A Cat",
    "url": "http://example.org/cat.png"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A Simple note",
  "image": [
    {
      "type": "Image",
      "name": "Cat 1",
      "url": "http://example.org/cat1.png"
    },
    {
      "type": "Image",
      "name": "Cat 2",
      "url": "http://example.org/cat2.png"
    }
  ]
}
Notes: Indicates an entity that describes an image for this object. Unlike the icon property, there are no aspect ratio or display size limitations assumed.
Domain: Object
Range: Image | Link
inReplyTo URI: http://www.w3.org/ns/activitystreams#inReplyTo
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A simple note",
  "inReplyTo": {
    "type": "Note",
    "content": "Another note"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A simple note",
  "inReplyTo": "http://example.org/posts/1"
}
Notes: Indicates one or more entities for which this object is considered a response.
Domain: Object
Range: Object | Link
instrument URI: http://www.w3.org/ns/activitystreams#instrument
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Listen",
  "actor": {
    "type": "Person",
    "name": "Sally"
  },
  "object": "http://example.org/foo.mp3",
  "instrument": {
    "type": "Service",
    "name": "Acme Music Service"
  }
}
Notes: Identifies one or more objects used (or to be used) in the completion of an Activity.
Domain: Activity
Range: Object | Link
last URI: http://www.w3.org/ns/activitystreams#last
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 3,
  "last": "http://example.org/collection?page=1"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 5,
  "last": {
    "type": "Link",
    "name": "Last Page",
    "href": "http://example.org/collection?page=1"
  }
}
Notes: In a paged Collection, indicates the furthest proceeding page of the collection.
Domain: CollectionPage
Range: CollectionPage | Link
Functional: True
location URI: http://www.w3.org/ns/activitystreams#location
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Person",
  "name": "Sally",
  "location": {
    "type": "Place",
    "longitude": 12.34,
    "latitude": 56.78,
    "altitude": 90,
    "units": "m"
  }
}
Notes: Indicates one or more physical or logical locations associated with the object.
Domain: Object
Range: Object | Link
items URI: http://www.w3.org/ns/activitystreams#items
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 2,
  "items": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "OrderedCollection",
  "totalItems": 2,
  "orderedItems": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes: Identifies the items contained in a collection. The items might be ordered or unordered.
Domain: Collection
Range: Object | Link | Ordered List of [Object | Link ]
oneOf URI: http://www.w3.org/ns/activitystreams#oneOf
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Question",
  "name": "What is the answer?",
  "oneOf": [
    {
      "type": "Note",
      "name": "Option A"
    },
    {
      "type": "Note",
      "name": "Option B"
    }
  ]
}
Notes: Identifies an exclusive option for a Question. Use of oneOf implies that the Question can have only a single answer. To indicate that a Question can have multiple answers, use anyOf.
Domain: Question
Range: Object | Link
anyOf URI: http://www.w3.org/ns/activitystreams#anyOf
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Question",
  "name": "What is the answer?",
  "anyOf": [
    {
      "type": "Note",
      "name": "Option A"
    },
    {
      "type": "Note",
      "name": "Option B"
    }
  ]
}
Notes: Identifies an inclusive option for a Question. Use of anyOf implies that the Question can have multiple answers. To indicate that a Question can have only one answer, use oneOf.
Domain: Question
Range: Object | Link
origin URI: http://www.w3.org/ns/activitystreams#origin
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Move",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": {
    "type": "Collection",
    "name": "List B"
  },
  "origin": {
    "type": "Collection",
    "name": "List A"
  }
}
Notes: Describes an indirect object of the activity from which the activity is directed. The precise meaning of the origin is the object of the English preposition "from". For instance, in the activity "John moved an item to List B from List A", the origin of the activity is "List A".
Domain: Activity
Range: Object | Link
next URI: http://www.w3.org/ns/activitystreams#next
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "CollectionPage",
  "next": "http://example.org/collection?page=2",
  "items": [
    "http://example.org/posts/1",
    "http://example.org/posts/2",
    "http://example.org/posts/3"
  ]
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "CollectionPage",
  "next": {
    "type": "Link",
    "name": "Next Page",
    "href": "http://example.org/collection?page=2"
  },
  "items": [
    "http://example.org/posts/1",
    "http://example.org/posts/2",
    "http://example.org/posts/3"
  ]
}
Notes: In a paged Collection, indicates the next page of items.
Domain: CollectionPage
Range: CollectionPage | Link
Functional: True
object URI: http://www.w3.org/ns/activitystreams#object
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Like",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Like",
  "actor": "http://sally.example.org",
  "object": {
    "type": "Note",
    "content": "A simple note"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Like",
  "actor": "http://sally.example.org",
  "object": [
    "http://example.org/posts/1",
    {
      "type": "Note",
      "content": "A simple note"
    }
  ]
}
Notes:

When used within an Activity, describes the direct object of the activity. For instance, in the activity "John added a movie to his wishlist", the object of the activity is the movie added.

When used within a Relationship describes the entity to which the subject is related.

Domain: Activity | Relationship
Range: Object | Link
prev URI: http://www.w3.org/ns/activitystreams#prev
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "CollectionPage",
  "prev": "http://example.org/collection?page=1",
  "items": [
    "http://example.org/posts/1",
    "http://example.org/posts/2",
    "http://example.org/posts/3"
  ]
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "CollectionPage",
  "prev": {
    "type": "Link",
    "name": "Previous Page",
    "href": "http://example.org/collection?page=1"
  },
  "items": [
    "http://example.org/posts/1",
    "http://example.org/posts/2",
    "http://example.org/posts/3"
  ]
}
Notes: In a paged Collection, identifies the previous page of items.
Domain: CollectionPage
Range: CollectionPage | Link
Functional: True
preview URI: http://www.w3.org/ns/activitystreams#preview
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Video",
  "name": "Cool New Movie",
  "duration": "PT2H30M",
  "preview": {
    "type": "Link",
    "name": "Trailer",
    "href": "http://example.org/trailer.mkv",
    "mediaType": "video/mkv",
    "duration": "PT1M"
  }
}
Notes: Identifies an entity that provides a preview of this object.
Domain: Link | Object
Range: Link | Object
result URI: http://www.w3.org/ns/activitystreams#result
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": ["Activity", "http://www.verbs.example/Check"],
  "actor": "http://sally.example.org",
  "object": "http://example.org/flights/1",
  "result": {
    "type": "http://www.types.example/flightstatus",
    "name": "On Time"
  }
}
Notes: Describes the result of the activity. For instance, if a particular action results in the creation of a new resource, the result property can be used to describe that new resource.
Domain: Activity
Range: Object | Link
replies URI: http://www.w3.org/ns/activitystreams#replies
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "id": "http://www.test.example/notes/1",
  "content": "A simple note",
  "replies": {
    "type": "Collection",
    "totalItems": 1,
    "items": [
      {
        "type": "Note",
        "content": "A response to the note",
        "inReplyTo": "http://www.test.example/notes/1"
      }
    ]
  }
}
Notes: Identifies a Collection containing objects considered to be responses to this object.
Domain: Object
Range: Collection
Functional: True
scope URI: http://www.w3.org/ns/activitystreams#scope
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A simple note",
  "scope": {
    "type": "http://example.org/Organization",
    "name": "My Organization"
  }
}
Notes: Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant.
Domain: Object
Range: Object | Link
tag URI: http://www.w3.org/ns/activitystreams#tag
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Image",
  "name": "Picture of Sally",
  "url": "http://example.org/sally.jpg",
  "tag": [
    {
      "type": "Person",
      "id": "http://sally.example.org",
      "name": "Sally"
    }
  ]
}
Notes: One or more "tags" that have been associated with an objects. A tag can be any kind of Object. The key difference between attachment and tag is that the former implies association by inclusion, while the latter implies associated by reference.
Domain: Object
Range: Object | Link
target URI: http://www.w3.org/ns/activitystreams#target
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": "http://john.example.org"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": {
    "type": "Person",
    "name": "John"
  }
}
Notes: Describes the indirect object, or target, of the activity. The precise meaning of the target is largely dependent on the type of action being described but will often be the object of the English preposition "to". For instance, in the activity "John added a movie to his wishlist", the target of the activity is John's wishlist. An activity can have more than one target.
Domain: Activity
Range: Object | Link
to URI: http://www.w3.org/ns/activitystreams#to
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Offer",
  "actor": "http://sally.example.org",
  "object": "http://example.org/posts/1",
  "target": "http://john.example.org",
  "to": [ "http://joe.example.org" ]
}
Notes: Identifies an entity considered to be part of the public primary audience of an Object
Domain: Object
Range: Object | Link
url URI: http://www.w3.org/ns/activitystreams#url
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Document",
  "name": "4Q Sales Forecast",
  "url": "http://example.org/4q-sales-forecast.pdf"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Document",
  "name": "4Q Sales Forecast",
  "url": {
    "type": "Link",
    "href": "http://example.org/4q-sales-forecast.pdf"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Document",
  "name": "4Q Sales Forecast",
  "url": [
    {
      "type": "Link",
      "href": "http://example.org/4q-sales-forecast.pdf",
      "mediaType": "application/pdf"
    },
    {
      "type": "Link",
      "href": "http://example.org/4q-sales-forecase.html",
      "mediaType": "text/html"
    }
  ]
}
Notes: Identifies one or more links to representations of the object
Domain: Object
Range: xsd:anyURI | Link
accuracy URI: http://www.w3.org/ns/activitystreams#accuracy
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "latitude": 36.75,
  "longitude": 119.7667,
  "accuracy": 94.5
}
Notes: Indicates the accuracy of position coordinates on a Place objects. Expressed in properties of percentage. e.g. "94.0" means "94.0% accurate".
Domain: Place
Range: xsd:float [>= 0.0f, <= 100.0f]
Functional: True
altitude URI: http://www.w3.org/ns/activitystreams#altitude
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Fresno Area",
  "altitude": 15.0,
  "latitude": 36.75,
  "longitude": 119.7667,
  "units": "miles"
}
Notes: Indicates the altitude of a place. The measurement units is indicated using the units property. If units is not specified, the default is assumed to be "m" indicating meters.
Domain: Object
Range: xsd:float
Functional: True
content URI: http://www.w3.org/ns/activitystreams#content
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A <i>simple</i> note"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "contentMap": {
    "en": "A <i>simple</i> note",
    "sp": "Una <i>simple</i> nota"
  }
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "mediaType": "text/markdown",
  "content": "## A simple note\nA simple markdown `note`"
}
Notes:

The content or textual representation of the Object encoded as a JSON string. By default, the value of content is HTML. The mediaType property can be used in the object to indicate a different content type.

The content MAY be expressed using multiple language-tagged values.

Domain: Object
Range: xsd:string | rdf:langString
name URI: http://www.w3.org/ns/activitystreams#name
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "name": "A simple note"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "nameMap": {
    "en": "A simple note",
    "sp": "Una simple nota"
  }
}
Notes: A simple, human-readable, plain-text name for the object. HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values.
Domain: Object | Link
Range: xsd:string | rdf:langString
duration URI: http://www.w3.org/ns/activitystreams#duration
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Video",
  "name": "A Simple Video",
  "url": "http://example.org/video.mkv",
  "duration": "PT2H"
}
Notes: When the object describes a time-bound resource, such as an audio or video, a meeting, etc, the duration property indicates the object's approximate duration. The value MUST be expressed as an [[!RFC3339]] (ISO 8601) duration (e.g. a period of 5 seconds is represented as "PT5S").
Domain: Content | Link
Range: xsd:duration
Functional: True
height URI: http://www.w3.org/ns/activitystreams#height
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Content",
  "name": "Some generic content",
  "content": "<p>This can be any kind of content</p>",
  "height": 100,
  "width": 100
}
Notes: When the object describes a visual resource, such as an image, video or embeddable HTML, the height property indicates the recommended display height in properties of device-independent pixels.
Domain: Content | Link
Range: xsd:nonNegativeInteger
Functional: True
href URI: http://www.w3.org/ns/activitystreams#href
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Link",
  "href": "http://example.org/abc",
  "mediaType": "text/html",
  "name": "An example link"
}
Notes: The target resource pointed to by a Link.
Domain: Link
Range: xsd:anyURI
Functional: True
hreflang URI: http://www.w3.org/ns/activitystreams#hreflang
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Link",
  "href": "http://example.org/abc",
  "hreflang": "en",
  "mediaType": "text/html",
  "name": "An example link"
}
Notes: Hints as to the language used by the target resource. Value MUST be a [[!RFC5646]] Language-Tag.
Domain: Link
Range: [[!RFC5646]] Language Tag
Functional: True
partOf URI: http://www.w3.org/ns/activitystreams#partOf
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "CollectionPage",
  "id": "http://example.org/collection?page=1",
  "partOf": "http://example.org/collection",
  "items": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes: Identifies the Collection to which a CollectionPage objects items belong.
Domain: CollectionPage
Range: Link | Collection
Functional: True
latitude URI: http://www.w3.org/ns/activitystreams#latitude
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Fresno Area",
  "latitude": 36.75,
  "longitude": 119.7667,
  "radius": 15,
  "units": "miles"
}
Notes: The latitude of a place
Domain: Place
Range: xsd:float
Functional: True
longitude URI: http://www.w3.org/ns/activitystreams#longitude
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Fresno Area",
  "latitude": 36.75,
  "longitude": 119.7667,
  "radius": 15,
  "units": "miles"
}
Notes: The longitude of a place
Domain: Place
Range: xsd:float
Functional: True
mediaType URI: http://www.w3.org/ns/activitystreams#mediaType
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Link",
  "href": "http://example.org/abc",
  "hreflang": "en",
  "mediaType": "text/html",
  "name": "An example link"
}
Notes:

When used on a Link, identifies the MIME media type of the referenced resource.

When used on an Object, identifies the MIME media type of the value of the content property. If not specified, the content property is assumed to contain text/html content.

Domain: Link | Object
Range: MIME Media Type
Functional: True
endTime URI: http://www.w3.org/ns/activitystreams#endTime
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Event",
  "name": "A Party!",
  "startTime": "2014-12-31T23:00:00-08:00",
  "endTime": "2015-01-01T06:00:00-08:00"
}
Notes: The date and time describing the actual or expected ending time of the object. When used with an Activity object, for instance, the endTime property specifies the moment the activity concluded or is expected to conclude.
Domain: Object
Range: xsd:dateTime
Functional: True
published URI: http://www.w3.org/ns/activitystreams#published
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A simple note",
  "published": "2014-12-12T12:12:12Z"
}
Notes: The date and time at which the object was published
Domain: Object
Range: xsd:dateTime
Functional: True
startTime URI: http://www.w3.org/ns/activitystreams#startTime
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Event",
  "name": "A Party!",
  "startTime": "2014-12-31T23:00:00-08:00",
  "endTime": "2015-01-01T06:00:00-08:00"
}
Notes: The date and time describing the actual or expected starting time of the object. When used with an Activity object, for instance, the startTime property specifies the moment the activity began or is scheduled to begin.
Domain: Object
Range: xsd:dateTime
Functional: True
radius URI: http://www.w3.org/ns/activitystreams#radius
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Fresno Area",
  "latitude": 36.75,
  "longitude": 119.7667,
  "radius": 15,
  "units": "miles"
}
Notes: The radius from the given latitude and longitude for a Place. The units is expressed by the units property. If units is not specified, the default is assumed to be "m" indicating "meters".
Domain: Place
Range: xsd:float [>= 0.0f]
Functional: True
rel URI: http://www.w3.org/ns/activitystreams#rel
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Link",
  "href": "http://example.org/abc",
  "hreflang": "en",
  "mediaType": "text/html",
  "name": "An example link",
  "rel": ["canonical", "preview"]
}
Notes:

A link relation associated with a Link. The value MUST conform to both the [[HTML5]] and [[RFC5988]] "link relation" definitions.

In the [[HTML5]], any string not containing the "space" U+0020, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), "CR" (U+000D) or "," (U+002C) characters can be used as a valid link relation.

Domain: Link
Range: [[!RFC5988]] or [HTML5] Link Relation
startIndex URI: http://www.w3.org/ns/activitystreams#startIndex
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "OrderedCollectionPage",
  "startIndex": 0,
  "orderedItems": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes: A non-negative integer value identifying the relative position within the logical view of a strictly ordered collection.
Domain: OrderedCollectionPage
Range: xsd:nonNegativeInteger
Functional: True
summary URI: http://www.w3.org/ns/activitystreams#summary
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "summary": "A simple <i>note</i>"
}
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "summaryMap": {
    "en": "A simple <i>note</i>",
    "sp": "Una simple <i>nota</i>"
  }
}
Notes: A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.
Domain: Object
Range: xsd:string | rdf:langString
totalItems URI: http://www.w3.org/ns/activitystreams#totalItems
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "totalItems": 2,
  "items": [
    {
      "type": "Note",
      "name": "A Simple Note"
    },
    {
      "type": "Note",
      "name": "Another Simple Note"
    }
  ]
}
Notes: A non-negative integer specifying the total number of objects contained by the logical view of the collection. This number might not reflect the actual number of items serialized within the Collection object instance.
Domain: Collection
Range: xsd:nonNegativeInteger
Functional: True
units URI: http://www.w3.org/ns/activitystreams#units
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Place",
  "name": "Fresno Area",
  "latitude": 36.75,
  "longitude": 119.7667,
  "radius": 15,
  "units": "miles"
}
Notes: Specifies the measurement units for the radius and altitude properties on a Place object. If not specified, the default is assumed to be "m" for "meters".
Domain: Place
Range: "cm" | "feet" | "inches" | "km" | "m" | "miles" | xsd:anyURI
Functional: True
updated URI: http://www.w3.org/ns/activitystreams#updated
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "A simple note",
  "updated": "2014-12-12T12:12:12Z"
}
Notes: The date and time at which the object was updated
Domain: Object
Range: xsd:dateTime
Functional: True
width URI: http://www.w3.org/ns/activitystreams#width
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Content",
  "name": "Some generic content",
  "content": "<p>This can be any kind of content</p>",
  "height": 100,
  "width": 100
}
Notes: When the object describes a visual resource, such as an image, video or embeddable HTML, the width property indicates the recommended display width in properties of device-independent pixels.
Domain: Content | Link
Range: xsd:nonNegativeInteger
Functional: True
subject URI: http://www.w3.org/ns/activitystreams#subject
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Relationship",
  "subject": {
    "type": "Person",
    "name": "Sally"
  },
  "relationship": "http://purl.org/vocab/relationship/closeFriendOf",
  "object": {
    "type": "Person",
    "name": "John"
  }
}
Notes: On a Relationship object, the a property identifies one of the connected individuals. For instance, for a Relationship object describing "John is related to Sally", subject would refer to John.
Domain: Relationship
Range: Link | Object
Functional: True
relationship URI: http://www.w3.org/ns/activitystreams#relationship
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Relationship",
  "subject": {
    "type": "Person",
    "name": "Sally"
  },
  "relationship": "http://purl.org/vocab/relationship/closeFriendOf",
  "object": {
    "type": "Person",
    "name": "John"
  }
}
Notes: On a Relationship object, the relationship property identifies the kind of relationship that exists between subject and object.
Domain: Relationship
Range: Object
describes URI: http://www.w3.org/ns/activitystreams#describes
{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Profile",
  "describes": {
    "type": "Person",
    "name": "Sally"
  },
  "url": "http://sally.example.org"
}
Notes: On a Profile object, the describes property identifies the object described by the Profile.
Domain: Profile
Range: Object
Functional: True

Implementation Notes

Audience Targeting

Conceptually, every Object has both a Primary and Secondary audience. The Primary audience consists of those entities directly involved or owning the object. The Secondary audience consists of the collection of entities sharing an interest in the object but who might not be directly involved (e.g."followers").

For instance, suppose a social network of three individuals: Bob, Joe and Jane. Bob and Joe are each friends with Jane but are not friends with one another. Bob has chosen to "follow" activities for which Jane is directly involved. Jane shares a file with Joe.

In this example, Jane and Joe are each directly involved in the file sharing activity and together make up the Primary Audience for that event. Bob, having an interest in activities involving Jane, is the Secondary Audience. Knowing this, a system that produces or consumes the activity can intelligently notify each person of the event.

While there are means (based on the action type, actor, object and target of the activity) to infer the primary audience for many types of activities, heuristics do not work in every case and do not provide a means of identifying the secondary audience. The to, cc, bto and bcc properties MAY be used within an Object to explicitly identify the Primary and Secondary audiences.

The prototypical use case for an Object containing these properties is the publication and redistribution of objects through an intermediary. That is, an event source generates the object and publishes it to the intermediary which determines a subset of items to display to specific individual users or groups. Such a determination can be made, in part, by identifying the Primary and Secondary Audiences for each object.

When the event source generates the object and specifies values for the to and cc fields, the intermediary SHOULD redistribute that object with the values of those fields intact, allowing any processor to see who the object has been targeted to. This is precisely the same model used by the to and cc fields in email systems.

There are situations, however, in which disclosing the identity of specific members of the audience may be inappropriate. For instance, a user may not wish to let other users know that they are interested in various topics, individuals or types of events. To support this option, an implementation generating an object MAY use the bto and bcc properties to list entities to whom the object should be privately targeted. When an intermediary receives an object containing these properties, it MUST remove those values prior to redistributing the object. The intent is that systems MUST consider entities listed within the bto and bcc properties as part of the Primary and Secondary audience but MUST NOT disclose that fact to any other party.

Audience targeting information included within an Object only describes the intent of the object creator. With clear exception given to the appropriate handling of bto and bcc, this specification leaves it up to implementations to determine how the audience targeting information is used.

Scope and Context

Activities are rarely isolated events. Often, multiple individual activities will be performed around a similar context or scope. For instance, a collaborators working on a shared project might perform multiple related activities in the process of achieving some goal. Such activities can be logically grouped together using the context property, and scoped to a particular audience using the scope property.

For instance, the following shows two related activities that share a common context and scope:

{
 "@context": "http://www.w3.org/ns/activitystreams",
 "type": "Collection",
 "items": [
   {
     "type": "Create",
     "id": "http://activities.example.com/1",
     "actor": "http://sally.example.org",
     "object": {
       "type": "Note",
       "id": "http://notes.example.com/1",
       "content": "A note"
     },
     "context": {
       "type": "http://example.org/Project",
       "name": "Project XYZ"
     },
     "scope": {
       "type": "Group",
       "name": "Project XYZ Working Group"
     },
     "to": "http://john.example.org"
   },
   {
     "type": "Like",
     "id": "http://activities.example.com/1",
     "actor": "http://john.example.org",
     "object": "http://notes.example.com/1",
     "context": {
       "type": "http://example.org/Project",
       "name": "Project XYZ"
     },
     "scope": {
       "type": "Group",
       "name": "Project XYZ Working Group"
     },
     "to": "http://sally.example.org"
   }
 ]
}

Representing Relationships Between Entities

The Relationship object is used to represent relationships between individuals. It can be used, for instance, to describe that one person is a friend of another, or that one person is a member of a particular organization. The intent of modeling Relationship in this way is to allow descriptions of activities that operate on the relationships in general, and to allow representation of Collections of relationships.

For instance, many social systems have a notion of a "friends list". These are the collection of individuals that are directly connected within a person's social graph. Suppose we have a user, Sally, with direct relationships to users Joe and Jane. Sally considers Joe to be a close friend while Jane is just an acquaintance.

Using the Relationship object, we can model these relationships as:

{
"@context": "http://www.w3.org/ns/activitystreams",
"type": "Collection",
"items": [
{
 "type": "Relationship",
 "subject": {
   "type": "Person",
   "name": "Sally"
 },
 "relationship": "http://purl.org/vocab/relationship/closeFriendOf",
 "object": {
   "type": "Person",
   "name": "Joe"
 }
},
{
 "type": "Relationship",
 "subject": {
   "type": "Person",
   "name": "Sally"
 },
 "relationship": "http://purl.org/vocab/relationship/acquaintanceOf",
 "object": {
   "type": "Person",
   "name": "Jane"
 }
}
]
}

The relationship property specifies the kind of relationship that exists between the two individuals identified by the subject and object properties. Used together, these three properties form what is commonly known as a "reified statement" where subject identifies the subject, relationship identifies the predicate, and object identifies the object.

While use of reified statements can be problematic and confusing in certain situations, their use within the Activity Streams vocabulary to describe relationships provides a straightforward mechanism of describing changes to an individual's social graph. For instance, to indicate that Sally has created a new relationship to user Matt, an implementer can use the Relationship object together with the Create activity:

{
"@context": "http://www.w3.org/ns/activitystreams",
"type": "Create",
"actor": "http://sally.example.org",
"object": {
"type": "Relationship",
"subject": "http://sally.example.org",
"relationship": "http://purl.org/vocab/relationship/closeFriendOf",
"object": "http://matt.example.org",
"startTime": "2015-04-21T12:34:56"
}
}

Additionally, modeling the relationship in this way allows implementers to articulate additional properties of the relationship itself. For instance, the date and time at which the relationship began or ended.

The Activity Streams vocabulary does not define normative values for use with the relationship property. It is expected that implementations will make use of several existing vocabularies that have been developed for the purpose of describing relationships. Examples of such vocabularies include the "Friend of a Friend" and "Relationship" vocabularies.

Modeling "friend requests"

One common use case for many social platforms is the establishment of symmetrical "friend" relationships, in which one user initially extends a request to another user to establish a new connection. Once the connection is made, both users automatically begin receiving notifications about activities performed by the other, and the established relationship becomes visible in either user's "friends list".

The initial "friend request" can be modeled by composing the Offer and Relationship object types as in the following example:

{
"@context": [
"http://www.w3.org/ns/activitystreams",
{"colleagueOf": "http://purl.org/vocab/relationship/colleagueOf"}
],
"id": "http://example.org/connection-requests/123",
"type": "Offer",
"actor": "acct:sally@example.org",
"object": {
"id": "http://example.org/connections/123",
"type": "Relationship",
"subject": "acct:sally@example.org",
"relationship": "colleagueOf",
"object": "acct:john@example.org"
},
"target": "acct:john@example.org"
}

Assuming the "friend request" is accepted, the remaining steps in this common application scenario can be represented as a set of distinct activities:

{
"@context": "http://www.w3.org/ns/activitystreams",
"type": "Collection",
"items": [
{
 "id": "http://example.org/activities/122",
 "type": "Accept",
 "actor": "acct:john@example.org",
 "object": "http://example.org/connection-requests/123",
 "inReplyTo": "http://example.org/connection-requests/123",
 "context": "http://example.org/connections/123",
 "result": [
   "http://example.org/activities/123",
   "http://example.org/activities/124",
   "http://example.org/activities/125",
   "http://example.org/activities/126"
 ]
},
{
 "id": "http://example.org/activities/123",
 "type": "Follow",
 "actor": "acct:john@example.org",
 "object": "acct:sally@example.org",
 "context": "http://example.org/connections/123"
},
{
 "id": "http://example.org/activities/124",
 "type": "Follow",
 "actor": "acct:sally@example.org",
 "object": "acct:john@example.org",
 "context": "http://example.org/connections/123"
},
{
 "id": "http://example.org/activities/125",
 "type": "Add",
 "actor": "acct:john@example.org",
 "object": "http://example.org/connections/123",
 "target": {
   "type": "Collection",
   "name": "John's Connections"
 },
 "context": "http://example.org/connections/123"
},
{
 "id": "http://example.org/activities/126",
 "type": "Add",
 "actor": "acct:sally@example.org",
 "object": "http://example.org/connections/123",
 "target": {
   "type": "Collection",
   "name": "Sally's Connections"
 },
 "context": "http://example.org/connections/123"
}
]
}

As illustrated in this example, accepting the "friend request" results in four additional activities including: John following Sally, Sally following John, John adding the relationship with Sally to his collection of Connections, and Sally adding the relationship with John to her collection of Connections.

In this example,

  1. The optional result property is used within the Accept activity to identify the additional activities that occurred as a result of the accept.
  2. The optional context property is used to relate the various activities back to a common reference point, which in this example is the relationship being established. The context allows an implementation to efficiently group related activities together for display or analytic purposes.

Representing Places

The Place object is used to represent both physical and logical locations. While numerous existing vocabularies exist for describing locations in a variety of ways, inconsistencies and incompatibilities between those vocabularies make it difficult to achieve appropriate interoperability between implementations. The Place object is included within the Activity vocabulary to provide a minimal, interoperable starting point for describing locations consistently across Activity Streams 2.0 implementations.

The Place object is intentionally flexible. It can, for instance, be used to identify a location simply by name:

{
"@context": "http://www.w3.org/ns/activitystreams",
"type": "Place",
"name": "San Francisco, CA"
}

Or, by longitude and latitude:

{
"@context": "http://www.w3.org/ns/activitystreams",
"type": "Place",
"name": "San Francisco, CA",
"longitude": "122.4167",
"latitude": "37.7833"
}

The Place object can also describe an area around a given point using the radius property, the altitude of the location, and a degree of accuracy.

While publishers are not required to use these specific properties and MAY make use of other mechanisms for describing locations, consuming implementations that support the Place object MUST support the use of these properties.

Representing Questions

The Question object can be used to express various types of inquiries.

For instance, simple open-ended questions similar to those posted to crowd-sourced question and answer websites:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "id": "http://help.example.org/question/1",
  "type": "Question",
  "content": "I'd like to build a robot to feed my cat. Should I use Arduino or Raspberry Pi?"
}

Multiple-choice questions or "polls" are also supported using either the oneOf or anyOf properties:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "id": "http://polls.example.org/question/1",
  "type": "Question",
   "content": "I'd like to build a robot to feed my cat. Which platform is best?",
   "oneOf": [
     {"name": "arduino"},
     {"name": "raspberry pi"}
   ]
 }

Responses to questions are expressed as Objects containing an inReplyto property referencing the Question.

{
 "@context": "http://www.w3.org/ns/activitystreams",
 "attributedTo": "http://sally.example.org",
 "inReplyTo": "http://polls.example.org/question/1",
 "name": "arduino"
}

Because Question objects are also instances of Activity, the result property can be used to express the results or outcome of the Question (as appropriate):

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "id": "http://polls.example.org/question/1",
  "type": "Question",
   "content": "I'd like to build a robot to feed my cat. Which platform is best?",
   "oneOf": [
     {"name": "arduino"},
     {"name": "raspberry pi"}
   ],
   "replies": {
     "type": "Collection",
     "totalItems": 3,
     "items": [
       {
         "attributedTo": "http://sally.example.org",
         "inReplyTo": "http://polls.example.org/question/1",
         "name": "arduino"
       },
       {
         "attributedTo": "http://joe.example.org",
         "inReplyTo": "http://polls.example.org/question/1",
         "name": "arduino"
       },
       {
         "attributedTo": "http://john.example.org",
         "inReplyTo": "http://polls.example.org/question/1",
         "name": "raspberry pi"
       }
     ]
   },
   "result": {
     "type": "Note",
     "content": "Users are favoriting &quot;arduino&quot; by a 33% margin."
   }
 }

Inverse Activities and "Undo"

Several of the core Activity types are defined as natural inversions of one another. These include:

It is important to note that these types of activities are semantically distinct from one another and have no direct relationship on the other. That is, for example, if an actor "likes" a note at one point in time then later "dislikes" it, the "dislike" activity does not "undo" or negate out the prior "like".

The appropriate interpretation for the following is that Sally first liked, then later disliked John's note:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Collection",
  "items": [
    {
      "type": "Like",
      "actor": "http://sally.example.org",
      "id": "http://activities.example.com/1",
      "published": "2015-11-12T12:34:56Z",
      "object": {
        "type": "Note",
        "id": "http://notes.example.com/1",
        "attributedTo": "http://john.example.org",
        "content": "My note"
      }
    },
    {
      "type": "Dislike",
      "actor": "http://sally.example.org",
      "id": "http://activities.example.com/2",
      "published": "2015-12-11T21:43:56Z",
      "object": {
        "type": "Note",
        "id": "http://notes.example.com/1",
        "attributedTo": "http://john.example.org",
        "content": "My note"
      }
    }
  ]
 }

The Undo activity type is defined to provide the specific ability to undo or cancel out a prior activity. The appropriate interpretation for the following, then, is that Sally liked John's note at one point but has explicitly redacted that like later on.

{
 "@context": "http://www.w3.org/ns/activitystreams",
 "type": "Collection",
 "items": [
   {
     "type": "Like",
     "id": "http://activities.example.com/1",
     "actor": "http://sally.example.org",
     "published": "2015-11-12T12:34:56Z",
     "object": {
       "type": "Note",
       "id": "http://notes.example.com/1",
       "attributedTo": "http://john.example.org",
       "content": "My note"
     }
   },
   {
     "type": "Undo",
     "id": "http://activities.example.com/2",
     "actor": "http://sally.example.org",
     "published": "2015-12-11T21:43:56Z",
     "object": "http://activities.example.com/1"
   }
 ]
}

The end result of the former example is that Sally has indicated that she changed her opinion about John's note and now dislikes it, while in the latter example she currently neither likes or dislikes it.

Mentions, Tags and Other Common Social Microsyntaxes

Many social software systems use special text-based microsyntaxes that allow users to define special addressing for notifications, linking, or categorization within objects. For example, including text such as "@username" within an object's content will often route the object to a special "mentions" or "inbox" stream for a particular user. Likewise, including text such as "#topic" within the object's content will often mark the object as being related to the topic "topic". Such mechanisms are commonly referred to as "mentions" and "hashtags", respectively.

While such microsyntaxes MAY be used within the values of the content, name, and summary properties on an Activity Streams Object, implementations SHOULD NOT be required to parse the values of those properties in order to determine the appropriate routing of notifications, categorization or linking between objects. Instead, publishers SHOULD make appropriate use of the vocabulary terms provided specifically for these purposes.

For example, suppose that an author wishes to send a note of thanks to another user named "@sally" with a hashtag of "#givingthanks". A typical way this message would appear within the content of a note is shown below:

A simple note with a mention an a hashtag:
 "Thank you @sally for all your hard work! #givingthanks" 

A typical social software implementation would typically render such a content such that "@sally" is replaced with a hyperlink to "@sally"'s social profile page and "#givingthanks" is replaced with a hyperlink to a listing of other notes that have been "tagged" with the same topic. Most implementations would also send a special notification to sally letting her know that a note mentioning her has been created.

The following illustrates an equivalent Activity Streams Note object:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "Thank you <a href=\"http://sally.example.org\">@sally</a>
      for all your hard work!
      <a href=\"http://example.org/tags/givingthanks\">#givingthanks</a>",
  "to": {
    "type": "Person",
    "id": "http://sally.example.org"
  },
  "tag": {
    "id": "http://example.org/tags/givingthanks",
    "name": "#givingthanks"
  }
}

The to property indicates that the user "@sally" is to be considered part of the primary audience of the note and should therefore receive notification. The tag property associates the Note with a reference to "http://example.org/tags/givingthanks". Note that the content still includes the "@sally" and "#givingthanks" microsyntaxes but that consuming implementations are not required to parse those in order to make the appropriate associations.

In the case a publisher wishes to indicate a mention without an associated notification, the publisher can use the Mention object type as a value of the tag property.

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "type": "Note",
  "content": "Thank you @sally for all your hard work! #givingthanks",
  "tag": [
    {
      "type": "Mention",
      "href": "http://example.org/people/sally",
      "name": "@sally"
    },
    {
      "id": "http://example.org/tags/givingthanks",
      "name": "#givingthanks"
    }
  ]
}

Origin and Target

The origin and target properties of an Activity respectively identify the entities from which and to which the action is directed. For instance, in the English statement, "Sally moved the file from Folder A to Folder B", the origin is "Folder A" and the target is "Folder B". This activity is illustrated in the example below:

{
    "@context": "http://www.w3.org/ns/activitystreams",
    "type": "Move",
    "actor": "http://sally.example.org",
    "object": {
      "type": "Document",
      "name": "sales figures"
    },
    "origin": {
      "type": "Collection",
      "name": "Folder A"
    },
    "target": {
      "type": "Collection",
      "name": "Folder B"
    }
  }

The origin property is applicable to any type of activity for which the English preposition "from" can be considered applicable in the sense of identifying the origin, source or provenance of the activity's object.

The target property is applicable to any type of activity for which the English preposition "to" can be considered applicable in the sense of identifying the indirect object or destination of the activity's object.

Non-normative Ontology Definition

A non-normative turtle definition of the Activity Streams 2.0 vocabulary is provided here as a convenience for implementers wishing to use RDF mechanisms for processing Activity Streams 2.0. Note, however, that this document provides the normative definition of the Activity Streams 2.0 vocabulary.