OntoBricks:表变知识图谱前,先看许可、数据流与权限

OntoBricks: Knowledge Graphs and Databricks Boundaries

Tech-News #OntoBricks#Databricks#知识图谱#本体工程#MCP#R2RML
更新于
🇨🇳 中文

OntoBricks 把 Databricks 表中的业务含义组织成可查询的知识图谱,适合已有湖仓的团队做本体设计、映射与 Agent 接入。当前0.9.3采用Databricks License,属于源码可用项目;不能按MIT或Apache工具理解为可自由脱离Databricks使用。

它来自Databricks Labs,官方流程是导入元数据、生成本体、自动映射、同步与探索。“四步”概括了产品路径,没有省掉工作区、计算资源、权限和业务语义审核。素材中的“数据不出工作区”,也需要结合实际图引擎和模型端点核对。

核对时间:2026年11月29日;固定提交:6cd27ce5a72dca1690cb573defa83dd3e145017e。本次阅读源码与文档,并运行原始SPARQL能力校验器的78项测试;没有登录Databricks工作区,没有构建云端图谱、调用模型或验证三种后端性能。

官方仓库:https://github.com/databrickslabs/ontobricks 固定版本:https://github.com/databrickslabs/ontobricks/tree/6cd27ce5a72dca1690cb573defa83dd3e145017e 产品站:https://ontobricks.org/

四步构图,分别把什么变成了什么?

假设湖仓里有客户、合同与发票三组表。SQL知道列名和关联键,本体进一步声明Customer、Contract、Invoice代表什么,它们之间允许存在什么关系。R2RML再把这些语义绑定到取数SQL和实例标识,而不是让LLM凭空创造真实业务事实。

步骤输入与产物仍要确认的事情
导入元数据从Unity Catalog读取表、列等描述表和列的业务含义、敏感字段范围
生成本体AI建议实体、关系、属性和公理领域专家审核,不把建议直接视为正确
自动映射生成SQL及R2RML映射主键、连接关系、空值与实体标识是否正确
同步与探索构建或虚拟化三元组,再查询、推理和浏览快照新鲜度、访问身份和推理规则

0.9.3的本体生成不是一次不可检查的输出:向导先检测实体,再由人审核并锁定实体目录,最后补关系、属性与公理,合并时追加到现有本体。自动化减少手写工作,没有取消语义设计责任。

例如,两张表的id=42不一定代表同一个对象;反过来,同一客户在父类与子类中也不应必然变成两个节点。当前版本增加了可选的根类实例IRI范围,但选择什么业务身份,仍需要结合实际数据决定。

本体与映射说明:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/README.md

小M先审阅表与业务实体,再把本体和SQL映射接入知识图谱与Agent工具

AI生成SQL,是否意味着必须持续依赖LLM?

AI辅助路径通过配置的AI Gateway或Model Serving目标工作。映射Agent的工具集中包含sample_table和execute_sql:它可以看样本、执行带小LIMIT的验证查询,再提交映射。因此不能把这段流程描述为“模型只看列名,完全不接触行值”。

另一方面,项目支持领域级No LLM选项。选择后,AI操作会不可用,直接API调用也会被拒绝;手动建模和确定性推理、校验仍可用。这意味着可以不用LLM做部分工作,不意味着整个产品可以脱离Databricks运行。

推理也需要分清:OWL 2 RL、SWRL等是根据已有事实与规则推导;SHACL检查数据是否满足约束。它们可以提高结构一致性,但一条错误的源事实,不会因为通过校验就自动变成真实事实。

映射工具源码:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/src/agents/agent_mapping_pge/generators/entity.py

三种图引擎,是否都等于零拷贝?

不是。领域可以选择Lakehouse、Lakebase或Neo4j;另外还有不构图的No Backend模式。连接配置放在工作区级,图引擎按领域选择。具体数据副本和查询路径并不相同。

模式图数据在哪里需要注意的区别
Lakehouse / DeltaUnity Catalog中的表与视图表模式物化快照;视图模式可实时读取映射结果
Lakebase / PostgresUC图数据族之外,还同步到Postgres有镜像副本,不能说仅保留原表
Neo4jUC数据之外,经Bolt写入所配置实例可使用Aura或自托管服务,位置取决于部署
No Backend不创建图数据对象仅本体模式,映射和知识图谱功能关闭

