ActivityStreams 在活动上的 "to" 字段与 "audience" 字段有何不同?
How is ActivityStreams's "to" field on Activities different from the "audience" field?
ActivityStreams规范解释了to
、cc
、bto
和bcc
在section 5.1. But there's also an audience
属性中的区别,定义为:
one or more entities that represent the total population of entities for which the object can considered to be relevant.
这与 "to" 和 "cc" 有何不同?特别是,对 ActivityPub delivery 有什么不同的影响?
答案可以在 ActivityPub 规范的问题列表中找到,在 this comment by James M Snell:
audience
is used for targeting.
For example, suppose I have an activity that everyone in my company should see show up in their activity feeds, but only certain specific people should be notified, I would end up with something like:
{
//...//
"audience": {
"type": "Organization",
"id": "http://example.org",
"name": "My Organization"
},
"to": ["http://jane.example.org", "http://joe.example.org"],
"cc": ["http://sally.example.org"]
}
Here, the audience
property provides a scoping of the overall audience, while the to
and cc
fields identify specific individuals within that audience that should be notified more directly of the activity.
在这次讨论之后更新了规范。请参阅 Audience targeting 并特别说明。 5.1.1
关于它的使用有更多的说明:
Activities are rarely isolated events. Often, multiple individual activities will be performed around a similar context or audience. For instance, a collaborators working on a shared project might perform multiple related activities in the process of achieving some goal. Such activities can be logically grouped together using the context
property, and scoped to a particular audience using the audience
property.
提供以下示例(示例 144):
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Activities in Project XYZ",
"type": "Collection",
"items": [
{
"summary": "Sally created a note",
"type": "Create",
"id": "http://activities.example.com/1",
"actor": "http://sally.example.org",
"object": {
"summary": "A note",
"type": "Note",
"id": "http://notes.example.com/1",
"content": "A note"
},
"context": {
"type": "http://example.org/Project",
"name": "Project XYZ"
},
"audience": {
"type": "Group",
"name": "Project XYZ Working Group"
},
"to": "http://john.example.org"
},
{
"summary": "John liked Sally's note",
"type": "Like",
"id": "http://activities.example.com/1",
"actor": "http://john.example.org",
"object": "http://notes.example.com/1",
"context": {
"type": "http://example.org/Project",
"name": "Project XYZ"
},
"audience": {
"type": "Group",
"name": "Project XYZ Working Group"
},
"to": "http://sally.example.org"
}
]
}
ActivityStreams规范解释了to
、cc
、bto
和bcc
在section 5.1. But there's also an audience
属性中的区别,定义为:
one or more entities that represent the total population of entities for which the object can considered to be relevant.
这与 "to" 和 "cc" 有何不同?特别是,对 ActivityPub delivery 有什么不同的影响?
答案可以在 ActivityPub 规范的问题列表中找到,在 this comment by James M Snell:
audience
is used for targeting.For example, suppose I have an activity that everyone in my company should see show up in their activity feeds, but only certain specific people should be notified, I would end up with something like:
{ //...// "audience": { "type": "Organization", "id": "http://example.org", "name": "My Organization" }, "to": ["http://jane.example.org", "http://joe.example.org"], "cc": ["http://sally.example.org"] }
Here, the
audience
property provides a scoping of the overall audience, while theto
andcc
fields identify specific individuals within that audience that should be notified more directly of the activity.
在这次讨论之后更新了规范。请参阅 Audience targeting 并特别说明。 5.1.1
关于它的使用有更多的说明:
Activities are rarely isolated events. Often, multiple individual activities will be performed around a similar context or audience. For instance, a collaborators working on a shared project might perform multiple related activities in the process of achieving some goal. Such activities can be logically grouped together using the
context
property, and scoped to a particular audience using theaudience
property.
提供以下示例(示例 144):
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Activities in Project XYZ",
"type": "Collection",
"items": [
{
"summary": "Sally created a note",
"type": "Create",
"id": "http://activities.example.com/1",
"actor": "http://sally.example.org",
"object": {
"summary": "A note",
"type": "Note",
"id": "http://notes.example.com/1",
"content": "A note"
},
"context": {
"type": "http://example.org/Project",
"name": "Project XYZ"
},
"audience": {
"type": "Group",
"name": "Project XYZ Working Group"
},
"to": "http://john.example.org"
},
{
"summary": "John liked Sally's note",
"type": "Like",
"id": "http://activities.example.com/1",
"actor": "http://john.example.org",
"object": "http://notes.example.com/1",
"context": {
"type": "http://example.org/Project",
"name": "Project XYZ"
},
"audience": {
"type": "Group",
"name": "Project XYZ Working Group"
},
"to": "http://sally.example.org"
}
]
}