跳到正文
原文
Simon Willison·· 2026-10-16AI 评分51

sparqlite 以 Rust 扩展在 SQLite 内执行 SPARQL 1.1

sparqlite: SPARQL 1.1 inside SQLite, written in Rust

AI 导读

sparqlite 是用 Rust 编写的 SQLite 可加载扩展,把 RDF 四元组存在普通 SQLite 表中,并在 SQLite 进程内原生执行 SPARQL 1.1 查询和更新。

正文 · AI 翻译

研究 sparqlite:用 Rust 编写、位于 SQLite 内部的 SPARQL 1.1 — sparqlite 是一个基于 Rust 的 SQLite 可加载扩展,它将 RDF 四元组存储在普通的 SQLite 表中,并在 SQLite 进程内部原生执行 SPARQL 1.1 查询与更新。其整数编码的项、覆盖索引、基于代价的规划器、批量连接,以及可选的直接 SQLite B-tree 读取器,在计数模式下相比 SQL 转译实现了 3.5× 的加速,在返回完整结果时实现了 2.8× 的加速,同时通过了 639 项适用的 W3C 评估测试中的 636 项,以及数百万次差分模糊……

这项研究任务实际上是一次实验,旨在以“Ultracode”模式运行 Claude Code for web,正如 Claude Code 文档中的 使用动态工作流大规模编排子代理 所描述的那样。

开启 Ultracode 后,Claude Code 会大量使用动态工作流——它生成 JavaScript 来定义并协调一个子代理网络,以应对复杂问题。

我最初的提示是这样的——我的本意是“直接命中这些行”,“delete”这个词是我在手机上不小心打出的笔误:

Write a SQLite extension in Rust that implants SPARQL and runs really fast because it can hit the delete rows directly

这导致 Claude Code for web 持续运转了超过 12 小时。第二天我查看了它的进度,并在注意到它构建了多少个 Rust crate 后,只发送了一条后续提示:

Every folder in the crates/ directory needs a README

Include a tutorial.md teaching users how to install the extension and how to run it in the SQLite CLI and then teaching them SPARQL in addition to how to use the SQLite extension

Include a script with the tutorial for populating a SQLite database with useful and realistic example data for that tutorial

这个项目感觉像是更上一层的氛围编程——要审查这里产出的代码根本不现实,即便跟着文档走也是一项相当大的工作投入。我并不完全确定该拿它怎么办——我现在似乎拥有一个用 Rust 实现、位于 SQLite 内部的完整 SPARQL,但如果我只是一时兴起创建了它,又不能(或不愿)投入必要的时间去弄懂它能做什么,那它的价值又有多大?

来源:Simon Willison · simonwillison.net