On Tags (including Hash-Tags) in ActivityPub
submitted by
On Tags (including Hash-Tags) in ActivityPub.
1/
I think new developers coming to ActivityPub want to write something like:
"tag": ["apple", "banana", "cherry"]
It is unfortunate that that isn't valid ActivityPub. But, that it must instead be:
"tag": [
{
"type": "Hashtag",
"name": "#apple"
},
{
"type": "Hashtag",
"name": "#banana"
},
{
"type": "Hashtag",
"name": "#cherry"
}
]
...
#ActivityPub #ActivityStreams #FediDev #HashTag #HashTags #Tag #Tags
Human Web Collective
There’s a definition for
Hashtaghere:https://swicg.github.io/miscellany/#Hashtag
On Tags (including Hash-Tags) in ActivityPub.
2/
A new version of ActivityPub could extend the type of "tag" from:
Object | Link
to:
Object | Link | xsd:string
And that would make the following valid ActivityPub:
"tag": ["apple", "banana", "cherry"]
Of course, it would have to be specified how to interpret this. (Ex: as "type":"Hashtag", or whatever.)
#ActivityPub #ActivityStreams #FediDev #HashTag #HashTags #Tag #Tags
@reiver@mastodon.social hmm, I don’t much mind the
"type": "Hashtag"bit. Additional specificity is helpful in the long-run I think.For example,
tagcontains hashtags, but it also contains mentions,"type": "Mention", so that actually makes sense.Additional stuff that falls under the rather general name “tag” could also fit. Tagging a location, tagging an Event, etc.
This might also be what @evan was talking about, I didn’t click through his link yet :stuck_out_tongue_winking_eye: