名前空間
YurucommuのActivityPub拡張で使用する名前空間とJSON-LDコンテキストの定義です。
基本名前空間
Yurucommuの拡張プロパティは以下のベース名前空間を使用します:
https://yurucommu.com/ns
機能別名前空間
各機能は独自のサブ名前空間を持ちます:
| 機能 | 名前空間 | 説明 |
|---|---|---|
| APC | https://yurucommu.com/ns/apc# |
コミュニティ機能 |
| Story | https://yurucommu.com/ns/story# |
ストーリー機能 |
| QR Exchange | https://yurucommu.com/ns/qr# |
QRコード交換 |
JSON-LDコンテキスト
統合コンテキスト
全ての拡張を含む統合コンテキストを提供しています:
https://yurucommu.com/ns/context.jsonld
使用例
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://yurucommu.com/ns/context.jsonld"
],
"type": "Note",
"content": "Hello, Fediverse!"
}
機能別コンテキスト
必要な機能のみを使用する場合は、個別のコンテキストを指定できます:
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://yurucommu.com/ns/story/context.jsonld"
],
"type": ["Story", "Note"],
...
}
コンテキストURL一覧
| コンテキスト | URL |
|---|---|
| 統合 | https://yurucommu.com/ns/context.jsonld |
| APC | https://yurucommu.com/ns/apc/context.jsonld |
| Story | https://yurucommu.com/ns/story/context.jsonld |
| QR Exchange | https://yurucommu.com/ns/qr/context.jsonld |
互換性
Yurucommuの拡張プロパティを認識しない実装でも、標準のActivityPub/Activity Streams 2.0 として処理できるよう設計されています。不明なプロパティは無視されます。
ヒント:
JSON-LDの仕様により、未知のプロパティは無視されるため、
拡張プロパティを含むオブジェクトも標準実装で安全に処理できます。