Skip to content

Note

このドキュメントは2026-02-27 02:29PLaMo Translation Modelを使用して自動翻訳されました。

FEP-76ea: 会話スレッドの識別方法

概要

本FEP(機能拡張提案)は、Activity Streams 2.0においてオブジェクトを会話スレッドに関連付ける標準的な手法を提案するものです。これにより、ユーザーは関連する議論を効率的に追跡できるようになります。

背景説明

現代のソーシャルネットワークでは、ユーザーが生成するコンテンツが複雑に絡み合う「会話」が発生することが一般的です。これらの会話を効果的に管理するためには、各メッセージを適切なスレッド構造に整理することが重要です。この提案では、そのようなスレッド構造を明確に定義し、実装するための標準化された方法を提供します。

技術的詳細

本FEPでは、以下の要素からなる標準的な会話スレッドモデルを提案します: 1. 親メッセージ(元となる投稿) 2. 子メッセージ(親メッセージに対する返信) 3. 階層的な関係を示すリンク機構

このモデルにより、ユーザーは以下のような利点を得られます: - 関連する議論を直感的に追跡可能 - 長文のディスカッションを効率的にナビゲート可能 - スレッド構造に基づく高度な検索機能を実現可能

実装例1

以下は、単一の親メッセージとそれに対する複数の返信からなるシンプルな会話スレッドの例です:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/note/789",
  "attributedTo": "https://example.com/user/1",
  "to": "as:Public",
  "content": "これらは両方とも優れた指摘です。",
  "inReplyTo": [
    "https://remote.example/note/57",
    "https://other.example/note/456"
  ],
  "thread": [
    "https://remote.example/thread/57",
    "https://other.example/thread/456"
  ]
}

実装例2

以下のオブジェクトは、異なる2つの親メッセージに対する返信であるため、それぞれ別個のスレッドに属しています:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/note/789",
  "attributedTo": "https://example.com/user/1",
  "to": "as:Public",
  "content": "これらは両方とも優れた指摘です。",
  "inReplyTo": [
    "https://remote.example/note/57",
    "https://other.example/note/456"
  ],
  "thread": [
    "https://remote.example/thread/57",
    "https://other.example/thread/456"
  ]
}

実装例3

以下のオブジェクトは、異なる2つの親メッセージに対する返信であるため、それぞれ別個のスレッドに属しています:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/note/789",
  "attributedTo": "https://example.com/user/1",
  "to": "as:Public",
  "content": "これらは両方とも優れた指摘です。",
  "inReplyTo": [
    "https://remote.example/note/57",
    "https://other.example/note/456"
  ],
  "thread": [
    "https://remote.example/thread/57",
    "https://other.example/thread/456"
  ]
}

実装例4

投稿者によって削除されたオブジェクトは、スレッドコレクション内で「墓標」(Tombstone)オブジェクトとして表現できます:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/note/345",
  "attributedTo": "https://example.com/user/1",
  "to": "as:Public",
  "content": "Activity Streams 2.0は素晴らしい!",
  "replies": "https://example.com/replies/345",
  "thread": {
    "id": "https://example.com/thread/345",
    "to": "as:Public",
    "type": "OrderedCollection",
    "orderedItems": [
      {
        "id": "https://third.example/note/567",
      },
      {
        "type": "Tombstone",
        "id": "https://remote.example/note/456",
        "inReplyTo": "https://example.com/note/345",
        "deleted": "2024-10-03T00:00:00Z"
      },
      "https://example.com/note/345"
    ]
  }
}

実装例5

スレッドコレクションも他のコレクションと同様にページング可能です:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/note/678",
  "attributedTo": "https://example.com/user/1",
  "to": "as:Public",
  "content": "ワルイージはリバタリアンなのか?",
  "replies": "https://example.com/replies/678",
  "thread": {
    "id": "https://example.com/thread/678",
    "to": "as:Public",
    "type": "OrderedCollection",
    "totalItems": 244780,
    "first": "https://example.com/thread/678/page/12239",
    "last": "https://example.com/thread/678/page/1"
  }
}

実装例6

「root」プロパティを使用することで、特定のスレッドにおける元となる投稿を識別できます:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/thread/654",
  "type": "OrderedCollection",
  "totalItems": 457,
  "first": "https://example.com/thread/654/page/23",
  "last": "https://example.com/thread/654/page/1",
  "root": "https://example.com/note/654"
}

実装例7

新しい会話にオブジェクトを分岐させる場合、「Announce」アクティビティを使用します:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/announce/123",
  "to": "as:Public",
  "type": "Announce",
  "actor": "https://example.com/user/1",
  "thread": "https://example.com/thread/123",
  "content": "このノートは重要であり、別途議論を始めたいと思います。",
  "object": {
    "id": "https://example.com/note/456",
    "type": "Note",
    "attributedTo": "https://example.org/user/2",
    "thread": "https://example.net/thread/789",
    "inReplyTo": "https://example.net/note/foo",
    "to": "as:Public",
    "content": "電車は素晴らしい。"
  }
}

実装例8

既存の会話にオブジェクトを統合する場合も、「Announce」アクティビティを使用します:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://purl.example.org/thread-model"
  ],
  "id": "https://example.com/announce/456",
  "to": "as:Public",
  "type": "Announce",
  "actor": "https://example.com/user/1",
  "thread": "https://social.example/thread/222",
  "inReplyTo": "https://social.example/note/888",
  "content": "別のスレッドで投稿されたこの電車に関するコメントは、ここでも関連性があるように思われます。",
  "object": {
    "id": "https://example.com/note/456",
    "type": "Note",
    "attributedTo": "https://example.org/user/2",
    "thread": "https://example.net/thread/789",
    "inReplyTo": "https://example.net/note/foo",
    "to": "as:Public",
    "content": "電車は素晴らしい。"
  }
}

セキュリティ考慮事項

スレッドコレクションに含まれるすべてのオブジェクトが、必ずしも同じ受信者を対象としているわけではありません。表現形式においては、コンテンツプロパティやその他の機密情報を含むオブジェクトを、当該メッセージの受信対象でない場合には含めないべきです。

[ActivityPub]仕様では、スレッドコレクションの「orderedItems」プロパティについて、必要に応じて受信者向けにフィルタリングを行うことが許容されています。

関連技術

Mastodonなどのプラットフォームでは「ostatus:conversation」プロパティが会話識別に使用されていますが、必ずしも参照可能とは限りません。

一部のActivityPub実装では、オブジェクトのスレッド構造を表現するために「context」プロパティを使用しています。本FEPではより具体的な専用プロパティを提案することで、「意図的に曖昧さを残した」contextプロパティの利用を置き換え、スレッド構造をより明確に定義できるようにします。

著作権情報

この仕様はCreative Commons Attribution 4.0 International Licenseの下で公開されています。詳細はhttps://creativecommons.org/licenses/by/4.0/をご覧ください。