#JSONLD

Licho's avatar
Licho

@[email protected]

Ok, I can officially say that I don't get . uses it, is built on it. But it doesnt actually give any boost in interoperability. The applications themself must be written with interoperability in mind. It's just fancy aliasing mechanism, am I wrong about it? Maybe that's what it's supposed to be? Was I wrong expecting it to be anything more? It doesn't do any heavy lifting besides the aliasing. It only serves as a reminder to look up the docs of a protocol. You could just as well just get the protocol spec out and it would be equivalent. What's the point?

naturzukunft's avatar
naturzukunft

@[email protected]

is there a json-ld compact "expert" in my bubble ?

naturzukunft's avatar
naturzukunft

@[email protected]

is there a json-ld compact "expert" in my bubble ?

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

@[email protected]

Fediverse Labeler update:

I have been working on a site that anyone can use to see Fediverse Labelers in action.

This is what it looks like if the user it looks up doesn't provide an avatar image or a header image.

I.e., this (in the screenshot) shows the default avatar image and header image.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

For previous posts on Fediverse Labelers, see:

mastodon.social/@reiver/113833

And:

mastodon.social/@reiver/113825

And:

mastodon.social/@reiver/113822

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

@[email protected]

Fediverse Labeler update:

I have been working on a site that anyone can use to see Fediverse Labelers in action.

This is what it looks like if the user it looks up doesn't provide an avatar image or a header image.

I.e., this (in the screenshot) shows the default avatar image and header image.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

2/

For discussion on some of the technical / programming side of Fediverse Labelers, see:

mastodon.social/@reiver/113822

.

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

@[email protected]

1/

More on Fediverse Labelers —

Here is how text-labels from multiple Fediverse Labelers could appear in an application on a person's profile.

...

In this example, the application pulled in 7 labels from 4 different Fediverse Labelers.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

For previous threads on Fediverse Labelers see:

mastodon.social/@reiver/113825

And:

mastodon.social/@reiver/113822

.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

For previous threads on Fediverse Labelers see:

mastodon.social/@reiver/113825

And:

mastodon.social/@reiver/113822

.

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

@[email protected]

Fediverse Labeler update:

I have been working on site that anyone can use to see Fediverse Labelers in action.

I am hoping to get it done soon. (Maybe by the weekend or next week.)

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

3/

This screen mock-up only shows text-labels.

Other types of labels can exist — image labels of different types, virtual object labels, space-time labels, etc.

And labels can have different use-case (in addition to human-readable text) — more on that later.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

2/

For discussion on some of the technical / programming side of Fediverse Labelers, see:

mastodon.social/@reiver/113822

.

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

@[email protected]

1/

More on Fediverse Labelers —

Here is how text-labels from multiple Fediverse Labelers could appear in an application on a person's profile.

...

In this example, the application pulled in 7 labels from 4 different Fediverse Labelers.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

3/

This screen mock-up only shows text-labels.

Other types of labels can exist — image labels of different types, virtual object labels, space-time labels, etc.

And labels can have different use-case (in addition to human-readable text) — more on that later.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

2/

For discussion on some of the technical / programming side of Fediverse Labelers, see:

mastodon.social/@reiver/113822

.

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

@[email protected]

1/

More on Fediverse Labelers —

Here is how text-labels from multiple Fediverse Labelers could appear in an application on a person's profile.

...

In this example, the application pulled in 7 labels from 4 different Fediverse Labelers.

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

4/

Note that even in this example, that there are different types of labels!

I have some examples of text labels.

But I also have some examples of Icon labels.

(Other types of labels could exist, too.)

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

3/

The "describes" field would point to the thing being labelled.

The "attributedTo" field would point to the person or machine that create these label.

And the "attachment" field would be a list of labels.

The (top level) "icon" field would be an icon that would be shown next to the label in the user-interface (UI).

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

@[email protected] · Reply to @reiver ⊼ (Charles) :batman:'s post

2/

A Fediverse Labeler would output a separate ActivityStreams "Profile" Object for each thing it wants to label.

Each of these should be at a separate URL.

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

@[email protected]

1/

This is how a Fediverse Labeler could work.

In particular, This is how a Fediverse Labeler could be represented as ActivityPub / ActivityStreams / JSON-LD data.

