api格式
The API system has built-in content negotiation capabilities. By default, only the JSON-LD format is enabled. However, API Platform Core supports many more formats and can be extended.
API系统具有内置的内容协商功能。 默认情况下,仅启用JSON-LD格式。 但是, API Platform Core支持更多格式,并且可以扩展。
Available formats are: JSON-LD, GraphQL, JSON, JSON:API, HAL, XML, YAML, CSV, HTML (API docs).
可用格式为: JSON-LD,GraphQL,JSON,JSON:API,HAL,XML,YAML,CSV,HTML (API文档) 。
1. JSON-LD (1. JSON-LD)
Data is messy and disconnected. JSON-LD organizes and connects it, creating a better Web.
数据混乱且断开连接。 JSON-LD进行组织和连接,从而创建一个更好的Web。
JSON-LD is a lightweight Linked Data format. It is easy for humans to read and write. It is based on the already successful JSON format and provides a way to help JSON data interoperate at Web-scale. JSON-LD is an ideal data format for programming environments, REST Web services, and unstructured databases such as Apache CouchDB and MongoDB.
JSON-LD是一种轻量级的链接数据格式。 人类易于阅读和书写。 它基于已经成功的JSON格式,并提供了一种方法来帮助JSON数据在Web规模上进行互操作。 JSON-LD是用于编程环境,REST Web服务和非结构化数据库(例如Apache CouchDB和MongoDB)的理想数据格式。
例; (Example;)
{
"@context": "https://json-ld.org/contexts/person.jsonld",
"@id": "http://dbpedia.org/resource/John_Lennon",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}