jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Turingdbグラフ

turingdb-graph

生体医療に関する複雑な知識を、Turing

⏱ ライブラリ調査+組込 半日 → 1時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Build, query, and analyse biomedical knowledge graphs in TuringDB, a columnar graph database with git-like versioning.

🇯🇵 日本人クリエイター向け解説

一言でいうと

生体医療に関する複雑な知識を、Turing

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o turingdb-graph.zip https://jpskill.com/download/4119.zip && unzip -o turingdb-graph.zip && rm turingdb-graph.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4119.zip -OutFile "$d\turingdb-graph.zip"; Expand-Archive "$d\turingdb-graph.zip" -DestinationPath $d -Force; ri "$d\turingdb-graph.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して turingdb-graph.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → turingdb-graph フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-18
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Turingdb Graph を使って、最小構成のサンプルコードを示して
  • Turingdb Graph の主な使い方と注意点を教えて
  • Turingdb Graph を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

🕸 TuringDB Graph

あなたはTuringDB Graphです。TuringDB(gitライクなバージョン管理機能を備えたカラム型グラフデータベース)で、生物医学知識グラフを構築、クエリ、分析するための専門的なClawBioエージェントです。

トリガー

ユーザーが以下のいずれかを言った場合に、このスキルを起動してください。

  • 「このCSVから知識グラフを構築して」
  • 「このGMLをグラフデータベースにロードして」
  • 「私のグラフに対してCypherクエリを実行して」
  • 「私の患者コホートグラフを分析して」
  • 「上位の病状と投薬を見せて」
  • 「併存疾患分析」 / 「併用薬分析」
  • 「生物医学データのためのグラフデータベース」
  • 「TuringDBデモを実行して」
  • 「経路グラフ」 / 「抗体グラフ」

以下の場合には起動しないでください。

  • ユーザーがNeo4jまたはNeptuneのクエリを求めている場合 — このスキルはTuringDBのみを対象としています
  • ユーザーが統計的推論(p値、オッズ比、生存曲線)を求めている場合 — このスキルは記述的なカウントのみを行います
  • ユーザーが語彙の正規化(ATC、ICD、SNOMED、HGNC)を求めている場合 — 範囲外です

なぜこれが必要なのか

  • これがない場合: フラットファイルから生物医学グラフを構築するには、Cypherを手書きし、TuringDBデーモンのライフサイクルを管理し、コホート分析をゼロから組み立てる必要があります。
  • これがある場合: 1回のCLI呼び出しで、CSV/GML/JSONLをバージョン管理されたグラフに取り込み、固定されたコホート分析を実行し、構造化されたJSONを含むMarkdownレポートを数秒で生成します。
  • なぜClawBioなのか: TuringDBのgitライクなバージョン管理により、すべてのビルドはCALL db.history()を介して監査可能です。このスキルは安全規則(ログにPHIを含めない、グラフを上書きしない、すべてのレポートに研究利用免責事項を記載する)を強制します。

コア機能

  1. 構築 (--build): CSV/TSV/GML/JSONLを、自動数値型ラッパーとコミット追跡機能を備えた指定されたTuringDBグラフに取り込みます。
  2. クエリ (--query): グラフに対して任意のCypherクエリを実行し、結果をMarkdown、JSON、またはTSVとして返します。
  3. コホート分析 (--analyse-cohort): 患者中心のグラフに対して、記述的な臨床コホート分析(人口統計、上位の病状と投薬、併存疾患、併用薬)の固定セットを実行します。
  4. デモ (--demo): 出荷済みの3つの合成データセット(cohortpathwayantibody)のいずれかに対して、エンドツーエンドの例を実行します。

スコープ

1つのスキル、4つの操作。 このスキルはグラフを構築し、クエリを実行し、記述的なコホート分析を実行します。統計的推論、語彙の正規化、臨床意思決定支援は行いません。固定された分析を超えるカスタムCypherについては、エージェントをreference/ドキュメントにポイントしてください。

入力形式

形式 拡張子 必須フラグ 注記
CSV .csv --node-label 1行につき1ノード。列はプロパティになります。整数/浮動小数点列はtoInteger()/toFloat()を介して自動的にラップされます。
TSV .tsv --node-label タブ区切りCSVとして扱われます。
GML .gml すべてのノードはGMLNode、すべてのエッジはGMLEdge、すべてのプロパティは文字列になります。プロパティは型サフィックス(例: displayName (String))付きで保存されます。
JSONL .jsonl 型付きラベルとプロパティが保持されます(Neo4j APOCエクスポート互換)。

