假设我们有以下 JSON:
{
"@context":
{
"name": "http://schema.org/name",
"status": "http://schema.org/status"
},
"name": "Manu Sporny",
"status": "trollin'"
}
()
The trollin'
状态由 URI 标识:http://example.com/trolling
。是否可以扩大trollin'
将上例中的关键字添加到 URIhttp://example.com/trolling
?
直接操作上下文是行不通的:
{
"@context":
{
"name": "http://schema.org/name",
"status": "http://schema.org/status",
"trollin'": "http://example.com/trolling"
},
"name": "Manu Sporny",
"status": "trollin'"
}
()
强制类型status
to @id
也行不通,因为它会假设trollin'
是一个相对 URI。
{
"@context":
{
"name": "http://schema.org/name",
"status": {
"@id": "http://schema.org/status",
"@type": "@id"
},
"trollin'": "http://example.com/trolling"
},
"name": "Manu Sporny",
"status": "trollin'"
}
()