FEP-9967: Polls

FEP-9967: Polls

Link: fep/fep/9967/fep-9967.md at main - fediverse/fep - Codeberg.org

Summary

How to make polls in ActivityPub network.

1 Like

Even though this is as implemented today, I think we’d be amiss not to document how this should ideally be done. And how we can evolve today’s implementations towards that.

E.g., a Vote activity and using Question activities, still allowing for replies via Notes as comments on the poll.

e.g., what’s the behavior if someone sends a:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://social.example/votes/1",
  "type": "Note",
  "attributedTo": "https://social.example/actors/2",
  "inReplyTo": "https://social.example/polls/1",
  "name": "Answer 1",
  "content": "Some text explaining my vote",
  "attachments": [
    ...
  ]
  "to": "https://social.example/actors/1"
}

In today’s implementations? I suspect the content would be dropped and only the vote counted?

2 Likes

I think the decision to use Question as an object was a reasonable one, and that the spec should be amended to reflect this practice. But voting with Create(Note) is not ideal, and I agree with you that Vote activity would be better. In the Pleroma issue someone mentioned the Answer type, which was (?) discussed by the working group but not included in the final vocabulary; I need to dig into the archives to figure out why.

Don’t know about others, but my implementation treats this as a reply with “direct” visibility :slight_smile:

Yeah, I think you’ve like Question/Answer for like asks or q&a sites, and then Create(Question) / Vote for polls?

Ha, I guess that deanonymizes votes to the poll creator, where as typically they don’t know who voted for what.

I like Question/Answer for both. A vote is an answer to the poll’s question. I understand we’re discussing “polls” in a Mastodon implementation context, but in general, a poll is not necessarily a vote for a single set of mutually-exclusive options.

Just curious… do you know if Answer is an activity (verb) or non-activity object (noun)? Question and Answer are interesting because, semantically, they can be both a noun and a verb.

My reading of that section is that Question was intended not primarily as polls, but I haven’t done the full spec archaeology on that one. Open-ended ask-style questions are more likely the primary intention. The confusing bit is that oneOf/anyOf exist not as options but instead as hints on how you might respond. In other words, there is no mechanism to actually force you to stick to those options. The whole concept seems half-baked because “polls” can be a lot more complex than open-ended questions, and they have significantly different considerations. I feel like there is another parallel issue with AS2-Vocab which is that sometimes, terms get used with different meanings just because the English word is close enough to the intention. Think of why Question is an Activity at all, and it’s pretty clear that the main motivation is to be able to use result. But the “result” of an action is not necessarily the same as the “result” of a poll. It’s also not immediately clear what either of those senses mean…

Somewhat luckily, that section is non-normative and honestly could be removed entirely without making a difference. I don’t think it makes for good guidance, but more generally, this is the kind of stuff that makes for better input into semantic profiles (e.g. some way to signal adherence to a poll protocol, where a certain shape must be satisfied and certain behavior might be expected)

I didn’t find any info about the Answer, but there is wiki page (last edited in 2015) that recommends PossibleAnswer for poll options and Respond for votes:

https://www.w3.org/wiki/Activity_Streams/Expanded_Vocabulary#Questions

Respond is an activity.

I like the name Respond. Added a note about it to the FEP and removed the mention of multi-object Create which AFAIK is not used in the wild: #479 - FEP-9967: Update proposal - fediverse/fep - Codeberg.org

In other news, an issue about testing poll limits has been created at fediverse-pasture-inputs.

Answer is something I just made up. My thinking being that it’d be an Activity? e.g., you could answer with a Note, an Image, a Video, etc.

Where as Vote is more an explicit intent than just a reply that may be an answer. e.g., Someone could do:

Actor1: Question(Note) -> questionId
Actor2: Answer(Note, questionId) -> answer
Actor1: Accept(answer)

Or something to have a "the person asking a question has marked an answer as accepted, and it should be given priority over other answers / replies.