知识卡片

普通读书笔记卡 · 3481.h.1

区分词汇与模式文档

理解等级:中级

schema描述对象或文档结构;语义profile描述数据和动作词汇及其交互;服务定义文档描述某一API实例如何实现接口。三者可互补,不能互相冒充。

共享词汇可用RDF系列或ALPS表达。RDF偏重数据项关系,ALPS偏重动作关系;普通XSD/JSON Schema用法常只覆盖数据属性,容易漏掉动作名。可通过Link: <...>; rel="profile"公布词汇标识,再为消息结构另配schema。以上是2022年书中的方案比较。

关联:[[词汇描述覆盖数据与动作]]。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体服务 · 查看原书依据

      Profiles that detail the semantics of an interface do not fill the same role as schema documents. Schemas are used to describe objects or document messages. Semantic profiles are used to describe the way these objects (or documents) interact with each other. Publishing a profile document helps developers (and machines) understand the problem space—the possibilities within an API.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook》第5章《Hypermedia Services》(来源项目book-sources:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch05.xhtml,配方5.8) - 结论依据:原文区分schema、语义profile和具体服务定义,并比较RDF、ALPS对数据与动作关系的侧重。 - 原始内容:Profiles that detail the semantics of an interface do not fill the same role as schema documents. Schemas are used to describe objects or document messages. Semantic profiles are used to describe the way these objects (or documents) interact with each other. Publishing a profile document helps developers (and machines) understand the problem space—the possibilities within an API.