#JSONLD

@reiver ⊼ (Charles) :batman:'s avatar
@reiver ⊼ (Charles) :batman:

@[email protected]

As I mentioned before — I think the Fediverse version of Follow-Packs / Starter-Packs should be some type of ActivityPub / ActivityStreams object.

It could look a lot like the "following" and "followers" URLs look.

RE: mastodon.social/@reiver/113629

@reiver ⊼ (Charles) :batman:'s avatar
@reiver ⊼ (Charles) :batman:

@[email protected]

json-ld

Someone created a list of all the JSON-LD properties used in the Fediverse:

jsonld.bovine.social/

(I haven't tried confirming the accuracy of this list. But, it is interesting.)

@reiver ⊼ (Charles) :batman:'s avatar
@reiver ⊼ (Charles) :batman:

@[email protected]

gotosocial json-ld

GoToSocial has a JSON-LD namespace:

gotosocial.org/ns

{
  "@context": {
    "gts": "https://gotosocial.org/ns#",
    "interactionPolicy": {
      "@id": "gts:interactionPolicy",
      "@type": "@id"
    },
    "canLike": {
      "@id": "gts:canLike",
      "@type": "@id"
    },
    "canReply": {
      "@id": "gts:canReply",
      "@type": "@id"
    },
    "canAnnounce": {
      "@id": "gts:canAnnounce",
      "@type": "@id"
    },
    "always": {
      "@id": "gts:always",
      "@type": "@id"
    },
    "approvalRequired": {
      "@id": "gts:approvalRequired",
      "@type": "@id"
    },
    "approvedBy": {
      "@id": "gts:approvedBy",
      "@type": "@id"
    }
  }
}
{ "@context": { "gts": "https://gotosocial.org/ns#", "interactionPolicy": { "@id": "gts:interactionPolicy", "@type": "@id" }, "canLike": { "@id": "gts:canLike", "@type": "@id" }, "canReply": { "@id": "gts:canReply", "@type": "@id" }, "canAnnounce": { "@id": "gts:canAnnounce", "@type": "@id" }, "always": { "@id": "gts:always", "@type": "@id" }, "approvalRequired": { "@id": "gts:approvalRequired", "@type": "@id" }, "approvedBy": { "@id": "gts:approvedBy", "@type": "@id" } } }
@reiver ⊼ (Charles) :batman:'s avatar
@reiver ⊼ (Charles) :batman:

@[email protected]

json-ld

How much Fediverse software can read the expanded form of JSON-LD?

Or are they making hard-coded assumptions about what the JSON names will be?

I.e.,:

"indexable" : true

Versus:

"http;//joinmastodon·org/ns#indexable" : true

@reiver ⊼ (Charles) :batman:'s avatar
@reiver ⊼ (Charles) :batman:

@[email protected]

json-ld

In some ways, I think it might have been "better" if the Fediverse didn't use JSON-LD and instead just used URLs as key names.

I.e., if it didn't use the "@context" stuff.

"@context" adds a certain type of complexity.

Pablo Berganza (he/him)'s avatar
Pablo Berganza (he/him)

@[email protected]

Continued my experiments with and yesterday and I think I’m confused.

I was trying to make an extension for an Object, and if I understand , the context property contains the definition of any extra property added. I see e.g. the activity streams ns resolves to a nice JSON LD that contains all the properties, but the mastodon one doesn’t resolve to anything? Is it not necessary?

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

In the next version (v0.14.0) of , the performance of the Object.toJsonLd() method will be dramatically (~3k ×) faster. This is expected to improve the overall performance of Fedify apps!

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

The JSON-LD processor ended up being 's bottleneck, so I'm in the process of fixing Fedify to generate JSON-LD without the proper JSON-LD processor.