即使选择Lakehouse的views-only模式,也不能笼统说“系统没有任何数据副本”:探索器的邻接、搜索和属性索引仍是表。源表变了,查询视图与图浏览的索引可能处于不同刷新阶段。应分别验收Build、Refresh cache和实际查询,而不是把“实时视图”当作所有界面始终实时。

此外,Lakehouse图后端不需要另建一套图数据库,不等于整套应用不需要Lakebase。当前领域注册表、版本与Knowledge Store等仍依赖Lakebase;“本地开发”也需要配置Databricks资源。

后端与对象生命周期:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/docs/architecture.md

“数据不出工作区”要检查哪些边界?

我会把这句话拆成三个可核对的问题:模型请求去了哪里、图副本去了哪里、配置导出去了哪里。AI Gateway提供统一入口,仍需检查所选模型目标、实际路由和数据政策,不能仅凭入口名字证明全部计算都在某个边界内。

Neo4j可以指向外部Aura或自托管实例;启用GitHub领域镜像后,本体、映射、规则等配置可推送到仓库。这些配置并不等于原始业务行,但其中的表名、SQL和业务规则仍可能敏感。应记录实际启用的路径,而不是把所有模式都套进同一个承诺。

权限也不是换个后端就自动完全一致。部署文档说明,Apps模式下UC读取使用转发的终端用户身份,缺少用户token时拒绝读取,不悄悄回退为应用服务主体;Lakebase和Neo4j读取则保持服务主体身份,并通过领域Team角色控制访问。用户能访问领域,不应被自动解释为逐行复刻了原表的权限策略。

部署与权限:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/docs/deployment.md

小M沿着模型端点、图数据库与配置仓库逐条核对数据流,并检查每条路径的访问身份

接到LLM后,它是只读查询工具吗?

不一定。GraphQL、SPARQL和MCP是不同接口,不能合并成一个“问图谱”的能力。MCP既可以描述本体、查询实体上下文,也可以暴露领域类上显式声明的动作,包括Unity Catalog函数和Databricks Job。

因此,给Agent接入时要核对领域发布策略、工具开关和类动作,而非只测试“能否列出实体”。No Backend领域只暴露本体信息,也不能被当作已有业务实例图可供检索。

MCP工具说明:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/docs/mcp.md

我们实际验证了什么?

本次在隔离Python环境中运行原仓库的SPARQL能力校验测试文件,结果为78项通过、1条标记警告。测试使用原始校验器、错误类型与rdflib解析器;启动脚本跳过会加载Databricks应用依赖的包初始化。测试包括合成查询和手工构造的代数节点,个别原始测试使用monkeypatch覆盖边界分支。

这是查询能力门禁测试,不是SQL执行或图数据库实测。接受的例子包括基本SELECT和部分字符串过滤;ASK、写入语句,以及ORDER BY、GROUP BY、SERVICE、部分路径和过滤形式等会被拒绝。项目支持SPARQL入口,不等于实现了完整SPARQL 1.1。

那1条警告来自隔离运行未加载项目配置,unit标记未注册,不是测试失败。我们没有据此声称R2RML SQL一定正确、模型生成有效、三种后端性能相同,或整条工作流已经跑通。

原测试:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/tests/units/graphdb/test_v090_graph_access_sparql_validator.py 校验器:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/src/back/core/w3c/sparql/SparqlCapabilityValidator.py

小M让支持的SELECT查询通过门禁,将不支持的语法送回修改,并区分本地校验与云端执行

谁适合试,许可又限制了什么?

已有Databricks湖仓、Unity Catalog和领域建模人员的团队,可以用它减少语义层与图服务的重复搭建。建议先选一条业务链,验收实体身份、映射SQL、权限与刷新,再开放给Agent。若目标是个人电脑上独立部署的通用图谱工具,它的基础设施和许可都不匹配这一预期。

当前LICENSE.txt将使用范围限定在Databricks Services相关用途,修改与分发也须遵守该范围和保留声明等条件。它不是MIT或Apache许可;项目README也明确使用source-available表述。Databricks Labs提供探索性项目,不承诺正式产品支持SLA。应将源码可见、标准格式可导出、部署依赖与使用许可分别评估。

