granary icon indicating copy to clipboard operation
granary copied to clipboard

AS2 vocab translation coordination/funkiness

Open strugee opened this issue 7 years ago • 2 comments

Heya!

I'm currently working on translating AS1 vocabulary to AS2 in pump.io in preparation for our migration to ActivityPub - I wanted to see what Granary does and try to align if possible.

Looking at https://github.com/snarfed/granary/blob/d76e923c2fb3142223668c665c3bff7f76207882/granary/as2.py I spotted a couple things that seemed funky:

  • [x] AS2 has no Favorite, it uses Like in all cases instead
  • [ ] Granary has Add as the AS2 equivalent of tag but these seem pretty different semantically (I assumed tag was just dropped but maybe you have a different read on the spec?)
  • [ ] post isn't always equal to Create; it's an Add with a target (https://www.w3.org/TR/activitystreams-core/#activitystreams-1.0a)
  • [ ] Shouldn't https://github.com/snarfed/granary/blob/d76e923c2fb3142223668c665c3bff7f76207882/granary/as2.py#L127 be @type, not type?

Let me know if I missed something. https://github.com/pump-io/pump.io/pull/1483#issuecomment-342046659 is tracking this in pump.io FWIW.

Cheers :)

strugee avatar Nov 22 '17 23:11 strugee

thanks for looking at this! i expect you're right on these points in general. I'll fix them soon!

snarfed avatar Nov 24 '17 06:11 snarfed

Shouldn't type = obj.pop('type', None) be @type, not type?

AS2 prefers type, not @type, right? @type is JSON-LD, right? https://w3c.github.io/activitystreams/core/ only shows @type for JSON-LD compatibility, and https://w3c.github.io/activitypub/ doesn't mention @type at all.

snarfed avatar Nov 26 '17 23:11 snarfed