Web Algebra

io.github.AtomGraph由 GitHub 帳號 AtomGraph 發布v2.0.4更新於 Oct 29, 2026

Composable Linked Data and SPARQL operations, and LinkedDataHub content tools

概覽

AI 產生的概覽

可組合的 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 實例。
安裝前請注意
包含寫入操作:PATCH、POST、PUT 會修改遠端鏈結資料,LinkedDataHub 工具會建立、新增與移除資源及區塊。CERT_PASSWORD 保護的是具備 LinkedDataHub 擁有者權限的用戶端憑證,請勿放入共用設定。使用 SPARQLString 時 OPENAI_API_KEY 會送往 OpenAI,查詢文字可能離開本機。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Web Algebra,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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:

  1. Executable JSON format: Operations are composed into JSON structures and executed by the provided execution engine
  2. 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 @op key with args for parameters, supporting nested operation calls
  • RDFLib Type System: Uses URIRef, Literal, Graph, and Result types 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 ResolveURI operation

Key Components

Operations

The operations cover read-write Linked Data, SPARQL queries, URI manipulation, and LinkedDataHub-specific resource creation. Non-exhaustive list:

  • Linked Data
    • GET
    • PATCH
    • POST
    • PUT
  • SPARQL
    • CONSTRUCT
    • DESCRIBE
    • SELECT
    • Substitute
    • Values
    • SPARQLString
  • Schema
    • ExtractClasses
    • ExtractDatatypeProperties
    • ExtractObjectProperties
    • ExtractOntology
  • Reconciliation
    • Reconcile
  • URI & String Operations
    • ResolveURI
    • EncodeForURI
    • Concat
    • Replace
    • Str
    • StrUUID
    • URI
  • Date/Time
    • Now
  • Control Flow & Variables
    • Value
    • Variable
    • ForEach
    • Iterate
    • Filter
    • Bindings
    • Current
    • Position
    • Last
    • Merge
  • LinkedDataHub-specific
    • ldh-CreateContainer
    • ldh-CreateItem
    • ldh-List
    • ldh-AddFile
    • ldh-AddGenericService
    • ldh-AddResultSetChart
    • ldh-AddSelect
    • ldh-AddConstruct
    • ldh-AddView
    • ldh-AddObjectBlock
    • ldh-AddXHTMLBlock
    • ldh-RemoveBlock
    • ldh-GeneratePortal
    • ldh-GenerateClassContainers
    • ldh-GenerateOntologyViews

Usage

Pre-requisites

  1. Install uv
  2. bash
    uv venvuv sync

Standalone

Natural language instruction
bash
uv run python src/web_algebra/main.py

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
bash
uv run web-algebra --from-json ./examples/city-profiles/plan.json

See the examples: each has the instruction it answers, its plan, the result of a run, and checks.

With LinkedDataHub
  1. Run LinkedDataHub v6
  2. Give web-algebra your LDH's owner certificate and its password in the CERT_PEM_PATH and CERT_PASSWORD environment variables (or the --cert_pem_path and --cert_password options, which override them). For example:
bash
export CERT_PEM_PATH=../LinkedDataHub/ssl/owner/cert.pemexport CERT_PASSWORD="$(cat ../LinkedDataHub/secrets/owner_cert_password.txt)"uv run web-algebra --from-json ./examples/northwind-category-catalogue/plan.json

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):

json
{    "mcpServers": {        "web-algebra": {            "command": "uvx",            "args": ["--from", "web-algebra", "web-algebra-mcp"],            "env": {                "CERT_PEM_PATH": "/path/to/LinkedDataHub/ssl/owner/cert.pem",                "CERT_PASSWORD": "********"            }        }    }}

or with Claude Code:

bash
claude mcp add web-algebra -e CERT_PEM_PATH=/path/to/LinkedDataHub/ssl/owner/cert.pem -e CERT_PASSWORD=******** -- uvx --from web-algebra web-algebra-mcp

uvx web-algebra mcp runs the same server.

Environment variables:

NameRequiredDescription
CERT_PEM_PATHNoPath to the LinkedDataHub owner certificate (PEM). Only needed for LinkedDataHub operations.
CERT_PASSWORDNoPassword for the certificate above.
OPENAI_API_KEYNoOpenAI API key. Only needed for the SPARQLString tool, which asks a model to write the query.
stdio transport
bash
uv run web-algebra-mcp
Streamable HTTP transport
bash
uv run uvicorn web_algebra.server:app --reload

with CERT_PEM_PATH and CERT_PASSWORD set, as above, for LinkedDataHub.

MCP Inspector config

You can the inspector like this:

bash
npx @modelcontextprotocol/inspector

and then open on the URL printed in its console output, for example:

http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=b31e4b3d852b5a2445f45032c484e54e319bf16359585858cf88fe9a90816744

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:

json
{    "mcpServers": {        "Web Algebra": {            "command": "uv",            "args": [                "--directory",                "/path/to/Web-Algebra",                "run",                "web-algebra-mcp"            ],            "env": {                "CERT_PEM_PATH": "/path/to/LinkedDataHub/ssl/owner/cert.pem",                "CERT_PASSWORD": "********"            }        }    }}

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v2.0.4最新Oct 29, 2026
  2. v2.0.1Oct 21, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分