Skip to main content
Glama
nrwoodpsh
by nrwoodpsh

py-ontology-server-starter

オントロジー知識サーバースターター — FastAPIセマンティックレイヤー + Apache Jena Fusekiトリプルストア、利用者はRESTとMCPの両方

Palantir式オブジェクト中心オントロジー(Object Type / Property / Link Type)をコードで宣言し、 保存・照会はW3C標準(RDF / SPARQL 1.1)で処理する。アプリケーションコードはSPARQL標準のみ を使用するため、ストアをGraphDBなどに交換してもアプリはそのまま動作する。

┌─ 소비자 ──────────────────────────────┐
│  AI 에이전트(MCP)      앱·사람(REST)   │
└──────────┬───────────────┬───────────┘
           │               │
   mcp_server.py       api/rest.py      ← 이중 어댑터
           └───────┬───────┘
            ontology/ + store/           ← 코어: 온톨로지 정의 + SPARQL 클라이언트
                   │
        Apache Jena Fuseki (docker)      ← 저장·SPARQL·추론
                   ▲
             ingest/ 파이프라인           ← 지식원 → RDF 변환·적재

クイックスタート

# 1. 트리플스토어 기동
docker compose up -d fuseki          # http://localhost:3030 (admin / admin)

# 2. 앱 설치
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

# 3. 샘플 데이터 적재 (CSV → RDF → Fuseki)
python -m ontology_server.ingest.example_csv data/sample/organizations.csv \
  --object-type organization --push

# 4. REST 서버 기동
uvicorn ontology_server.main:app --reload
# → http://localhost:8000/docs
curl localhost:8000/objects/organization

Related MCP server: mcp-ubergraph-query

MCPアダプター(AIエージェント用)

stdioトランスポートで実行される。Claude Codeプロジェクトの.mcp.json:

{
  "mcpServers": {
    "ontology": {
      "command": "/절대경로/.venv/bin/python",
      "args": ["-m", "ontology_server.mcp_server"]
    }
  }
}

提供ツール: list_object_types(スキーマ把握) · search_objects(タイプ別インスタンス照会) · sparql_query(読み取り専用の直接照会)。

自分のドメインに置き換える

  1. src/ontology_server/ontology/sample.pyをドメインオントロジーに置き換える — Object Type・Link Typeの宣言だけを変更すればREST・MCP・クエリビルダーも追従する。

  2. src/ontology_server/ingest/に知識源ごとの収集モジュールを追加する(example_csv.py参照)。

  3. 外部連携・標準準拠が必要な場合は、名前空間を実際のURIスキームに定め、OWLスキーマ文書も併せて管理する。

テスト

pytest                       # 단위 테스트 (Fuseki 불필요)
RUN_INTEGRATION=1 pytest     # Fuseki 기동 상태에서 통합 테스트 포함

構成

パス

役割

ontology/model.py

Object/Link Type定義フレームワーク (Palantir式)

ontology/sample.py

サンプルオントロジー — プロジェクトで置き換えるファイル

store/sparql.py

SPARQL 1.1クライアント (ストア交換可能なポイント)

api/rest.py

RESTアダプター

mcp_server.py

MCPアダプター

ingest/

知識源 → RDF収集パイプライン

docker-compose.yml

Fuseki起動

ライセンス

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    A Model Context Protocol server that provides read-only access to Ontotext GraphDB, enabling LLMs to explore RDF graphs and execute SPARQL queries.
    2
    11
    16
    GPL 3.0
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to query the Ubergraph biomedical ontology SPARQL endpoint with tools for custom SPARQL queries, term lookup, search, and hierarchy traversal.
    4
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to interact with ontologies through the Ontology Access Kit, providing ontology querying and management capabilities.
    5
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwoodpsh/py-ontology-server-starter'

If you have feedback or need assistance with the MCP directory API, please join our Discord server