CnOps 智能运维与可观测社区
首页开源项目实践文章视频课程常见问答开发者工具STAROps 专题
导航菜单
首页开源项目实践文章视频课程常见问答开发者工具STAROps 专题

CnOps 智能运维与可观测社区

愿景

CnOps 智能运维与可观测社区是一个以"智能运维与可观测"为核心的开放、包容、分享的技术社区,旨在聚集运维专家、开发者和爱好者,共同探讨、学习和分享可观测最佳实践与最新技术,与众多技术社区合作互动,共同探讨交叉领域的技术挑战,推动可观测领域的创新与进步。

内容社区

  • 实践文章
  • 视频课程
  • 开源项目
  • 常见问答
  • 开发者工具

友情链接

  • Prometheus
  • Grafana Lab
  • OpenTelemetry
  • LoongCollector

关注我们

阿里云云原生公众号阿里云云原生
阿里云可观测公众号阿里云可观测

Copyright © 2026 CnOps 社区. All rights reserved.

首页/开源项目/UModel/Entity 与 Relation
文档目录
UModel 中文文档
对象图语义层Workspace 与 DomainModel ElementsEntitySetDataSetLink 与字段映射Storage 与 GraphStoreEntity 与 Relation查询入口
GraphStore Providers文档国际化规则Web UI 架构Web UI API 对照UModel SDK 规范

UModel

Entity 与 Relation

Entity 和 Relation 是运行时数据。它们实例化 EntitySet 和 EntitySetLink 定义的对象图。 | 模型定义 | 运行时数据 | |---|---| | entityset | Entity records | | entitysetlink | Relation records | | datalink | 查询时实体与数据集的绑定 | |...

Entity 和 Relation 是运行时数据。它们实例化 EntitySet 和 EntitySetLink 定义的对象图。

模型层与运行时层

模型定义 运行时数据
entity_set Entity records
entity_set_link Relation records
data_link 查询时实体与数据集的绑定
storage_link 查询时数据集与存储的路由

写入 Entity

REST:

POST /api/v1/entitystore/{workspace}/entities:write

CLI:

go run ./cmd/umctl --addr http://localhost:8080 entity write demo examples/quickstart-multidomain/sample-data/entities.json

读取:

go run ./cmd/umctl --addr http://localhost:8080 query run demo ".entity with(domain='devops', name='devops.service') | limit 20"

写入 Relation

REST:

POST /api/v1/entitystore/{workspace}/relations:write

CLI:

go run ./cmd/umctl --addr http://localhost:8080 topo write demo examples/quickstart-multidomain/sample-data/relations.json

读取拓扑:

go run ./cmd/umctl --addr http://localhost:8080 query run demo ".topo | graph-call getDirectRelations([(:\"devops@devops.service\" {__entity_id__: '10000000000000000000000000000101'})]) | limit 20"

Visibility

EntityStore 支持 write、expire 和 delete-style 操作。本地查询默认隐藏 expired/deleted records,provider 保留历史后支持 time-aware 查询。

Identity

运行时记录需要稳定 entity IDs。UModel 在 topology calls 和 provider storage 中使用经过校验的 entity identifiers。示例 ID 保持确定,教程和测试即可直接复制运行。

设计规则

  • 先导入模型定义,再写运行时数据。
  • Entity 字段要和 EntitySet 定义一致。
  • Relation 类型要和 EntitySetLink 语义一致。
  • 使用 .entity 找到 ID,再使用 .topo 做拓扑查询。
  • 样例数据应足够小,便于人工检查,同时也要足够丰富,能展示拓扑。

文章大纲