c24165b8bc
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5.7 KiB
5.7 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-ontology-engineering | Ontology Engineering | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Ontology Engineering
도메인의 개념·관계·제약을 형식 모델(OWL/RDF)로 표현하는 엔지니어링. 2025년 KG-based RAG로 재부상.
핵심
구성요소
- Class (개념):
Person,Drug,Symptom. - Individual (인스턴스):
:John a :Person. - ObjectProperty / DataProperty:
hasParent,hasAge. - Axioms: subClassOf, equivalentClass, disjointWith, cardinality.
- Restrictions:
someValuesFrom,allValuesFrom,hasValue.
표현 언어
- RDF / RDFS: 그래프 데이터 모델 + 기본 어휘.
- OWL 2 DL: description logic, decidable. 추론기(reasoner) 지원.
- OWL 2 EL/QL/RL: 큰 온톨로지 / 쿼리 / 룰 최적화 프로파일.
- SHACL: shape constraints, validation.
- SPARQL 1.1: 그래프 쿼리.
방법론
- METHONTOLOGY: 명세 → 개념화 → 형식화 → 구현 → 평가.
- NeOn: re-engineering, alignment, modular ontology.
- Ontology Development 101 (Stanford): iterative + competency questions.
- OBO Foundry: 생명과학 표준 (orthogonality, FAIR).
도구
- Protégé: 데스크톱 OWL 에디터, plugin (HermiT, ELK reasoner).
- WebProtégé: 협업.
- owlready2 / rdflib (Python), Apache Jena (Java).
- GraphDB / Stardog / Neo4j+n10s: triple/labeled-property store.
모던 응용 (2025-2026)
- KG-based RAG: LLM이 ontology 기반 KG를 조회 (vs vector-only RAG). 정확도/추적성 향상.
- GraphRAG (Microsoft): 커뮤니티 요약 + 엔티티 그래프.
- NL2SPARQL: LLM이 자연어 → SPARQL 변환.
- Ontology-driven 분류/필터링: 문서를 도메인 개념으로 태깅 → relevancy filtering.
💻 패턴
Turtle (TTL) 도메인 모델
@prefix : <http://ex.com/med#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:Drug a owl:Class .
:Antibiotic a owl:Class ; rdfs:subClassOf :Drug .
:treats a owl:ObjectProperty ; rdfs:domain :Drug ; rdfs:range :Disease .
:Amoxicillin a :Antibiotic ; :treats :StrepThroat .
owlready2 — 동적 클래스 정의 + 추론
from owlready2 import *
onto = get_ontology("http://ex.com/med.owl")
with onto:
class Drug(Thing): pass
class Antibiotic(Drug): pass
class treats(ObjectProperty): pass
class Amoxicillin(Antibiotic): pass
sync_reasoner() # HermiT 호출, 클래스 계층 추론
SPARQL 쿼리 (rdflib)
from rdflib import Graph
g = Graph().parse("med.ttl", format="turtle")
q = """
PREFIX : <http://ex.com/med#>
SELECT ?drug WHERE {
?drug a/rdfs:subClassOf* :Antibiotic ;
:treats :StrepThroat .
}
"""
for row in g.query(q): print(row.drug)
Competency questions → 평가
COMPETENCY_QUESTIONS = [
"What antibiotics treat strep throat?",
"Which drugs interact with warfarin?",
]
def evaluate_ontology(graph, questions):
return {q: bool(graph.query(translate_to_sparql(q))) for q in questions}
KG-based RAG (LLM + ontology lookup)
def kg_rag(question: str, llm, kg) -> str:
sparql = llm.generate(f"Translate to SPARQL using ontology schema:\n{kg.schema}\nQ: {question}")
facts = kg.query(sparql)
return llm.generate(f"Answer using facts:\n{facts}\nQ: {question}")
Ontology-driven relevancy filter
def filter_docs_by_ontology(docs: list[str], target_concept: str, kg) -> list[str]:
# tag each doc with concepts via NER + ontology mapping
relevant_concepts = set(kg.descendants_of(target_concept))
return [d for d in docs
if relevant_concepts & extract_concepts(d, kg)]
결정 기준
| 상황 | 권장 |
|---|---|
| 작은 schema, 빠른 ETL | RDFS + SHACL |
| 추론 필요 (subsumption) | OWL 2 EL (확장성) |
| 복잡 제약, 의료/법률 | OWL 2 DL + HermiT |
| LPG (속성 그래프) 워크로드 | Neo4j + neosemantics |
| LLM 통합 RAG | OWL 2 EL + GraphDB + NL2SPARQL |
| 협업 편집 | WebProtégé |
기본값: OWL 2 EL + Protégé + GraphDB + competency-question 기반 평가.
🔗 Graph
- 부모: Knowledge Representation, Semantic-Web
- 변형: Knowledge-Graphs
- Adjacent: OWL, RDF, GraphRAG
🤖 LLM 활용
- 언제: NL→SPARQL 변환, 클래스 라벨링/정의 초안, axiom 검토 페어, ontology alignment 후보 제안, KG-RAG 답변 합성.
- 언제 X: critical 도메인 axiom 단독 결정 (전문가 검토 필수), reasoner를 LLM으로 대체 (decidability 보장 X).
❌ 안티패턴
- 평면 taxonomy를 ontology로 부르기 (axiom/속성 없음).
- 클래스를 인스턴스로 사용 (metamodeling 혼동).
- 모든 것을 owl:Thing 직속 (계층 부재).
- Reasoner 없이 disjointWith 남발 (불일치 탐지 안됨).
- Competency question 없이 모델 시작 → scope creep.
- Ontology를 LLM 컨텍스트에 raw로 주입 (token 폭발) — schema-only로 축약.
🧪 검증 / 중복
- 검증: HermiT/ELK consistency check, SHACL validation, competency Q coverage, FAIR 점수.
- 중복: Ontology-Engineering, Ontology-Driven-Relevancy-Filtering → 본 문서로 redirect.
🕓 Changelog
- 2026-05-10: 표준 포맷, KG-based RAG / GraphRAG / NL2SPARQL 추가, redirect 통합.