Skip to content

JSON-LD @context

Various examples the @context property can take. See here for the W3C specification, and here for what ActivityStreams says about it.

Examples

Example 1

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://pyfedi.local/c/pie",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/LbPdBzwSuXQ",
  "published": "2025-09-08T17:27:13Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://pyfedi.local/c/pie"
    ],
    "id": "http://pasture-one-actor/object/a4m6KNbqkSQ",
    "published": "2025-09-08T17:27:13Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "@context url as the ActivityStreams URL",
    "tag": [
      {
        "type": "Mention",
        "href": "http://pyfedi.local/c/pie"
      }
    ]
  }
}
pyfedi
{
  "id": 18,
  "user_id": 2,
  "community_id": 1,
  "title": "@context url as the ActivityStreams URL",
  "deleted": false,
  "nsfw": false,
  "sticky": false,
  "published": "2025-09-08T17:27:13.184979Z",
  "ap_id": "http://pasture-one-actor/object/a4m6KNbqkSQ",
  "local": false,
  "language_id": 2,
  "removed": false,
  "locked": false,
  "body": "@context url as the ActivityStreams URL"
}

Example 2

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams"
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://pyfedi.local/c/pie",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/gEVwEeSelB8",
  "published": "2025-09-08T17:27:13Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://pyfedi.local/c/pie"
    ],
    "id": "http://pasture-one-actor/object/oYjqrAY0X4I",
    "published": "2025-09-08T17:27:13Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams"
    ],
    "content": "@context url is list of ActivityStreams URL",
    "tag": [
      {
        "type": "Mention",
        "href": "http://pyfedi.local/c/pie"
      }
    ]
  }
}
pyfedi
{
  "id": 19,
  "user_id": 2,
  "community_id": 1,
  "title": "@context url is list of ActivityStreams URL",
  "deleted": false,
  "nsfw": false,
  "sticky": false,
  "published": "2025-09-08T17:27:13.897578Z",
  "ap_id": "http://pasture-one-actor/object/oYjqrAY0X4I",
  "local": false,
  "language_id": 2,
  "removed": false,
  "locked": false,
  "body": "@context url is list of ActivityStreams URL"
}

Example 3

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://pyfedi.local/c/pie",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/YxOSONlKrQE",
  "published": "2025-09-08T17:27:14Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://pyfedi.local/c/pie"
    ],
    "id": "http://pasture-one-actor/object/oCZhrX0_iMs",
    "published": "2025-09-08T17:27:14Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      {
        "Hashtag": "as:Hashtag"
      }
    ],
    "content": "@context url is list of ActivityStreams URL and Hashtag",
    "tag": [
      {
        "type": "Mention",
        "href": "http://pyfedi.local/c/pie"
      }
    ]
  }
}
pyfedi
{
  "id": 20,
  "user_id": 2,
  "community_id": 1,
  "title": "@context url is list of ActivityStreams URL and Hashtag",
  "deleted": false,
  "nsfw": false,
  "sticky": false,
  "published": "2025-09-08T17:27:14.613810Z",
  "ap_id": "http://pasture-one-actor/object/oCZhrX0_iMs",
  "local": false,
  "language_id": 2,
  "removed": false,
  "locked": false,
  "body": "@context url is list of ActivityStreams URL and Hashtag"
}

Example 4

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/fep/5711"
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://pyfedi.local/c/pie",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/Z_o-t2fJMOY",
  "published": "2025-09-08T17:27:15Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://pyfedi.local/c/pie"
    ],
    "id": "http://pasture-one-actor/object/x71OrioZZ9k",
    "published": "2025-09-08T17:27:15Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      "https://w3id.org/fep/5711"
    ],
    "content": "@context with ActivityStreams URL + w3id-fep document",
    "tag": [
      {
        "type": "Mention",
        "href": "http://pyfedi.local/c/pie"
      }
    ]
  }
}
pyfedi
{
  "id": 21,
  "user_id": 2,
  "community_id": 1,
  "title": "@context with ActivityStreams URL + w3id-fep document",
  "deleted": false,
  "nsfw": false,
  "sticky": false,
  "published": "2025-09-08T17:27:15.377501Z",
  "ap_id": "http://pasture-one-actor/object/x71OrioZZ9k",
  "local": false,
  "language_id": 2,
  "removed": false,
  "locked": false,
  "body": "@context with ActivityStreams URL + w3id-fep document"
}

Example 5

activity
{
  "@context": null,
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://pyfedi.local/c/pie",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/-_-z53taeyU",
  "published": "2025-09-08T17:27:15Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://pyfedi.local/c/pie"
    ],
    "id": "http://pasture-one-actor/object/rfM099glinU",
    "published": "2025-09-08T17:27:15Z",
    "@context": null,
    "content": "no @context",
    "tag": [
      {
        "type": "Mention",
        "href": "http://pyfedi.local/c/pie"
      }
    ]
  }
}
pyfedi
{
  "id": 22,
  "user_id": 2,
  "community_id": 1,
  "title": "[Microblog] no @context",
  "deleted": false,
  "nsfw": false,
  "sticky": false,
  "published": "2025-09-08T17:27:16.166449Z",
  "ap_id": "http://pasture-one-actor/object/rfM099glinU",
  "local": false,
  "language_id": 2,
  "removed": false,
  "locked": false,
  "body": "no @context"
}

Example 6

activity
{
  "@context": "http://strange.example/context",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://pyfedi.local/c/pie",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/utp3Q5Vz4Ws",
  "published": "2025-09-08T17:27:16Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://pyfedi.local/c/pie"
    ],
    "id": "http://pasture-one-actor/object/qj2Y4TlGIaU",
    "published": "2025-09-08T17:27:16Z",
    "@context": "http://strange.example/context",
    "content": "@context is a broken url",
    "tag": [
      {
        "type": "Mention",
        "href": "http://pyfedi.local/c/pie"
      }
    ]
  }
}
pyfedi
{
  "id": 23,
  "user_id": 2,
  "community_id": 1,
  "title": "@context is a broken url",
  "deleted": false,
  "nsfw": false,
  "sticky": false,
  "published": "2025-09-08T17:27:16.948761Z",
  "ap_id": "http://pasture-one-actor/object/qj2Y4TlGIaU",
  "local": false,
  "language_id": 2,
  "removed": false,
  "locked": false,
  "body": "@context is a broken url"
}