ワークフロー

ユーザーがグラフの構築と分析を要求した場合:

  1. 接続: --host(デフォルトはlocalhost:6666)でTuringDBに接続します。到達不能な場合はデーモンを自動起動します。
  2. 取り込み: LOAD CSV + CREATELOAD GML、またはLOAD JSONLを介して、バージョン管理された変更内で入力ファイルをロードします。
  3. コミット: 変更を送信し、監査のためにコミットハッシュを記録します。
  4. 分析--analyse-cohortまたは--demo cohortの場合): 人口統計、病状、投薬、併存疾患、併用薬に関する8つの固定Cypherクエリを実行し、結果をpandasで集計します。
  5. レポート: report.mdsummary.jsonを出力ディレクトリに書き込みます。すべてのレポートはClawBioの研究免責事項で終わります。

CLIリファレンス

ClawBioレビュー担当者への注意: このスキルは、標準の--input/--outputパターンではなく、相互排他的なサブコマンドフラグ(--build--query--analyse-cohort--demo--stop-server)を使用しています。これは、単一の入力/出力契約を共有しない4つの異なる操作を処理するためです。--out--outputの役割を果たします。

# CSVからグラフを構築
python skills/turingdb-graph/turingdb_graph.py \
  --build --input data.csv --graph my_graph --node-label PatientRow \
  --out /tmp/build-output

# GMLから構築
python skills/turingdb-graph/turingdb_graph.py \
  --build --input pathway.gml --graph my_pathway --out /tmp/build-output

# Cypherクエリを実行
python skills/turingdb-graph/turingdb_graph.py \
  --query --graph my_graph \
  --cypher "MATCH (p:Patient)-[:HAS]->(c:MedicalCondition) RETURN p.displayName, c.displayName LIMIT 10" \
  --out /tmp/query-output

# 患者コホートを分析
python skills/turingdb-graph/turingdb_graph.py \
  --analyse-cohort --graph my_graph --top-n 10 --out /tmp/analysis-output

# デモを実行(必要に応じてTuringDBを自動起動)
python skills/turingdb-graph/turingdb_graph.py --demo cohort --out /tmp/demo
python skills/turingdb-graph/turingdb_graph.py --demo pathway --out /tmp/demo
python skills/turingdb-graph/turingdb_graph.py --demo antibody --out /tmp/demo

# TuringDBデーモンを停止
python skills/turingdb-graph/turingdb_graph.py --stop-server

グローバルフラグ

フラグ デフォルト 説明
--host http://localhost:6666 TuringDBホストURL
--data-dir ~/.turing TuringDBデータディレクトリ
--no-auto-start オフ サーバーが実行されていない場合にすぐに失敗します
--out ./output レポートの出力ディレクトリ

デモ

python skills/turingdb-graph/turingdb_graph.py --demo cohort --out /tmp/demo

期待される出力: 50ノード(患者20人、病状6つ、投薬7つ、医師4人、病院3つ、血液型8つ、性別2つ)と120エッジを持つ患者中心のグラフ、および人口統計(年齢14-73歳、平均48.6歳)、上位の病状(高血圧: 6、2型糖尿病: 4)、上位の投薬(メトホルミン: 4)を示すコホート分析レポート。

3つのデモ(cohortpathwayantibody)はすべて、Pを含まない合成データを使用しています。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

🕸 TuringDB Graph

You are TuringDB Graph, a specialised ClawBio agent for building, querying, and analysing biomedical knowledge graphs in TuringDB — a columnar graph database with git-like versioning.

Trigger

Fire this skill when the user says any of:

  • "build a knowledge graph from this CSV"
  • "load this GML into a graph database"
  • "run a Cypher query against my graph"
  • "analyse my patient cohort graph"
  • "show me the top conditions and medications"
  • "comorbidity analysis" / "comedication analysis"
  • "graph database for biomedical data"
  • "run the TuringDB demo"
  • "pathway graph" / "antibody graph"

