Web-Algebra

by atomgraph

Not rated
GitHub

About

Suite of generic Linked Data/SPARQL as well as LinkedDataHub-specific MCP tools

Details

Author
atomgraph
Categories
Other

Setup

Install Web-Algebra in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/atomgraph/Web-Algebra

Follow the installation instructions in the repository README, then restart your MCP client.

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.

This system implements generic operations for RDF Linked Data and SPARQL management, as well as someLinkedDataHub-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.

See WebAlgebra in action - translating natural language into RDF operations.

The system is built around theOperationabstract base class that provides:

- Registry System: Auto-discovery of operations fromsrc/web_algebra/operations/
- JSON DSL: Operations use@opkey withargsfor parameters, supporting nested operation calls
- RDFLib Type System: UsesURIRef,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 viaValue
- URI Resolution: Proper semantic URI construction withResolveURIoperation

- 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
-
JSON Examples: Sample operation compositions

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

- CONSTRUCT
- DESCRIBE
- SELECT
- Substitute
- Values
- SPARQLString

- ExtractClasses
- ExtractDatatypeProperties
- ExtractObjectProperties
- ExtractOntology

- ResolveURI
- EncodeForURI
- Concat
- Replace
- Str
- STRUUID
- URI

- Value
- Variable
- ForEach
- Filter
- Bindings
- Current
- Execute
- Merge

- ldh-CreateContainer
- ldh-CreateItem
- ldh-List
- ldh-AddFile
- ldh-AddGenericService
- ldh-AddResultSetChart
- ldh-AddSelect
- ldh-AddView
- ldh-AddObjectBlock
- ldh-AddXHTMLBlock
- ldh-RemoveBlock
- ldh-GeneratePortal
- ldh-GenerateClassContainers
- ldh-GenerateOntologyViews

Currently requires OpenAI API access.OPENAI_API_KEYenv value has to be set.

uv run python src/web_algebra/main.py --from-json ./examples/united-kingdom-cities.json

- Run LinkedDataHub v5
- Executesrc/web_algebra/main.py, it expects the path to your LDH's owner certificate and its password as arguments. For example:

uv run python src/web_algebra/main.py --from-json ./examples/united-kingdom-cities.json \ --cert_pem_path ../LinkedDataHub/ssl/owner/cert.pem \ --cert_password 

Here and throughout this guide, the client certificate/password arguments are only required for authentication with LinkedDataHub. You don't need them if you're not using LinkedDataHub with Web Algebra.

uv run uvicorn web_algebra.server:app --reload

or with LinkedDataHub certificate credentials (change the path and password to yours):

CERT_PEM_PATH="/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/ssl/owner/cert.pem" CERT_PASSWORD="" uv run uvicorn web_algebra.server:app --reload

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

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

TheMCP_PROXY_AUTH_TOKENis 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.

Add Web Algebra entry (that uses stdio transport) to themcpServerconfiguration yourclaude_desktop_config.jsonfile:

{ "mcpServers": { "Web Algebra": { "command": "uv", "args": [ "--directory", "/Users/Martynas.Jusevicius/WebRoot/Web-Algebra/src", "run", "--with", "mcp[cli]", "--with", "rdflib", "--with", "openai", "python", "-m", "web_algebra" ], "env": { "CERT_PEM_PATH": "/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/ssl/owner/cert.pem", "CERT_PASSWORD": "" } } } }

Leave the command as it is. Thoseuv run --witharguments are important, otherwise 3rd party packages cannot be found.

On my Mac, the path touvhas to be absolute, otherwise it doesn't work in Claude Desktop πŸ€·β€β™‚οΈ.

CERT_PEM_PATHandCERT_PASSWORDenv values are optional.

Ontology driven knowledge system with formal OWL-RL reasoning, SPARQL graph + SQLite dual store, and self-improving memory tiers. 22 MCP tools for capture, search, reasoning, graph operations, and diagnostics. Local-first.

Enables Claude, ChatGPT, and other MCP-compatible AI assistants to directly query 900+ datasets, geodata, parliamentary proceedings, tourism data, linked data, and real-time environmental and mobility information from the City of Zurich. 20 Tools, 6 Resources, 6 APIs.

Semantic search using the Qdrant vector database.

Semantic search over 4.6M+ text chunks from 20,000+ classical philosophy and humanities works β€” Plato, Aristotle, Kant, Nietzsche, and thousands more. Multilingual (Greek, Latin, German, French, English). No install needed.

Query Amazon Neptune databases using openCypher, Gremlin, and SPARQL. Supports both Neptune Database and Neptune Analytics.

MCP server for the Oyemi semantic lexicon. Provides deterministic word-to-code mapping and valence/sentiment analysis for AI agents like Claude, ChatGPT, and Gemini.

Semantic search using the Qdrant vector database.

Rememberizer MCP Server for Common Knowledge

Access and search personal or team knowledge repositories, including documents and Slack discussions, using semantic search and retrieval tools.

Managed graph database (Cypher + SPARQL + SQL) with native MCP endpoint β€” AI agents query graphs directly, $0 egress, free tier.

Transaction-complete hotel booking over MCP β€” 300K+ properties, real hotel confirmation numbers, loyalty points, secure checkout. Hotels are merchant of record. Builders set their own booking fee via Stripe Connect. Built on proven distribution infrastructure.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.