
Web Algebra
io.github.AtomGraph由 GitHub 账号 AtomGraph 发布v2.0.4更新于 Oct 29, 2026
Composable Linked Data and SPARQL operations, and LinkedDataHub content tools
概览
可组合的 RDF 与 SPARQL 操作服务器,让助手读取、查询和写入关联数据,并管理 LinkedDataHub 内容。
- 可以做什么
- 通过 GET、PATCH、POST、PUT 读写关联数据资源
- 执行 SPARQL 查询(SELECT、CONSTRUCT、DESCRIBE),支持值替换与查询生成
- 提取类、数据类型属性、对象属性及本体等模式信息
- 进行实体对齐,并构造和操作 URI 与字符串
- 以变量、循环、过滤等控制流组合操作,作为单个 JSON 计划执行
- 创建和管理 LinkedDataHub 的容器、条目、文件、图表、视图与区块
- 适用场景
- 适合需要处理 RDF 关联数据或 SPARQL 端点的场景,也适合构建和填充 LinkedDataHub 内容;当多步工作流需要编译成一个 JSON 计划并原子执行时尤其有用。
- 运行要求
- 以 Python 包形式通过 uvx 在本地运行(需要 uv)。可选环境变量:CERT_PEM_PATH 与 CERT_PASSWORD 用于向 LinkedDataHub 进行认证请求,OPENAI_API_KEY 供 SPARQLString 工具使用。需要能访问目标关联数据端点或运行中的 LinkedDataHub 实例。
安装
在 SourceWeft 中
- 打开 控制台中的 Web Algebra,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Web-Algebra
[Web-Algebra - Listed on Claude AI Directory]
A composable RDF operations system that translates natural language instructions into JSON-formatted domain-specific language operations for loading, querying, and writing RDF Linked Data.
Overview
This system implements generic operations for RDF Linked Data and SPARQL management, as well as some LinkedDataHub-specific operations. Operations can be consumed in two ways:
- Executable JSON format: Operations are composed into JSON structures and executed by the provided execution engine
- Model Context Protocol (MCP): Operations are exposed as tools for AI agents to use interactively
Instead of agents executing semantic workflows step-by-step through individual MCP tool calls, Web-Algebra enables agents to compile entire workflows into optimized JSON "bytecode" that executes atomically - enabling complex multi-operation compositions.
Demo
[Web-Algebra in action: an AI agent builds Linked Data pages over MCP]
See WebAlgebra in action - translating natural language into RDF operations.
Architecture
The system is built around the Operation abstract base class that provides:
- Registry System: Auto-discovery of operations from
src/web_algebra/operations/ - JSON DSL: Operations use
@opkey withargsfor parameters, supporting nested operation calls - RDFLib Type System: Uses
URIRef,Literal,Graph, andResulttypes internally for proper RDF handling - Execution Engine: Both standalone execution and MCP server integration
- Context System: ForEach operations set row context for inner operations to access via
Value - URI Resolution: Proper semantic URI construction with
ResolveURIoperation
Key Components
- System Prompt: Complete operation definitions and JSON format specification
- Formal Semantics: Complete type system and operation catalog
- Operation Interface: Base class and JSON interpreter
- Operation Implementations: Directory containing all available operations
- Examples: Real-world plans over live Linked Data, each with its result and checks
Operations
The operations cover read-write Linked Data, SPARQL queries, URI manipulation, and LinkedDataHub-specific resource creation. Non-exhaustive list:
- Linked Data
GETPATCHPOSTPUT
- SPARQL
CONSTRUCTDESCRIBESELECTSubstituteValuesSPARQLString
- Schema
ExtractClassesExtractDatatypePropertiesExtractObjectPropertiesExtractOntology
- Reconciliation
Reconcile
- URI & String Operations
ResolveURIEncodeForURIConcatReplaceStrStrUUIDURI
- Date/Time
Now
- Control Flow & Variables
ValueVariableForEachIterateFilterBindingsCurrentPositionLastMerge
- LinkedDataHub-specific
ldh-CreateContainerldh-CreateItemldh-Listldh-AddFileldh-AddGenericServiceldh-AddResultSetChartldh-AddSelectldh-AddConstructldh-AddViewldh-AddObjectBlockldh-AddXHTMLBlockldh-RemoveBlockldh-GeneratePortalldh-GenerateClassContainersldh-GenerateOntologyViews
Usage
Pre-requisites
Standalone
Natural language instruction
Then enter instruction, for example:
Select random 10 UK cities from DBpedia
See the instructions of the examples.
Currently requires OpenAI API access. OPENAI_API_KEY env value has to be set.
Execute JSON
See the examples: each has the instruction it answers, its plan, the result of a run, and checks.
With LinkedDataHub
- Run LinkedDataHub v6
- Give
web-algebrayour LDH's owner certificate and its password in theCERT_PEM_PATHandCERT_PASSWORDenvironment variables (or the--cert_pem_pathand--cert_passwordoptions, which override them). For example:
Here and throughout this guide, the client certificate and its password are only required for authentication with LinkedDataHub. You don't need them if you're not using LinkedDataHub with Web Algebra.
As MCP server
Install
Requires uv. Add this to your MCP client configuration (e.g. claude_desktop_config.json):
or with Claude Code:
uvx web-algebra mcp runs the same server.
Environment variables:
stdio transport
Streamable HTTP transport
with CERT_PEM_PATH and CERT_PASSWORD set, as above, for LinkedDataHub.
MCP Inspector config
You can the inspector like this:
and then open on the URL printed in its console output, for example:
The MCP_PROXY_AUTH_TOKEN is required. If the link does not appear, you need to copy the session token from the console and paste it into inspector's Proxy Session Token config.
Web Algebra's settings:
- Transport Type
- Streamable HTTP
- URL
- http://127.0.0.1:8000/mcp
Claude Desktop tool config from a local checkout
To run the MCP server from a local checkout instead of the published package, add a Web Algebra entry (that uses stdio transport) to the mcpServer configuration your claude_desktop_config.json file:
Leave the command as it is. Those uv run --with arguments are important, otherwise 3rd party packages cannot be found.
On my Mac, the path to uv has to be absolute, otherwise it doesn't work in Claude Desktop 🤷♂️.
CERT_PEM_PATH and CERT_PASSWORD env values are optional.
来源:README.md,提交 e3d5331
工具
0版本历史
2- v2.0.4最新Oct 29, 2026
- v2.0.1Oct 21, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分