← Back to Skills Marketplace
theosunny

ontology

by sunny · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
42
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ontology-modeling
Description
Use when explaining Palantir Ontology concepts, guiding users to model a Foundry Ontology from scratch, parsing Feishu or local documents to extract business...
README (SKILL.md)

Palantir Ontology 建模

核心心智模型

Ontology 是真实世界的数字孪生——把现实业务编码成机器可理解、AI 可操作的知识图谱。

一等公民 类比 核心作用 详细设计原则
Object Type 细胞 把数据库的表变成"会说话"的业务对象 reference/object-type.md
Link Type 骨架 连接对象,赋予关系语义、安全和性能特征 reference/link-type.md
Action Type 肌肉 让知识图谱从"只读"变成"可写" reference/action-type.md
Function 大脑 原生计算层,将计算能力嵌入知识图谱本身 reference/function.md
Interface 神经系统 描述共同能力的身份卡,解决多态建模难题 reference/interface.md

五者协作关系:

Employee --[Link: participates_in]--> Project
    ↑                                     ↑
Action: assign_employee_to_project        |
Function: calculatePerformanceScore       |
Interface: Assignable \x3C───────────────────┘
  (Project 和 Task 都实现,统一"可分配"行为)

功能路由

digraph router {
  "收到请求" [shape=doublecircle];
  "解释概念?" [shape=diamond];
  "描述业务场景?" [shape=diamond];
  "提供文件/链接?" [shape=diamond];
  "功能1: 概念讲解+可视化" [shape=box];
  "功能2: 交互式引导建模" [shape=box];
  "功能3: 文档解析建模" [shape=box];
  "功能4: 输出实施方案" [shape=box];
  "询问用户需求" [shape=box];

  "收到请求" -> "解释概念?";
  "解释概念?" -> "功能1: 概念讲解+可视化" [label="是"];
  "解释概念?" -> "描述业务场景?" [label="否"];
  "描述业务场景?" -> "功能2: 交互式引导建模" [label="是"];
  "描述业务场景?" -> "提供文件/链接?" [label="否"];
  "提供文件/链接?" -> "功能3: 文档解析建模" [label="是"];
  "提供文件/链接?" -> "询问用户需求" [label="否"];
  "询问用户需求" -> "功能2: 交互式引导建模" [label="从零建模"];
  "询问用户需求" -> "功能1: 概念讲解+可视化" [label="学习概念"];
  "功能2: 交互式引导建模" -> "功能4: 输出实施方案" [label="Step 7 确认"];
  "功能3: 文档解析建模" -> "功能4: 输出实施方案" [label="解析完成"];
}

功能说明

功能1:概念讲解 + 可视化

用项目管理场景(Employee / Project / Task)贯穿五个一等公民,每个概念配具体示例:

  • Object Type:Employee 表 → 4层结构(元数据层:api_name/Display Name/Description/Sink & Cube/Status;属性层:主键用 UUID、普通属性含 Type+Security Metric、派生属性;数据源层:主数据集 + 最多3个补充数据集;安全层:对象级→列级→行级)
  • Link Type:employee_participates_in_project,M:N,关联表实现,携带 role 属性,8个配置项,3种数据实现方式
  • Action Type:assign_employee_to_project,7阶段生命周期,7种副作用(Modify/Create/Delete Object、Create/Delete Link 同步事务;Trigger Webhook/Workflow 异步)
  • Function:calculatePerformanceScore,4种类型(Object Function / Object Set Function / Action Validation Function / Query Function),高频计算配置 TTL 缓存(1-5分钟到永久),Object Function 必须是纯函数
  • Interface:Assignable,4个部分(元数据、Shared Properties、Shared Links、Implementations),Project 和 Task 都实现,统一"可分配"行为

可视化时:基于 reference/visualization-template.html 生成交互 HTML,保存到 ontology/concept_visualization.html,告知用户用浏览器打开。

功能2:交互式引导建模(0 → 1)

每次只问一个问题,给 A/B/C/D 选项,按 Step 1-8 推进:

Step 1 业务领域(供应链/项目管理/CRM/其他)
Step 2 识别实体 → Object Types(4层结构)
Step 3 识别关系 → Link Types(8个配置项 + 3种实现方式)
Step 4 识别操作 → Action Types(7阶段生命周期 + 7种副作用)
Step 5 识别计算 → Functions(4种类型 + 缓存策略)
Step 6 识别多态 → Interfaces(至少 2 个实现者才定义)
Step 7 确认设计 → 触发功能4输出

发现审批/追踪等跨类型需求时主动建议 Interface。