许可原文:https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/LICENSE.txt 相关知识治理阅读:https://blog.mushroom.cv/blog/utopia-deeplethe-enterprise-world-model-bitemporal-knowledge-graph/

常见问题

OntoBricks能离线独立部署在普通电脑上吗?

不能仅凭“本地开发”这样判断。当前配置依赖Databricks工作区、SQL Warehouse及Lakebase等;No LLM只关闭AI功能,不移除这些依赖或许可约束。

三个后端都能保证数据不离开工作区吗?

不能一概而论。要核对Neo4j实例位置、模型路由、配置镜像和部署网络;不同后端的读取身份与数据副本也不相同。

78项测试通过是否证明构图成功?

不是。它只验证原SPARQL能力校验器处理合成查询与边界结构的行为,没有调用Databricks、模型、SQL Warehouse、图后端或MCP服务。


© 2026 Author: Mycelium Protocol. 本文采用 CC BY 4.0 授权——欢迎转载和引用,须注明作者姓名及原文链接,不得去除署名后以原创发布。

🇬🇧 English

OntoBricks gives business meaning to Databricks tables through ontology design, mappings and a queryable knowledge graph. It is useful to teams already operating a lakehouse. Version0.9.3 uses the Databricks License and is source-available; it should not be treated as an MIT or Apache tool for independent deployment outside Databricks.

The four-step workflow summarizes metadata import, ontology generation, automatic mapping and synchronization. It does not remove infrastructure, permission setup or semantic review. The claim that data stays in the workspace also needs checking against the configured models, graph engine and export paths.

Checked November29,2026 at commit 6cd27ce5a72dca1690cb573defa83dd3e145017e. We reviewed source and documentation and ran78 original SPARQL-validator tests. We did not access a Databricks workspace, build a cloud graph, call a model or benchmark the three engines.

Repository: https://github.com/databrickslabs/ontobricks Pinned revision: https://github.com/databrickslabs/ontobricks/tree/6cd27ce5a72dca1690cb573defa83dd3e145017e Website: https://ontobricks.org/

What do the four steps produce?

Consider customer, contract and invoice tables. An ontology declares what those business concepts mean and how they relate. R2RML binds them to extraction SQL and instance identifiers. It does not authorize an LLM to invent business facts.

StepOutputHuman responsibility
Import metadataUnity Catalog table and column descriptionsMeaning and sensitive-field scope
Generate ontologySuggested entities, relations, attributes and axiomsDomain review
Auto-mapSQL and R2RML mappingsKeys, joins, nulls and identity
Synchronize and exploreMaterialized or virtual triplesFreshness, permissions and rules

The current generation wizard detects entities, lets a reviewer lock the catalog, then completes relations, attributes and axioms. It appends to the existing ontology. This reduces manual work without eliminating design responsibility.

A shared id=42 need not identify the same object across tables. Conversely, parent and subclass mappings may refer to one real entity. Version0.9.3 adds an optional root-class IRI scope, but the correct business identity still depends on the data.

Workflow: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/README.md

Little M reviews business concepts before linking ontology, SQL mappings, graph and agent tools

Does the workflow always require an LLM?

The AI path uses a configured AI Gateway or Model Serving target. The mapping agent has sample_table and execute_sql tools, including limited-row validation queries. Do not describe this as a process where the model sees only column names and never row values.

A domain-level No LLM option disables AI actions, including direct API attempts, while manual modeling and deterministic reasoning or validation remain available. It does not remove Databricks dependencies.

OWL2RL and SWRL derive consequences from facts and rules; SHACL checks constraints. Consistent structure does not establish that an underlying business fact is true.

Mapping tools: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/src/agents/agent_mapping_pge/generators/entity.py

Are all three backends zero-copy?

No. Engines are selected per domain, with connection settings managed globally. There is also an ontology-only No Backend mode.

ModeStorageConsequence
Lakehouse / DeltaUnity Catalog tables and viewsTable snapshots or live mapping views
Lakebase / PostgresA mirrored graph beyond the UC objectsAnother data copy
Neo4jConfigured Bolt-connected instanceAura or self-hosted location matters
No BackendNo graph objectsOntology information without mapping or graph functions

Even Lakehouse views-only mode keeps Explorer adjacency, search and property indexes as tables. A live mapping view and an indexed exploration screen can have different freshness. Verify Build, Refresh cache and actual queries separately.

