GitHub
Draft

APC (ActivityPub Communities)

ActivityPubのGroupアクターを使用してコミュニティ機能を実現するための仕様です。 Lemmy、Kbinなどの実装と相互運用性を持ちます。

概要

APCは、ActivityPubの標準的なGroupアクタータイプを使用して、 コミュニティ(グループ、サブレディット的なもの)を実現します。

設計方針

名前空間

https://yurucommu.com/ns/apc#

コミュニティ(Group)

コミュニティはActivityPubのGroupアクターとして表現されます。

必須プロパティ

プロパティ 説明
type String "Group"
id URI コミュニティのActivityPub IRI
name String コミュニティの表示名
preferredUsername String @メンション用の識別子
inbox URI 受信ボックスURL
outbox URI 送信ボックスURL
followers URI メンバー一覧(フォロワーコレクション)

拡張プロパティ

プロパティ 説明
apc:visibility String public または private
apc:postPolicy String 投稿権限: members, moderators
apc:joinPolicy String 参加方式: open, approval, invite

例: コミュニティアクター

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://yurucommu.com/ns/apc/context.jsonld"
  ],
  "type": "Group",
  "id": "https://example.com/communities/tech",
  "name": "Tech Talk",
  "preferredUsername": "tech",
  "summary": "技術について話すコミュニティ",
  "icon": {
    "type": "Image",
    "url": "https://example.com/media/communities/tech/icon.png"
  },
  "inbox": "https://example.com/communities/tech/inbox",
  "outbox": "https://example.com/communities/tech/outbox",
  "followers": "https://example.com/communities/tech/followers",
  "apc:visibility": "public",
  "apc:postPolicy": "members",
  "apc:joinPolicy": "open"
}

メンバーシップ

コミュニティへの参加はFollowアクティビティで表現されます。

参加リクエスト

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Follow",
  "id": "https://alice.example/activities/join-tech",
  "actor": "https://alice.example/users/alice",
  "object": "https://example.com/communities/tech"
}

参加承認

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Accept",
  "id": "https://example.com/activities/accept-alice",
  "actor": "https://example.com/communities/tech",
  "object": {
    "type": "Follow",
    "id": "https://alice.example/activities/join-tech",
    "actor": "https://alice.example/users/alice",
    "object": "https://example.com/communities/tech"
  }
}

投稿の配信

コミュニティへの投稿は、コミュニティのinboxに送信されます。

コミュニティ宛の投稿

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "id": "https://alice.example/activities/create-note-1",
  "actor": "https://alice.example/users/alice",
  "to": ["https://example.com/communities/tech"],
  "cc": ["https://www.w3.org/ns/activitystreams#Public"],
  "object": {
    "type": "Note",
    "id": "https://alice.example/notes/1",
    "attributedTo": "https://alice.example/users/alice",
    "content": "新しいプログラミング言語を試してみました!",
    "to": ["https://example.com/communities/tech"],
    "cc": ["https://www.w3.org/ns/activitystreams#Public"]
  }
}

コミュニティによる再配信

コミュニティは受け取った投稿を全メンバーにAnnounceとして再配信します。

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Announce",
  "id": "https://example.com/communities/tech/announces/1",
  "actor": "https://example.com/communities/tech",
  "to": ["https://example.com/communities/tech/followers"],
  "cc": ["https://www.w3.org/ns/activitystreams#Public"],
  "object": "https://alice.example/notes/1"
}

モデレーション

モデレーターは特定の管理アクションを実行できます。

投稿の削除

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Remove",
  "id": "https://example.com/communities/tech/removes/1",
  "actor": "https://example.com/communities/tech",
  "object": "https://alice.example/notes/1",
  "target": "https://example.com/communities/tech/outbox",
  "summary": "コミュニティガイドライン違反"
}

メンバーのBAN

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Block",
  "id": "https://example.com/communities/tech/blocks/1",
  "actor": "https://example.com/communities/tech",
  "object": "https://spammer.example/users/spam"
}

相互運用性

この仕様はLemmy、Kbinなどの既存実装との互換性を考慮しています。 標準のGroupアクターを使用することで、基本的なフォロー・投稿の配信は ActivityPub対応の多くの実装で動作します。

参考