ITADN

P1: onto_segment_retrieve — TBox-slice retrieval for ontology-grounded RAG (SEMANTiCS 2025 GrOWL-RAG)

#34Openfabio-rovai 创建于 2026-05-28
F
fabio-rovaicommented
## Why SEMANTiCS 2025 paper by Schmidt, Rincon-Yanez, Grangel-González, Paschke, Kharlamov — **GrOWL-RAG** (Document-Level Relation Extraction with Ontology-Guided RAG). Argues that **ontology-segment retrieval beats chunk-level retrieval** as the unit of context for LLM-based RE. The retriever returns a minimal TBox slice (the relevant classes + their immediate properties + relevant restrictions) instead of paragraphs of prose. Open Ontologies has `onto_search` (semantic search over class embeddings) and `onto_query` (SPARQL) but no first-class "retrieve the minimal TBox slice relevant to this query" primitive. Adding it makes the MCP-over-IES-RAG demo (case-study #27) much more powerful — Claude can pull the precise slice it needs to reason about a question without the noise of unrelated classes. ## Scope New MCP tool `onto_segment_retrieve(query, granularity, max_classes)`: - **Input:** natural-language query OR a set of seed class IRIs - **`granularity`:** `class_only` (just the matched classes), `class_plus_props` (+ their domain/range properties), `class_plus_props_plus_restrictions` (+ owl:Restriction context), `closed_world_slice` (+ everything reachable within N hops) - **`max_classes`:** budget cap (default 30) - **Server work:** 1. Resolve query → seed class IRIs (via `onto_search` text embedding match if NL, or direct if IRIs) 2. Walk the dependency graph from the seeds according to granularity 3. Return a Turtle slice + metadata (slice_size, hop_distance_max, classes_included) - **Validation:** the returned slice is itself a valid OWL ontology (parses cleanly, no dangling references) Pairs naturally with #onto_extract_scaffold (#28) — that tool's scaffold-fill workflow needs precise TBox context, which is exactly what `onto_segment_retrieve` provides. ## Reference - GrOWL-RAG: SEMANTiCS 2025 / ResearchGate https://www.researchgate.net/publication/395078403_Document-Level_Relation_Extraction_with_Ontology-Guided_RAG ## Priority **P1** — extends the IES-RAG demo (#27) significantly; lightweight implementation reusing existing SPARQL + onto_search.
0 条评论