Hashtags and JSON-LD¶
The examples here are various variations of creating the Hashtag element in the tag list. These variations can be useful in understanding how strict an application sees JSON-LD.
Hashtags are a good illustration of JSON-LD parsing as Hashtag is not part of the ActivityStreams vocabulary.
All examples except the first are questionable, and probably should not
be used when publishing to the Fediverse. The examples marked with
⚠️ are expected to fail with a JSON-LD parser. The examples using
as:Hashtag
are expected to fail with a JSON only parser.
Examples¶
Example 1¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"Hashtag": "as:Hashtag",
"sensitive": "as:sensitive"
}
],
"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/NSYs6TS0BiY",
"published": "2025-09-09T12:25:37Z",
"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/7jUveB4eWCc",
"published": "2025-09-09T12:25:37Z",
"content": "text",
"tag": [
{
"type": "Hashtag",
"name": "#test"
},
{
"type": "Mention",
"href": "http://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 14,
"user_id": 2,
"community_id": 1,
"title": "(content in post body)",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-09T12:25:37.831150Z",
"ap_id": "http://pasture-one-actor/object/7jUveB4eWCc",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "text"
}
Example 2¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"Hashtag": "as:Hashtag",
"sensitive": "as:sensitive"
}
],
"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/xTBTgmuKjJ8",
"published": "2025-09-09T12:25:38Z",
"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/-PeWAHv9HBY",
"published": "2025-09-09T12:25:38Z",
"content": "using as:Hashtag",
"tag": [
{
"type": "as:Hashtag",
"name": "#test"
},
{
"type": "Mention",
"href": "http://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 15,
"user_id": 2,
"community_id": 1,
"title": "[Microblog] using as:Hashtag",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-09T12:25:38.593620Z",
"ap_id": "http://pasture-one-actor/object/-PeWAHv9HBY",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "using as:Hashtag"
}
Example 3¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"Hashtag": "as:Hashtag",
"sensitive": "as:sensitive"
}
],
"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/rfBI89xmRe4",
"published": "2025-09-09T12:25:39Z",
"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/rKeAd7Bqp-E",
"published": "2025-09-09T12:25:39Z",
"content": "no type \u26a0\ufe0f ",
"tag": [
{
"name": "#test"
},
{
"type": "Mention",
"href": "http://pyfedi.local/c/pie"
}
]
}
}
no result
Example 4¶
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/xYvfbN-DZ5o",
"published": "2025-09-09T12:25:51Z",
"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/_dmXODroTW4",
"published": "2025-09-09T12:25:51Z",
"@context": "https://www.w3.org/ns/activitystreams",
"content": "Hashtag not in @context \u26a0\ufe0f ",
"tag": [
{
"type": "Hashtag",
"name": "#test"
},
{
"type": "Mention",
"href": "http://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 16,
"user_id": 2,
"community_id": 1,
"title": "Hashtag not in @context \u26a0\ufe0f",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-09T12:25:51.438992Z",
"ap_id": "http://pasture-one-actor/object/_dmXODroTW4",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "Hashtag not in @context \u26a0\ufe0f "
}
Example 5¶
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/NVCzoKdyuBQ",
"published": "2025-09-09T12:25:51Z",
"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/AeCbtAdsKFo",
"published": "2025-09-09T12:25:51Z",
"@context": "https://www.w3.org/ns/activitystreams",
"content": "Hashtag not in @context; as:Hashtag",
"tag": [
{
"type": "as:Hashtag",
"name": "#test"
},
{
"type": "Mention",
"href": "http://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 17,
"user_id": 2,
"community_id": 1,
"title": "Hashtag not in @context; as:Hashtag",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-09T12:25:52.196473Z",
"ap_id": "http://pasture-one-actor/object/AeCbtAdsKFo",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "Hashtag not in @context; as:Hashtag"
}