mcp-ontology-layer
OWL、HermiT、Ollama によるローカルMCPセマンティックエージェント
macOS上で完全にローカルに動作する実行アーキテクチャ。LLMエージェントとModel Context Protocol (MCP) over STDIOを使用して、銀行オントロジー(OWL/RDF)の決定的な検査、変更、Description Logic (DL)推論、SPARQLクエリを実行します。
主な機能
HermiT DL推論: 統合されたDescription Logic推論器(
sync_reasoner_hermit)により、オントロジーの整合性を検証し、推論されたクラス階層を計算し、充足不可能なクラスを検出します。SPARQLクエリエンジン: RDFLibを介してRDFナレッジグラフに対してW3C SPARQLクエリを直接実行し、複雑なセマンティッククエリ、フィルタリング、集計を可能にします。
タクソノミーとインスタンスの変更(TBox/ABox): OWLクラス、サブクラス階層、名前付き個体のアサーションを動的に挿入します。
インタラクティブなフォース指向ビジュアライゼーション: ナレッジグラフをインタラクティブなPyVis HTMLネットワークに自動エクスポートします。
デュアル実行モード: 自動バッチパイプライン(
agente.py)と永続的な対話型REPL(agent_interactive.py)。
Related MCP server: OWL-MCP
アーキテクチャ
このシステムは、モデル推論とグラフ実行を4つのコアレイヤーに分離します:
エージェントオーケストレータ:
agente.py: バッチエージェントの目標をエンドツーエンドで実行する自動パイプライン。agent_interactive.py: 状態を維持し、動的なマルチステップのセマンティックワークフローを実行するマルチターン対話型REPL。
LLMエンジン(
Ollama): ローカルモデル(例:glm-5.2:cloud、qwen2.5-coder)を実行し、ファイルへの直接アクセスなしで意図の分解とパラメータのフォーマットを実行します。MCPサーバー(
server.py): STDIOを介して通信するJSON-RPC 2.0インターフェース。モデルのツール呼び出しを、Owlready2とRDFLibを介した決定的なセマンティックグラフ操作に変換します。セマンティックレイヤー(
core.owl): HermiT DL推論器で検証された永続的なW3C RDF/XMLオントロジーグラフ。
リポジトリ構造
core.owl: RDF/XML形式の基本銀行オントロジーファイル(W3C OWL標準)。server.py: TBox/ABox変更、SPARQL実行、HermiT推論、PyVisグラフエクスポートを提供するネイティブJSON-RPC 2.0 MCPサーバー。agente.py: OllamaをMCPサーバーに接続する自動バッチ実行エージェント。agent_interactive.py: リアルタイムのオントロジー管理のためのインタラクティブな対話型REPLエージェント。requirements.txt: Python依存関係(owlready2、rdflib、pyvis)。graph.html: エクスポートされたインタラクティブなHTMLグラフビジュアライゼーション(オンデマンドで生成)。README.md: プロジェクトアーキテクチャ、ツールドキュメント、セットアップ手順。
前提条件
OS: macOS (Apple SiliconまたはIntel)
Python: 3.10以上
Ollama: インストールされ、ローカルで実行中
Java: OpenJDK / JRE (HermiT推論器のためにOwlready2が必要)
インストールと環境セットアップ
リポジトリをクローンし、プロジェクトディレクトリに移動します:
git clone [https://github.com/jairorodriguezarias/mcp-ontology-layer.git](https://github.com/jairorodriguezarias/mcp-ontology-layer.git)
cd mcp-ontology-layer仮想環境を作成してアクティベートします:
python3 -m venv venv
source venv/bin/activate必要な依存関係をインストールします:
pip install -r requirements.txtOllamaでモデルをダウンロードします:
ollama pull glm-5.2:cloudエージェントデモを実行します:
python3 agente.pypython3 agent_interactive.pyナレッジグラフの可視化
open graph.html利用可能なMCPツール
list_classes
パラメータ: なし
説明:
core.owlをロードし、登録されているすべてのオントロジークラスを返します。add_subclass
パラメータ:
new_class(文字列、必須)、parent_class(文字列、必須)説明: 既存の親クラスの下に新しいクラスを挿入し、更新されたRDF/XMLグラフをディスクに保存します。
create_individual
パラメータ:
class_name(文字列、必須)、individual_id(文字列、必須)説明: 特定のクラスに属する具体的なABox個体をインスタンス化します。
check_consistency
パラメータ: なし
説明: HermiT Description Logic (DL)推論器を実行して、論理的な整合性を検証し、充足不可能なクラスを検出します。
execute_sparql
パラメータ:
query(文字列、必須)説明: RDFナレッジグラフに対して標準のW3C SPARQLクエリを実行します。
export_graph
パラメータ:
output_html(文字列、オプション; デフォルト:graph.html)説明: PyVisを使用して、オントロジーのインタラクティブなフォース指向HTMLグラフビジュアライゼーションを生成します。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
Query your own knowledge graph from any MCP client. The graph lives in a database you own.
Cross-vendor AI memory over MCP. One semantic store, readable and writeable from every MCP client.
MCP server for querying BrainKB, a knowledge base for neuroscience knowledge graphs.
Related MCP Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that connects GraphDB's SPARQL endpoints and Ollama models to Claude, enabling Claude to query and manipulate ontology data while leveraging various AI models.283MIT
- FlicenseNot gradedqualityDmaintenanceA Model-Context-Protocol server that enables AI assistants to create, edit, and manage Web Ontology Language (OWL) ontologies through function calls using OWL functional syntax.22-
- AlicenseAqualityAmaintenanceAI-native ontology engineering MCP server for OWL/RDF/SPARQL. Validate, query, diff, lint, version, and govern knowledge graphs via Oxigraph triple store.422,951MIT

ontoloomofficial
AlicenseNot gradedqualityDmaintenanceMCP server for building and exploring OWL 2 ontologies using AI agents, with tools for axiom management, structural pattern matching, and persistent selections.25BSD 3-Clause