Avoid equating “no separate graph database” with no Lakebase dependency. The registry, versions and Knowledge Store still use Lakebase. Local development also requires Databricks resources.

Backend lifecycle: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/docs/architecture.md

What does workspace containment depend on?

Inspect three paths: model requests, graph copies and configuration exports. An AI Gateway entry point alone does not establish the destination or residency of every model operation. Check the actual route and applicable data policy.

Neo4j can point to Aura or a self-hosted service. The optional GitHub mirror exports domain configuration, including ontology, mappings and rules. That is different from exporting source rows, but SQL and business rules can still be sensitive.

Authorization also varies by engine. The deployment guide says UC reads in Apps use the forwarded end-user identity and deny access without a user token, rather than falling back to the application principal. Lakebase and Neo4j reads retain the service-principal identity and are gated by domain Team roles. Domain access is not proof of identical source-table row-level enforcement.

Deployment and identities: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/docs/deployment.md

Little M traces model, graph and configuration destinations and checks the identity used on each path

Is MCP access necessarily read-only?

No. MCP can describe ontologies and retrieve entity context, but it can also expose explicitly declared class actions backed by Unity Catalog functions or Databricks Jobs. Review domain publication policy, tool switches and actions before connecting an agent.

GraphQL, SPARQL and MCP are separate interfaces with different behavior. An ontology-only domain also cannot be treated as an already populated business-instance graph.

MCP reference: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/docs/mcp.md

What did our local check establish?

We ran the original SPARQL capability-validator test file in an isolated Python environment:78 passed, with one marker warning. The harness bypasses eager application-package initialization; it uses the original validator, errors and rdflib parser. Tests include synthetic queries and crafted algebra nodes, with an upstream monkeypatch case for an internal boundary.

This checks a query gate, not SQL execution. Basic SELECT and some string filters pass; ASK, writes, ORDER BY, GROUP BY, SERVICE and several path or filter forms are rejected. A SPARQL entry point does not imply full SPARQL1.1 support.

The warning comes from the isolated configuration not registering the unit marker. It is not a failure. These results do not validate generated SQL, model output, backend performance or the full graph pipeline.

Original tests: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/tests/units/graphdb/test_v090_graph_access_sparql_validator.py Validator: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/src/back/core/w3c/sparql/SparqlCapabilityValidator.py

Little M accepts supported SELECT queries and rejects unsupported syntax while separating validation from cloud execution

Who should evaluate it, and under what license?

Teams with Databricks, Unity Catalog and domain-modeling expertise can evaluate it as a semantic and graph-service layer. Start with one business chain and check identity, mappings, access and refresh behavior before exposing it to agents. It is a poor fit for a standalone personal-computer graph tool.

The current Databricks License ties use to Databricks Services, with modification and redistribution subject to its scope and notice conditions. It is not MIT or Apache. The README calls it source-available, and Databricks Labs provides exploratory projects without a formal support SLA. Evaluate source visibility, interoperable formats, deployment dependencies and usage rights separately.

License: https://github.com/databrickslabs/ontobricks/blob/6cd27ce5a72dca1690cb573defa83dd3e145017e/LICENSE.txt Related knowledge governance: https://blog.mushroom.cv/blog/utopia-deeplethe-enterprise-world-model-bitemporal-knowledge-graph/

FAQ

Can local development mean standalone offline deployment?

No. Current setup depends on a Databricks workspace, SQL Warehouse and Lakebase. No LLM disables AI features, not those dependencies or license conditions.

Do all backends keep data in the workspace?

Do not assume so. Check Neo4j placement, model routing, configuration mirroring and network topology, as well as each backend’s identity and copy behavior.

Do78 passing tests prove graph construction works?

No. They cover the original SPARQL capability validator with synthetic inputs and boundaries. They do not exercise Databricks, models, SQL Warehouse, graph backends or MCP.


© 2026 Author: Mycelium Protocol. Licensed under CC BY 4.0 — free to share and adapt with attribution. You must credit the author and link to the original; removing attribution and republishing as original is not permitted.

💬 评论与讨论

使用 GitHub 账号登录后发表评论

关于本站 · 免责声明

🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。

⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.

  1. 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
  2. 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
  3. 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
  4. 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。

📮 侵权 / 勘误 / 合作咨询:[email protected]