go-fed / activity

ActivityStreams & ActivityPub in golang, oh my!
BSD 3-Clause "New" or "Revised" License
701 stars 111 forks source link

add toot vocabulary #122

Open BenLubar opened 4 years ago

BenLubar commented 4 years ago

(sub-issue of #121)

I don't know how to write the specific JSON format astool wants, but I'll do the research so whoever can write the JSON can do it more easily:

See app/lib/activitypub/adapter.rb in Mastodon for the definition of @context Mastodon uses.

In this context, "the software" refers to what Mastodon does and expects other software to do. as:-prefixed types are described only for reference on what Mastodon uses them for.

The toot: namespace is http://joinmastodon.org/ns#. All other namespaces in this ticket are already used by go-fed.

ActivityStreams Actor extensions:

ActivityStreams Object types:

as:Hashtag

toot:Emoji

schema:PropertyValue

toot:IdentityProof

ActivityStreams Note (status) extensions:

ActivityStreams Question (poll status) extensions:

All Note extensions, as well as:

ActivityStreams Document (media attachment) extensions:

cjslep commented 4 years ago

Thanks a ton for diving into this.

I'll try to get the JSON-LD written up and everything generated in the near future. :)

riking commented 4 years ago

as:alsoKnownAs - Actor IRI(s). Basically a soft version of movedTo that includes all accounts this account claims to be the same user as. Non-directional, unlike movedTo.

The documentation should include the disclaimer that a client is expected to verify bidirectionality of alsoKnownAs relationships, and reject / ignore them if the other entity is retrievable and supports AKA, but does not have this entity in the list.

BenLubar commented 4 years ago

https://www.w3.org/wiki/Activity_Streams_extensions#Proposed_extensions

How do we want to implement these? (Mostly not sure what the id should be)

BenLubar commented 4 years ago

@riking where is alsoKnownAs defined? I can't find anything on w3.org that seems related, and there are only a few results.

BenLubar commented 4 years ago

movedTo seems to only be referenced here: https://www.w3.org/wiki/SocialCG/2017-11-22/minutes#movedTo

cjslep commented 4 years ago

Hey @BenLubar

I got your latest PR merged. Is there more work to be done on this topic? Is there anything I can do to help?

cjslep commented 3 years ago

Hey @BenLubar! Friendly bump, I'd like to cut v1.0.0 soon and would like to know your thoughts on the last missing entries in your OP.

aschrijver commented 3 years ago

Just a FYI: There is an ongoing discussion on SocialHub about as:alsoKnownAs that may impact how to treat this / where it fits:

@rhiaro wrote:

Over in the Decentralized Identifiers (DID) W3C Working Group, we noticed that Mastodon uses the property alsoKnownAs (docs ) for account migration. It’s implemented as though it’s part of the ActivityStreams 2.0 vocabulary although it isn’t actually in there. We also want a property like this for DIDs. In the interest of not duplicating work and to help make Mastodon’s use of the term ‘legit’ we were hoping to agree on a formal definition of alsoKnownAs (which we can publish in the DID Core specification which is on track to become a W3C REC this year) and then add it properly as an ActivityStreams 2.0 extension (via a SocialCG resolution).

rhiaro commented 3 years ago

Thanks for the ping @aschrijver! We have a draft of the alsoKnownAs definition in the DID Core spec editor's draft (this can still be tweaked, we want to make sure the broader community are happy with it). The next step is to get it added as an AS2 extension. There's no real process for that, but I've made a PR on the AS2 namespace and hope to convene a SocialCG meeting to see if there's agreement to add it. I'd suggest a similar process for other AS2-but-not-really-in-AS2-yet terms on the list - ie, define them in a spec-lookin' document somewhere, then propose addition as extension.

cjslep commented 3 years ago

I will try to work w/ Mastodon folks to get a more solid schema definition for the missing entries in the OP, as I'd like for go-fed to support all of these.

sebilasse commented 3 years ago

just a ping to @redaktor

sebilasse commented 3 years ago

Did mastodon reply to you yet? Helpless with images from mastodon …

1) Can anyone explain toot:focalPoint ?

2-element array of numbers between 0 and 1 inclusive (x and y coordinates)

Does it apply to the Profile banner too ? Why is the banner cropped already and not like the user makes it ? Are we now all forced to use the aspectRatio of 9.6 : 3 in our software ?

What is “x and y coordinates” meaning ? Does it imply a percentage value ? Since it is positive only, I assume, the starting point is bottom/right ?

2) What is the sense of toot:blurhash ? The native CSS blur filter has a global adoption of 96.35% and combined with MS CSS filter >99% … Personally I am doing a responsive software, calculate different responsive image sizes and also the smallest whole pixel anyway. Combining the smallest with CSS filter has the same effect. My concern is performance. I would resize anyway to reduce memory allocations. The example is const canvas = document.createElement("canvas"); - does it mean I need a headless serverside browser?

3) Is there any way to apply as:sensitive to a single image instead to all? It is the reason why no one of my photojournalist friends join mastodon …

cjslep commented 3 years ago

Sorry for the delayed response.

No, they did not get back to me. They did briefly mention they wanted to standardize it though. The will is there, not sure about the time/attention/energy.

tsmethurst commented 2 years ago

Hey everyone! I'm gonna start looking at alsoKnownAs and manuallyApprovesFollowers for GoToSocial, because they're things we kinda need in order to federate properly with Masto instances and other software that's accepted those fields as standards.

So I'll mess around a bit with astool and see if I can get something working :)

aschrijver commented 2 years ago

Referencing recent discussion on Fediverse about namespaces in Mastodon between @cjslep and @nightpool

Quoting first post:

@Gargron could Mastodon be more rigorous in creating RDF definitions of the arbitrary assortment of properties and types it's pioneered?

For example, for practical reasons I merged this: https://github.com/go-fed/activity/pull/151

But it's not accurate to say "manuallyApprovesFollowers is an ActivityStreams property".

It is why we generally only support a partial vocabulary of the "Mastodon types": https://github.com/go-fed/activity/issues/122

I think i mentioned this to @nightpool before too.