【发布时间】:2016-09-23 17:18:40
【问题描述】:
所以我试图围绕 JSON-LD 进行思考,我看到的所有示例主要包括嵌入“链接数据”。但我想提供对链接数据的引用(主要是因为将其全部嵌入可能会导致 10MB 有效负载)。所以我想知道我这样做是否正确。
这是我所拥有的:
{
"@context": "/contexts/Customers.jsonld",
"@id": "/customers/1",
"@type": "Customer",
"sessions": {
"@id": "/customers/1/sessions",
"@type": "Session"
},
"dealer": "/dealers/2",
"givenName": "Abe",
"familyName": "Abrahms",
/* ... snip ... */
}
我在这里谈论的链接数据的引用由sessions 属性表示。假设这是正确的,那么我需要在 Customer 上下文中进行哪些更改?
"@context": {
"hydra": "http://www.w3.org/ns/hydra/core#",
"doc": "https://api.waterlinkconnect.com/doc#",
"Customer": "doc:Customer",
"givenName": "doc:Customer/givenName",
"familyName": "doc:Customer/familyName",
"email":"doc:Customer/email",
"address":"doc:Customer/address",
"notes":"doc:Customer/notes",
"phone1":"doc:Customer/phone1",
"phone2":"doc:Customer/phone2"
"sessions": "???????"
}
【问题讨论】:
标签: json-ld