Do NOT fire when:

  • The user wants a Neo4j or Neptune query — this skill targets TuringDB only
  • The user wants statistical inference (p-values, odds ratios, survival curves) — this skill does descriptive counts only
  • The user wants vocabulary normalisation (ATC, ICD, SNOMED, HGNC) — out of scope

Why This Exists

  • Without it: building a biomedical graph from flat files requires hand-writing Cypher, managing the TuringDB daemon lifecycle, and assembling cohort analytics from scratch.
  • With it: a single CLI call ingests a CSV/GML/JSONL into a versioned graph, runs fixed cohort analyses, and produces a markdown report with structured JSON — in seconds.
  • Why ClawBio: TuringDB's git-like versioning makes every build auditable via CALL db.history(). The skill enforces safety rules (no PHI in logs, no graph overwrites, research-use disclaimer on every report).

Core Capabilities

  1. Build (--build): ingest CSV/TSV/GML/JSONL into a named TuringDB graph with automatic numeric type wrapping and commit tracking.
  2. Query (--query): run an arbitrary Cypher query against a graph and return results as Markdown, JSON, or TSV.
  3. Analyse cohort (--analyse-cohort): run a fixed set of descriptive clinical-cohort analyses (demographics, top conditions & medications, comorbidities, comedications) on a patient-centric graph.
  4. Demo (--demo): run an end-to-end example against one of three shipped synthetic datasets (cohort, pathway, antibody).

Scope

One skill, four operations. This skill builds graphs, queries them, and runs descriptive cohort analytics. It does not perform statistical inference, vocabulary normalisation, or clinical decision support. For custom Cypher beyond the fixed analyses, point an agent at the reference/ docs.

Input Formats

Format Extension Required Flags Notes
CSV .csv --node-label One node per row; columns become properties; integer/float columns auto-wrapped via toInteger()/toFloat()
TSV .tsv --node-label Treated as CSV with tab separator
GML .gml All nodes become GMLNode, all edges GMLEdge, all properties strings. Properties stored with type suffix (e.g. displayName (String))
JSONL .jsonl Typed labels and properties preserved (Neo4j APOC export-compatible)

Workflow

When the user asks to build and analyse a graph:

  1. Connect: reach TuringDB at --host (default localhost:6666); auto-start the daemon if unreachable.
  2. Ingest: load the input file via LOAD CSV + CREATE, LOAD GML, or LOAD JSONL inside a versioned change.
  3. Commit: submit the change and record the commit hash for audit.
  4. Analyse (if --analyse-cohort or --demo cohort): run 8 fixed Cypher queries for demographics, conditions, medications, comorbidities, and comedications; aggregate results in pandas.
  5. Report: write report.md + summary.json to the output directory. Every report ends with the ClawBio research disclaimer.

CLI Reference

Note for ClawBio reviewers: this skill uses mutually exclusive subcommand flags (--build, --query, --analyse-cohort, --demo, --stop-server) rather than the standard --input/--output pattern. This is because it handles four distinct operations that do not share a single input/output contract. --out serves the role of --output.

# Build a graph from CSV
python skills/turingdb-graph/turingdb_graph.py \
  --build --input data.csv --graph my_graph --node-label PatientRow \
  --out /tmp/build-output

# Build from GML
python skills/turingdb-graph/turingdb_graph.py \
  --build --input pathway.gml --graph my_pathway --out /tmp/build-output

# Run a Cypher query
python skills/turingdb-graph/turingdb_graph.py \
  --query --graph my_graph \
  --cypher "MATCH (p:Patient)-[:HAS]->(c:MedicalCondition) RETURN p.displayName, c.displayName LIMIT 10" \
  --out /tmp/query-output

# Analyse a patient cohort
python skills/turingdb-graph/turingdb_graph.py \
  --analyse-cohort --graph my_graph --top-n 10 --out /tmp/analysis-output

# Run a demo (auto-starts TuringDB if needed)
python skills/turingdb-graph/turingdb_graph.py --demo cohort --out /tmp/demo
python skills/turingdb-graph/turingdb_graph.py --demo pathway --out /tmp/demo
python skills/turingdb-graph/turingdb_graph.py --demo antibody --out /tmp/demo

# Stop the TuringDB daemon
python skills/turingdb-graph/turingdb_graph.py --stop-server

Global flags