功能3:文档解析建模

输入类型 处理方式
飞书文档链接 调用 lark-doc skill 读取内容
飞书文件夹链接 调用 lark-drive skill 批量读取
本地 .md 文件路径 直接 Read 读取
本地文件夹路径 Glob 扫描所有 .md 文件
本地 PDF 文件 Read 工具读取(仅适用于文字型 PDF;图片型 PDF 无法提取文字,需改用 PNG 截图)
本地 PNG/图片 Read 工具读取(视觉识别);图片超过 2000×2000px 时需先用 Python PIL 切片后再读取

提取规则:名词 → Object、动词短语 → Link、用户操作 → Action、计算/统计需求 → Function、多种对象共享行为 → Interface。

解析前先存原始内容:读取文档后立即将原始文本保存到 ontology/{domain}_raw_source.md,防止上下文压缩导致内容丢失,后续提取和确认步骤都从该文件读取。

向用户确认提取结果后,触发功能4输出。

功能4:输出实施方案

设计确认后,生成四类文件到 ontology/ 目录:

文件 格式 用途
{domain}_ontology.json JSON 机器可读,程序导入 Foundry
{domain}_ontology.md Markdown 人类可读,团队 review
{domain}_ontology.ttl OWL/Turtle 标准本体,可导入 Protégé
{domain}_graph.html HTML 交互可视化

完整格式示例(JSON / Markdown / OWL/Turtle / HTML GRAPH 数据)见 reference/example-project-mgmt.md

生成 HTML 可视化:复制 reference/visualization-template.html,将文件顶部的 GRAPH 对象替换为当前领域的节点和边数据,保存为 {domain}_graph.html

引导进入开发: 输出完成后,告知用户下一步:

  1. 在 Foundry Ontology Manager 中按 JSON 文件逐一创建 Object Type
  2. 配置 Link Type 数据来源(外键映射 / 关联表)
  3. 在 Code Repository 中实现 Function(TypeScript)
  4. 在 Action Editor 中配置 Action 副作用和 Validation Function

建模五步法

Step 1 名词 → Object Type 候选
Step 2 动词短语 → Link Type 候选(先定语义,再定数据实现)
Step 3 用户操作 → Action Type 候选
Step 4 计算/统计需求 → Function 候选
Step 5 多种对象共享行为 → Interface 候选(至少2个实现者才定义)
Usage Guidance
Install only if you are comfortable with the skill reading and locally storing full source documents. Before use, choose a dedicated output folder, avoid sensitive documents unless needed, delete raw intermediate files after extraction, and do not open generated HTML from untrusted content unless the template has been changed to render document fields safely.
Capability Assessment
Purpose & Capability
The described behavior fits a document parsing and ontology visualization skill, including reading Feishu/local documents and generating local outputs, but the handling of raw source content raises privacy concerns.
Instruction Scope
The skill reportedly instructs the agent to save complete source document contents automatically and generate files without clearly warning the user, which under-scopes user consent and control.
Install Mechanism
No malicious install mechanism or persistence hook is evidenced; the concern is the runtime workflow and generated artifacts rather than installation.
Credentials
Access to Feishu documents, PDFs, images, and local Markdown can be proportionate for ontology extraction, but retaining full raw contents locally is broader than necessary unless explicitly requested.
Persistence & Privilege
Raw document retention extends the lifetime of potentially confidential business or personal data, and the HTML template may expose document-derived fields to DOM XSS if opened with untrusted content.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ontology-modeling
  3. After installation, invoke the skill by name or use /ontology-modeling
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of ontology-modeling skill for Foundry Ontology guidance. - Guides users in understanding Palantir Ontology concepts and modeling Foundry Ontologies from scratch. - Parses Feishu docs, local markdown, PDF, and images to extract business entities and relationships. - Supports interactive, step-by-step ontology modeling with scenario-based options. - Designs and outputs Object Types, Link Types, Action Types, Functions, and Interfaces in multiple formats: JSON, Markdown, OWL/Turtle, and interactive HTML. - Automates visualization and provides actionable next steps for implementation in Foundry.
Metadata
Slug ontology-modeling
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is ontology?

Use when explaining Palantir Ontology concepts, guiding users to model a Foundry Ontology from scratch, parsing Feishu or local documents to extract business... It is an AI Agent Skill for Claude Code / OpenClaw, with 42 downloads so far.

How do I install ontology?

Run "/install ontology-modeling" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ontology free?

Yes, ontology is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ontology support?

ontology is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ontology?

It is built and maintained by sunny (@theosunny); the current version is v1.0.0.

💬 Comments