ontology-spider
Query, traverse, validate, and explain Brain Harness knowledge vaults and domain ontologies using formal logic reasoning. Do not use for fuzzy text search or ungrounded vector clustering.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ontology-spider
- description
- Query, traverse, validate, and explain Brain Harness knowledge vaults and domain ontologies using formal logic reasoning. Do not use for fuzzy text search or ungrounded vector clustering.
02 资源文件 1
- 参考文档CARD.md2.2 KB
03 SKILL.md 正文
Ontology-Spider Skill
The Ontology-Spider skill equips AI agents with formal logic reasoning over Brain Harness vaults, code architectures, and domain models. Unlike unstructured vector search or fuzzy heuristic lookup, Ontology-Spider provides deterministic graph traversals, inheritance reasoning, and mathematically provable explanations.
See CARD.md for the companion summary card, stage progression table, and mandatory invariants checklist.
When to Use This Skill
Activate this skill whenever the task involves:
- Multi-Hop Dependency Tracing: Finding all transitive dependencies or impact paths across modules, specs, or tasks (e.g.
query transitive depends_on from <module>). - Taxonomic & Inheritance Navigation: Querying class hierarchies, generalized concepts, or instance types (e.g.
query ancestors of <class>). - Attribute-Constrained Recommendations: Finding optimal candidate components or assets matching specific parameter constraints (e.g.
query recommend drone where payload=5). - Formal Proof Tracing & Explanations: Verifying exactly why a relation or dependency exists, including which base assertions fired, which inference rules ran, and what graph path was taken.
- Architectural & Schema Integrity Validation: Detecting circular dependencies (
acyclic), domain/range typing mismatches, and mutually exclusive conflicts (disjoint_with).
Query Syntax Reference
Queries follow the controlled .dialog language syntax:
| Query Type | Syntax | Description |
|---|---|---|
| Fact Lookup | query what is <entity>? |
Retrieves all incoming and outgoing relations for <entity>. |
| Transitive Traversal | query transitive <pred> from <entity> |
Follows transitive closure of <pred> (e.g. depends_on, subclass_of). |
| Ancestors | query ancestors of <entity> |
Traverses combined instance_of and subclass_of taxonomy upward. |
| Recommendation | query recommend <class> where <k>=<v> |
Matches instances of <class> conforming to key-value attribute filters. |
| Pattern Triple | query <subj> <pred> ? |
Matches facts satisfying the triple pattern. |
| Proof Explanation | explain or query ... explain |
Emits full rule trace, graph path, and assertion provenance for preceding query. |
Python API Usage in Brain Harness
from plugins.memory_and_epistemics.ontology_spider.service import OntologySpiderService
service = OntologySpiderService()
# 1. Execute a transitive dependency query over a vault export
result = service.query("vault_export.json", "query transitive depends_on from my_service")
print("Dependencies:", [a["value"] for a in result["answers"]])
# 2. Inspect the proof explanation
for ans in result["answers"]:
print(f"Node: {ans['value']}, Path: {' -> '.join(ans['path'])}, Rules: {ans['rules_fired']}")
# 3. Validate structural schema integrity
violations = service.validate("vault_export.json")
if violations:
print(f"Found {len(violations)} schema violations!")
Boundaries & Constraints
- Trusted Input: Operates over structured JSON vault exports or on-disk
metadata.jsonitems. Unstructured markdown bodies remain referenced by URI. - Controlled Language: Use the exact grammar specified above; do not construct free-form natural language query strings.
- Performance: Powered by SWI-Prolog with automatic bounded pure-Python degraded fallback when SWI-Prolog is not present on the host.
Anti-Patterns
- Free-Form Prompt Injection — Passing unstructured conversational queries instead of controlled
.dialoggrammar. - Ungrounded Vector Approximation — Using fuzzy semantic embedding searches when exact logical closures are required.
- Ignoring Inference Fallback — Assuming SWI-Prolog binary is universally installed without handling the pure-Python reasoner.
- Unverified Traversal Claims — Accepting transitive deductions without inspecting
pathandrules_firedprovenance. - Unbounded Cycle Traversal — Running transitive queries without validating acyclicity constraints first.
04 同仓库更多 Skills
ui-behavior-primitive-architect
Architect, audit, and verify zero-dependency headless UI behavior primitives, WebMCP agent bridges, WAI-ARIA/SSR/RTL tri-modal checks, and framework expert routing. Do not use for static CSS theme styling or backend database migrations.
trustgraph-ontology-governor
Govern knowledge graphs, SHACL-AF triple policies, OntologyRAG subclass validation, PROV-O dual named graphs, and Laya entropy decision scoring. Do not use for relational SQL queries or generic web scraping.
shim-harness-governor
Govern universal CLI agent loops, 4-tier tool permissions, ancestor-symlink workspace sandboxes, deterministic-first command routing, collision-safe MCP namespacing, and layered skill loading. Do not use for static UI styling or external SQL analytics.
graphiti-zep-memory-governor
Govern bi-temporal knowledge graphs with Graphiti future-edge clamping, MinHash/LSH entity dedup, RRF/MMR reranking, and Zep typed ontologies. Do not use for static SQL joins or generic web crawling.
agora-mcp-workbench-architect
Architect, audit, and orchestrate Agora Workbench MCP servers, loopback sidecars, unified state graphs, gateway/dispatcher connectors, and policy-enforced data lakes. Do not use for static frontend CSS styling or non-MCP desktop GUI automation.
skill-eval-assurance-runner
Evaluate and assure agent skills using small-N Wilson confidence intervals, unbiased pass^k reliability, deterministic trajectory graders, preflight boundary honesty, and sealed digest verification. Do not use for subjective prose review or unconstrained production deployment.