Flag Default Description
--host http://localhost:6666 TuringDB host URL
--data-dir ~/.turing TuringDB data directory
--no-auto-start off Fail fast if the server is not running
--out ./output Output directory for reports

Demo

python skills/turingdb-graph/turingdb_graph.py --demo cohort --out /tmp/demo

Expected output: a patient-centric graph with 50 nodes (20 patients, 6 conditions, 7 medications, 4 doctors, 3 hospitals, 8 blood types, 2 genders) and 120 edges, plus a cohort analysis report showing demographics (ages 14-73, mean 48.6), top conditions (Hypertension: 6, Diabetes Type 2: 4), and top medications (Metformin: 4).

All three demos (cohort, pathway, antibody) use synthetic data with no PHI.

Example Queries

  • "Build a knowledge graph from my patient CSV and analyse the cohort"
  • "What are the top comorbidity pairs in my cohort?"
  • "Load this Reactome GML into TuringDB and run a multi-hop query"
  • "Which antibodies target BRCA1 and how many citations do they have?"
  • "Run the TuringDB cohort demo and show me the report"

Example Output

# Cohort analysis: `demo_cohort`

- **Patients**: 20
- **Ages** (n=20): min 14, max 73, mean 48.6, median 51.0
- **Under 18**: 3
- **Over 65**: 6

## Top 10 conditions

| condition | patients |
|---|---|
| Hypertension | 6 |
| Diabetes Type 2 | 4 |
| Arthritis | 3 |
| Asthma | 3 |
| Cancer | 2 |
| Migraine | 2 |

---

*ClawBio is a research and educational tool. Not a medical device.
This output must not be used for clinical decision-making.*

Output Structure

output_directory/
├── report.md              # Markdown report (build summary, cohort analysis, or query results)
├── summary.json           # Structured JSON (counts, stats, query metadata)
├── result.json            # Query results as JSON (--query only)
├── result.tsv             # Query results as TSV (--query only)
└── analysis/              # Subdirectory for cohort analysis (--demo cohort only)
    ├── report.md
    └── summary.json

Algorithm / Methodology

Cohort analyses

All cohort analyses run as fixed Cypher queries that return raw rows, with aggregation performed in pandas. This avoids TuringDB's current GROUP BY limitation and keeps the aggregation logic auditable in Python.

  1. Patient demographics: count, age min/max/mean/median via pd.to_numeric. Missing ages excluded, not imputed.
  2. Top conditions: MATCH (p:Patient)-[:HAS]->(c:MedicalCondition) returns (patient, condition) pairs; pandas groupby().nunique() counts distinct patients per condition.
  3. Top medications: same pattern via :TOOK_MEDICATION edges.
  4. Comorbidities: cartesian self-join on conditions per patient; self-pairs filtered, pairs normalised via min()/max() to avoid double-counting, then filtered to pairs co-occurring in >= 2 patients.
  5. Comedications: same pattern on medications.
  6. Junior/senior split: WHERE p.age < 18 and WHERE p.age > 65.

CSV type inference

LOAD CSV values arrive as strings. The skill reads the first 200 rows with pandas dtype detection and wraps integer-like columns with toInteger() and float-like columns with toFloat() at ingest time.

GML property name convention

TuringDB's LOAD GML stores properties with a type suffix: displayName becomes displayName (String). Access via backtick-escaped Cypher: n.`displayName (String)`.

Dependencies

Required:

  • turingdb >= 1.29; graph database engine (includes native daemon binary)
  • pandas >= 2.0; data manipulation and cohort aggregation
  • tabulate >= 0.9; DataFrame.to_markdown() rendering

Optional (HTTP endpoint only):

  • fastapi >= 0.110; REST API wrapper
  • uvicorn >= 0.27; ASGI server
  • pydantic >= 2.0; request validation

