Schema.org 开发者指南
Schema.org developer guide: Access machine-readable schemas via GitHub, releases, JSON-LD, and HTTP/HTTPS URIs. (Schema.org 开发者指南:通过 GitHub、版本发布、JSON-LD 及 HTTP/HTTPS URI 访问机器可读模式。)
注意:您正在查看 Schema.org 的开发版本。详情请参阅 我们的工作方式。
本页面提供了面向开发者的 Schema.org 基础信息,特别是提供了访问其模式(schemas)的机器可读表示形式的途径。
This page provides basic developer-oriented information about Schema.org, specifically offering access to machine-readable representations of its schemas.
机器可读术语定义
有多种方式可以访问 Schema.org 术语的机器可读定义。
There are several ways to access machine-readable definitions of Schema.org terms.
- 源代码库:底层源文件均可在我们的 Github 仓库 中找到。编辑工作以 Turtle 格式进行,并使用一种 基于 RDF Schema 的方法进行定义。
- 定期发布:定期发布的版本在 staging.schema.org 上暂存后,会发布到 Schema.org 主站。相应的数据文件链接如下,也可在 Github 上获取。
- 术语页内嵌 JSON-LD:单个术语的机器可读定义也以 JSON-LD 格式嵌入在术语页面的 HTML 中。请注意,在许多情况下,将 schema.org 视为一个整体来考虑更为有用。
- HTTP 与 HTTPS URI:如 FAQ 所述,Schema.org 的 URI 有时使用 'http',有时使用 'https'。我们鼓励消费应用程序接受这两种表示形式,并且为了方便起见,我们现在生成两种“风味”的下载文件。在“磁盘上”的编辑工作中,我们使用 'https' 形式。然而,其他站点和应用程序,尤其是在 RDF 表示中,很可能仍在使用 'http'。尽管我们鼓励向 'https' 迁移,但需要特别注意:Schema.org 的 JSON-LD 上下文文件使用的是 'http',并且由于对已部署系统的影响,我们不太可能在未经长期预警的情况下更改这一点。欢迎就此提供反馈,例如在此 GitHub Issue 中。
- JSON-LD 上下文文件:JSON-LD 上下文文件可从 https://schema.org/docs/jsonldcontext.json 获取。Schema.org 通常以 JSON-LD 1.0 部署,但我们上下文文件的位置也通过 JSON-LD 1.1 约定,以 HTTP Link 头部的方式暴露(命令行工具 'curl' 可能有用,例如使用
-I -i参数)。无论通过 http 还是 https 检索上下文,我们都提供相同的上下文描述。
- Source Repository: The underlying source files are all available in our Github repository. Editorial work is conducted in Turtle format and defined using an approach based on RDF Schema.
- Periodic Releases: Periodically released versions are staged on staging.schema.org before being published to the main Schema.org site. Corresponding data files are linked below and are also available on Github.
- Term Page Embedded JSON-LD: Machine-readable definitions of individual terms are also available as JSON-LD embedded within the term page HTML. Note that in many cases, it is more useful to consider schema.org as a whole.
- HTTP vs. HTTPS URIs: As noted in the FAQ, Schema.org URIs are sometimes written with 'http' and sometimes with 'https'. Consuming applications are encouraged to accept both representations. For convenience, we now generate downloads in both "flavors." In "on-disk" editorial work, we use the 'https' form. However, other sites and applications, especially in RDF representations, are likely still using 'http'. While we encourage a move towards 'https', please note specifically that the JSON-LD context file for Schema.org uses 'http'. Due to the impact on deployed installations, we are unlikely to change this without a long warning period. Feedback on this is welcome, e.g., in this GitHub issue.
- JSON-LD Context File: The JSON-LD context is available from https://schema.org/docs/jsonldcontext.json. Schema.org is typically deployed in JSON-LD 1.0, but the location of our context file is also exposed via JSON-LD 1.1 conventions as an HTTP Link header (the command-line tool 'curl' can be useful, e.g., used with
-I -iarguments). We serve the same context description regardless of whether the context is retrieved via http or https.
词汇表定义文件
为方便开发者,包含当前版本 Schema.org 词汇表定义的文件,以常见的 RDF 格式提供下载。除了下面的链接,旧版本的发布文件可以在 GitHub 的 data/releases/ 目录下找到。
To assist developers, files containing the definition of the current version of the Schema.org vocabulary are available for download in common RDF formats. In addition to the links below, older release versions can be found in the
data/releases/directory on GitHub.
选择所需的文件和格式并点击下载。CSV 格式的下载文件分为两个文件:Types 包含类型和枚举值的定义,包括相关属性列表;Properties 包含属性定义。
Select the required file and format and click Download. The CSV format downloads are split across two files: Types includes definitions of Types and Enumeration Values, along with lists of associated properties; Properties contains property definitions.
- schemaorg-current-https:包含词汇表所有部分中所有术语的定义。
- schemaorg-all-https:包含词汇表所有部分中所有术语的定义,外加已从词汇表中移除的术语(详情参见 attic 部分)。
- schemaorg-current-https: Contains the definition of all terms in all sections of the vocabulary.
- schemaorg-all-https: Contains the definition of all terms in all sections of the vocabulary, plus terms retired from the vocabulary (see the attic section for details).
对于偏好使用基于 http 的 Schema.org 术语定义的用户,可以在 schemaorg-current-http 和 schemaorg-all-http 文件中找到等效的定义。有关使用 https 或 http 术语的更多信息,请参阅 FAQ。
For those preferring to use http-based definitions of Schema.org terms, equivalent definitions are available in the schemaorg-current-http and schemaorg-all-http files. For more information on using https or http based terms, see the FAQ for details.
实验性功能
以下表示形式是实验性的,可能在未来的版本中更改或移除。
The following representations are experimental and may change or be removed in future releases.
D3 RDFS in JSON-LD
这是一个简化的 Schema.org 类型层次结构,其中每个类型最多有一个超类,以一种结合了 JSON-LD、RDFS 和 D3 的混合格式表示:tree.jsonld。
This is a simplification of the Schema.org type hierarchy, where each type has at most one super-type, represented in a hybrid format that combines JSON-LD, RDFS, and D3: tree.jsonld.
提供此文件是为了支持使用 D3 JavaScript 库进行基于数据的文档操作的开发者。它使用 JSON-LD 来声明 D3 默认的 "children" JSON 字段表示 "subClassOf" 关系,但以相反的方向表达(使用示例)。
This file is made available to support developers using the D3 JavaScript library for manipulating documents based on data. It uses JSON-LD to declare that D3's default "children" JSON field represents "subClassOf" relationships, but expressed in the reverse direction (example usage).
OWL
作为一项实验性功能,我们提供了一个 OWL 定义文件 schemaorg.owl。它包含了核心词汇表及所有当前的扩展。
As an experimental feature, an OWL definition file schemaorg.owl is available. It includes the core vocabulary and all current extensions.
该文件的结构与上述词汇表定义文件不同,它将 schema:domainIncludes 和 schema:rangeIncludes 的值使用 owl:unionOf 转换为 rdfs:domain 和 rdfs:range 值,以捕获值的多重性。范围值中包含了词汇表内隐式的默认值,如 Text、URL 和 Role。
The structure of this file differs from the vocabulary definition files mentioned above. It converts
schema:domainIncludesandschema:rangeIncludesvalues intordfs:domainandrdfs:rangevalues usingowl:unionOfto capture the multiplicity of values. Included in the range values are the default values implicit within the vocabulary, such as Text, URL, and Role.
提供此文件是为了能在一些基于 OWL 的建模工具中表示该词汇表。映射到 OWL 是一种近似,不应被视为 Schema.org 术语的权威定义;详情请参阅 数据模型页面。作为一项实验性功能,对于任何第三方工具如何解释它,我们没有设定预期。
This file has been made available to enable the representation of the vocabulary in some OWL-based modeling tools. The mapping into OWL is an approximation and should not be considered an authoritative definition for Schema.org's terms; see the datamodel page for details. As an experimental feature, there are no expectations regarding its interpretation by any third-party tools.
版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。
文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。
若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。