ActivityPub is primarily a Linked Data standard. It offers an option for developers to treat it as plain JSON for convenient processing by web technologies.
I wonder about the common practice to @context mapping of namespaces to avoid use of namespace prefix in the body of the JSON message. Aren’t we making things too convenient?
The problem is that ActivityStreams is a much overused and overloaded vocabulary already, where developers try (and are even encouraged) to map their own application and business domains and features to the social primitives that AS offers. And then make extension properties look like they are part of AS too.
Isn’t this a better practice:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"toot": "http://joinmastodon.org/ns#",
"foobar": "https://example.org/ns/foobar",
}
],
"type": "Actor",
"toot:discoverable": true,
"foobar:discoveryFoo": "bar",
...
}
Than this, the common practice for JSON convenience:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"toot": "http://joinmastodon.org/ns#",
"discoverable": "toot:discoverable",
"foobar": "https://example.org/ns/foobar",
"discoveryFoo": "foobar:discoveryFoo",
}
],
"type": "Actor",
"discoverable": true,
"discoveryFoo": "bar",
...
}
I’ve seen developers be confused (perhaps because they don’t parse or look-up the context) and say things like "yes, discoverable is part of Actor and can be used as a general consent mechanism. Which is incorrect as discoverable is app-specific for Mastodon, and even where it has become a de-facto standard it still relates to discovery of microblogging accounts.
Generally the way extension happens, mainly through post-facto interoperability, is not the way it is intended. It is done haphazardly without following good design rules.
Today we have relatively few apps and services, and only a handful of well-adopted namespaces ‘do the rounds’, like Mastodon’s app-specific-but-de-facto-standard toot: and more recently the improvement to refer to fep: namespaces.
What about the future? What if AP-based decentralized social networking becomes ubiquitous? 1,000’s of apps and services, numerous extensions and namespaces thereof.