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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/activity/SQ0nASO44L0",
"published": "2025-09-09T12:25:52Z",
"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/YTaL8VxPC6o",
"published": "2025-09-09T12:25:52Z",
"@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-09T12:25:52.941875Z",
"ap_id": "http://pasture-one-actor/object/YTaL8VxPC6o",
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/activity/CKaaJ7j1sv8",
"published": "2025-09-09T12:25:53Z",
"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/8VjyEqLOxR8",
"published": "2025-09-09T12:25:53Z",
"@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-09T12:25:53.720782Z",
"ap_id": "http://pasture-one-actor/object/8VjyEqLOxR8",
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/activity/fXajHZ9mRWY",
"published": "2025-09-09T12:25:54Z",
"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/HLznKUMbP6A",
"published": "2025-09-09T12:25:54Z",
"@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-09T12:25:54.529763Z",
"ap_id": "http://pasture-one-actor/object/HLznKUMbP6A",
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/activity/MC8l1vn3lIs",
"published": "2025-09-09T12:25:55Z",
"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/YxTGQw3io44",
"published": "2025-09-09T12:25:55Z",
"@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-09T12:25:55.284996Z",
"ap_id": "http://pasture-one-actor/object/YxTGQw3io44",
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/activity/HdOeZ9RlhKM",
"published": "2025-09-09T12:25:55Z",
"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/3BjMIWt6Liw",
"published": "2025-09-09T12:25:55Z",
"@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-09T12:25:56.047492Z",
"ap_id": "http://pasture-one-actor/object/3BjMIWt6Liw",
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/activity/txyIV1ZHkHw",
"published": "2025-09-09T12:25:56Z",
"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/fU-zXj7tVfA",
"published": "2025-09-09T12:25:56Z",
"@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-09T12:25:56.833600Z",
"ap_id": "http://pasture-one-actor/object/fU-zXj7tVfA",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "@context is a broken url"
}