{
  "@context": [
    "https://www.w3.org/ns/activitystreams"
  ],
  "type": "Profile",
  "describes": "acct:reiver@mastodon.social",
  "attributedTo": "https://example.com/apps/ratel",
  "icon": {
    "type": "Icon",
    "mediaType": "image/png",
    "url": "https://example.com/apps/ratel/img/icon.png"
  },
  "attachment": [
    {
      "type": "Label",
      "name": "Programmer"
    },
    {
      "type": "Label",
      "name": "Canadian"
    },
    {
      "type": "Icon",
      "mediaType": "image/png",
      "url": "https://example.com/pfp/751f76ed540a40a3b4caae50e50cc867.png"
    },
    {
      "type": "Icon",
      "mediaType": "image/png",
      "url": "https://example.com/pfp/45f7b459257940f490133070a975924b.png"
    }
  ]
}
@reiver ⊼ (Charles) :batman:'s avatar
@reiver ⊼ (Charles) :batman:

@[email protected]

Is any Fediverse (or other) software using or returning an ActivityStreams 'Profile'?

w3.org/TR/activitystreams-voca

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

@[email protected]

json-ld and inspiration from microformats and semantic-html

1/

One of the advantages Microformats and (small "s") semantic-HTML has over HTML, XML, JSON, etc, is —

It is easy to mark a piece of data with multiple semantics.

For example:

<span class="summary title">Hello world!</span>

...

🧵

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

@[email protected]

json-ld

I think using "live" URIs for JSON-LD contexts (that parsers are expected to download from) — are probably a bad idea.

Maybe even a security-hole.

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

@[email protected]

litepub

What is the motivation for encouraging LitePub implementors to "supply a locally hosted version of the LitePub JSON-LD Context"?

Is it just for people using full-out JSON-LD parsers?

Won't this create problems for people using parsers that do NOT go download and interpret context-URIs? And instead just hard-code the vocabulary in their code?

LitePub for ActivityPub Implementors

JSON-LD context

LitePub implementations are not required to use @context properties on their messages. A conformant ActivityPub implementation is required to process these messages with an injected @context of "https://www.w3.org/ns/activitystreams" as described in the ActivityStreams 2.0 Core Specification

However, the LitePub Core Vocabulary differs from the ActivityStreams 2.0 Vocabulary. It is suggested that LitePub implementations supply a locally hosted version of the LitePub JSON-LD Context as their @context. It may be useful to inject a local copy of the LitePub JSON-LD Context instead of the default ActivityStreams 2.0 context when a message is received without a @context as it defines the full LitePub Core Vocabulary in a way that is useful to JSON-LD processors.

Signatures

LitePub implementations MUST use HTTP Signatures to verify the authenticity of messages being delivered to or from peering nodes. The details surrounding the way HTTP Signatures are implemented in LitePub are discussed on the Overview page.
Sebastian Lasse's avatar
Sebastian Lasse

@[email protected]

recently I stumbled upon github.com/w3c/activitystreams and (apart from this concrete issue) it make me think about how _new_ users to the protocol understand the use of multiple languages

The problem why the has a deep learning curve:

In order to understand the use of multiple languages, you need to read at least 4 specifications.
Any user of the software can say: I speak language X in quality Y.
It might not be obvious to new users that it is the according
- HTTP "accept-language" header
like e.g. "de,en-US;q=0.7,en;q=0.3"

The default language is defined in the
- JSON-LD spec. as described in above issue

The primer to read about how to use it is in the
- AS Core specs.
w3.org/TR/activitystreams-core

while the properties are described in the
- Vocabulary specs.
e.g. w3.org/TR/activitystreams-voca

While this is understandable and fine for me, it might be confusing to new or non-tech-implementors …

/ @evan

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

@[email protected]

Interesting. PeerTube content (in their "application/activity+json") can be Markdown.

(Reference: curl -H 'Accept: application/activity+json' tube.archworks.co/videos/watch )

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

@[email protected]

It seems to be common now to put JSON-LD in the HTML source code.

ActivityPub and ActivityStreams files (application/activity+json) are JSON-LD files.

You could put ActivityPub and ActivityStreams in the HTML source code.

@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"
    }
  }
}
@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.