Lat*_*per 3 schema.org json-ld
如何访问 JSON-LD 中的两个单独的词汇,我可以使用 2 个 @contexts 吗?例如
{
"@context": {
"@vocab": "http://schema.org/",
"first_name": "givenName",
"last_name": "familyName
}
"@context": {
"@vocab": "http://our_own_schema.org/",
"Time": "inputTime"
}
}
Run Code Online (Sandbox Code Playgroud)
您可以提供多个@context. 如果它们包含重复的术语,则使用最近定义的术语。参见实施例27和28。但是,如果您想在同一对象中混合词汇表,则\xe2\x80\x99 不起作用。
要允许在同一对象中混合词汇表,您可以在@context文档顶部定义所有词汇表。每个词汇表都可以有一个前缀,这允许您使用紧凑的 IRI。一种词汇可以是默认词汇(无前缀)。
使用默认词汇:
\n\n"@context": \n[\n "http://schema.org/",\n {"oos": "http://our_own_schema.org/"}\n],\nRun Code Online (Sandbox Code Playgroud)\n\n键name扩展为http://schema.org/name,
\n键oos:name扩展为http://our_own_schema.org/name。
没有默认词汇:
\n\n"@context": \n{\n "schema": "http://schema.org/",\n "oos": "http://our_own_schema.org/"\n},\nRun Code Online (Sandbox Code Playgroud)\n\n该键name将被忽略,
\n该键schema:name扩展为http://schema.org/name,
\n该键oos:name扩展为http://our_own_schema.org/name。
注意:\xe2\x80\x99s 始终可以使用绝对 IRI作为键。您不必在上下文中定义这些。
\n| 归档时间: |
|
| 查看次数: |
3565 次 |
| 最近记录: |