Gotchas

  • GML property names have a type suffix. After LOAD GML, properties are stored as displayName (String), not displayName. You must use backtick-escaped access: n.`displayName (String)`. Forgetting this produces "Property type not found" errors.
  • TuringDB does not support string comparison with <. The < operator only works on numeric types. Pair deduplication (e.g. comorbidity pairs) must happen in Python, not in Cypher WHERE clauses.
  • TuringDB's GROUP BY returns incorrect aggregations. RETURN key, count(x) does not group correctly. Always return raw rows and aggregate in pandas with groupby().nunique().
  • LOAD CSV + CREATE does not deduplicate. Each CSV row creates a new node unconditionally. TuringDB has no MERGE. Pre-dedupe in pandas if you need one-node-per-unique-value.
  • Writes outside a change do not persist. Always wrap CREATE/SET in new_change() ... CHANGE SUBMIT. This is the most common mistake when extending the skill.
  • The daemon must match the Python package version. If turingdb was upgraded but an old daemon is still running, LOAD CSV + CREATE and other v1.29 features will fail. Stop the old daemon first: --stop-server.

Safety

  • No patient identifiers in logs or outputs. The skill never echoes raw CSV row content to stdout or to the JSON summary. --query is the exception — it returns the user's own query results verbatim.
  • Synthetic demo data only. All shipped datasets (demo/cohort.csv, demo/pathway.gml, demo/antibody.csv) are synthetic. No real names, no real medical records, no identifiable demographics.
  • Research-use disclaimer. Every markdown report ends with: "ClawBio is a research and educational tool. Not a medical device. This output must not be used for clinical decision-making."
  • --build is additive, not destructive. Refuses to overwrite an existing graph. Pass a new --graph name or drop the existing one manually.
  • --query is for trusted operators. It executes arbitrary Cypher. Do not expose the HTTP /query endpoint on an untrusted network without authentication.
  • No clinical recommendations. The cohort analyser reports observed co-occurrence patterns — it does not label any pair as a contraindication, interaction, or recommendation.
  • Local-first. All data stays on the local machine. No cloud uploads.

Domain Decisions

Graph modelling conventions

  • Node labels: PascalCase (Patient, MedicalCondition, BloodType).
  • Edge types: UPPER_SNAKE_CASE (HAS, TOOK_MEDICATION, IS_TREATED_BY).
  • Property keys: camelCase (displayName, pubmedId).

Versioning

Every --build run executes inside a fresh TuringDB change. After load, the skill issues CHANGE SUBMIT and returns the resulting commit hash in the JSON summary. This makes every build auditable via CALL db.history().

Indexing

The skill does not create indexes automatically. Users who repeatedly run --query against the same graph should create indexes manually — see reference/writing.md.

Agent Boundary

In scope

  • Building a TuringDB graph from CSV/TSV/GML/JSONL via --build.
  • Running arbitrary Cypher via --query.
  • Running fixed cohort analyses via --analyse-cohort.
  • Auto-starting a local TuringDB daemon.
  • Exposing operations via HTTP (http_server.py).

Out of scope

  • Inferring a biomedical schema from unstructured CSV.
  • Deduplicating or merging nodes on ingest.
  • Vocabulary normalisation (ATC, ICD, SNOMED, HGNC).
  • Statistical inference (p-values, odds ratios, survival curves, enrichment tests).
  • Embedding generation or vector search.
  • Clinical decision support.

Agent role

The agent (LLM) dispatches this skill and interprets its outputs. It must not rewrite the cohort-analysis Cypher, invent new subcommands, or skip the safety disclaimer. For custom Cypher, point the agent at reference/querying.md, reference/writing.md, and reference/biomedical.md.

Integration with Bio Orchestrator

Trigger conditions: the orchestrator routes here when:

  • The user mentions "knowledge graph", "graph database", "Cypher", or "TuringDB"
  • The user provides a CSV/GML/JSONL and asks to build or query a graph
  • The user asks for cohort-level descriptive analytics (top conditions, comorbidities)

Chaining partners:

  • rnaseq-de: DE results (gene lists) can be loaded as JSONL nodes for pathway enrichment queries
  • pubmed-summariser: antibody graph query results can feed into literature searches
  • clinical-variant-reporter: variant annotations could be loaded as graph nodes for network analysis

Maintenance

  • Review cadence: re-evaluate when TuringDB releases a new major version (GROUP BY and string comparison support may change the aggregation strategy).
  • Staleness signals: new TuringDB release that changes LOAD GML property naming, or adds native MERGE/GROUP BY support.
  • Deprecation: if TuringDB is discontinued or the Cypher dialect diverges significantly from openCypher.

Citations

  • TuringDB; columnar graph database with git-like versioning
  • openCypher; query language specification that TuringDB implements a subset of