收集内容的 ID、网址和名称
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
商品目录中的所有实体都需要以下属性:
@id
:内容的全局标识符。
url
:内容的规范网址。
name
:内容的名称。
@id
、url
和 name
示例:
"@id": "http://www.example.com/episode/video/432432432",
"url": "http://www.example.com/episode/video/432432432",
"name": "My example episode",
标识符
标识符 (@id
) 必须满足以下要求:
- 在您的目录中是全局唯一的
- 例如,请勿为
TVSeries
和 TVSeason
使用相同的 @id
。
- 静态
- 采用统一资源标识符 (URI) 的形式
- 如果内容的本地标识符 (ID) 不是 URI 格式,请在 ID 前面附加您的网域以满足此要求;例如,如果内容的 ID 是 1234abc,而您的网域是 https://example.com,则
@id
可以是 https://example.com/1234abc。
@id
不一定是有效网址;它只需采用 URI 格式即可。
@id
中使用的网域(例如 https://example.com)必须归贵组织所有。
由于实体的 url
符合作为标识符的所有要求(即全局唯一、静态且采用 URI 格式),因此我们建议您将实体的 url
用作 @id
。
规范网址
规范网址 (url
) 有助于 Google 准确匹配您的目录中的内容与 Google 数据库中的内容。
“规范网址是 Google 认为在您网站上的一组重复网页中最具代表性的网页的网址。举例来说,如果同一个网页有多个网址(例如:example.com?dress=1234 和 example.com/dresses/1234),Google 便会从中选择一个网址作为规范网址。”(来源:整合重复网址)
规范网址须满足以下要求:
url
必须是全局唯一的。
url
必须包含 Google 可以抓取的有效规范网址。
- (仅限“Listen”操作)
url
需要指向未被付费墙屏蔽的内容说明页。
收集 ID、网址和名称
执行以下操作:
- 收集目录中内容的名称。
- 指明相应内容的规范网址。(我们建议您将内容的
url
用作其 @id
。)
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],[],[[["All catalog entities must have an `@id`, `url`, and `name` property for identification and discoverability."],["The `@id` should be a globally unique, static URI, preferably the same as the `url`."],["The `url` must be a working canonical URL for Google to crawl and reconcile content effectively, pointing to a public content description page for Listen Actions."],["You need to collect and provide the `name`, `url` (recommended for `@id`), and canonical `url` for each entity in your catalog."]]],["Entities require `@id`, `url`, and `name` properties. `@id` must be a globally unique, static URI, which can be a prepended domain to a local ID. `url` must be a globally unique, working canonical URL, crawlable by Google. It's recommended to use the `url` as the `@id` because it satisfies the identifier requirements. The process involves collecting content names and identifying their canonical URLs.\n"]]