Skip to content

About

An automated ontology manager for Obsidian.md. Enforces strict file naming conventions based on metadata relationships (Owner/Supers/Parts) and automatically refactors Wikilinks to maintain referential integrity

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Obsidian Ontology Manager

Obsidian Ontology Manager is a Python automation tool for any who maintain strict, axiomatic knowledge bases.

It treats Markdown notes as objects in a compiled graph. Instead of manually naming files, this script generates filenames based on their metadata and relationship to other nodes (Owners, Superclasses, Parts). When a file's "Recursive Title" changes, the script renames the file and automatically refactors every Wikilink in the vault to maintain integrity.

🚀 Key Features

  • Logic-Based Naming: Filenames are not static; they are compiled from NamingTags that traverse the relationship graph.
  • Recursive Pathing: A file can name itself by fetching data from its Owner, its Owner's Super, or any arbitrary depth in the graph (e.g., OS1N).
  • Referential Integrity: Renames are propagated globally. If Note A is renamed to Note B, all instances of [[Note A]] in your vault are updated to [[Note B]].
  • Inheritance: Nodes without explicit Owners can inherit ownership from their Supers or PartOf parents.
  • Orphan Detection: Generates a dashboard (Owner.md) listing nodes disconnected from the graph.

📄 Metadata Schema

The script relies on YAML frontmatter. If no NamingTags are present, the file simply uses its Title attribute (Default Behavior).

---
attributes:
  Title: "Absciss"
  Owner: "[[Ordered Pair(Set)]]" 
  Supers:
    - "[[Relation (Set)]]"
  NamingTags:                # Logic to construct the full filename
    - "-1ON" 
---

This is how i like to distinguish them

  1. Title: what ever word you want to be as the ground or base for the note final title
  2. Owner: a link to another note O, Hypothetcly if the current note would dissappear from existence Note O would not get effected. Ex: (Owner - Owned) (Human - Human Body) (Ordered Pair - Absciss) (Light - Ligth Reflection Phenomenon)
  3. PartOf: a link to another note P, Hypothetcly if the current note would dissappear from existence Note P would have no meaning. Ex: (Emerging - Part) (Human Body - Hand) (Proper Class - Set) (Atom - Electron)
  4. Supers: a list of links, that the current note is inhiriting. (Child - Parent) (Flat Bone - Rib) (Relation - Set) (Elementry Boson - Photon)

🧠 The Naming Logic (NamingTags)

The core engine of this script is the NamingTags parser. It constructs a title by placing segments before (-) or after (+) the file's intrinsic Title.

Syntax

[Sign][Position][Path...][Terminator]

  1. Sign: * -: Prefix (placed before the Title).
    • +: Suffix (placed after the Title).
  2. Position: An integer (1, 2, 3...) determining distance from the center.
    • Note: Position 0 is reserved for the file's own Title.
    • -1 is immediately before the title; -2 is before -1.
  3. Path (Recursive): A chain of steps to find the target node.
    • O : Go to Owner.
    • S + Index: Go to Superclass at specific index (e.g., S0 is first super, S1 is second).
    • P + Index: Go to PartOf at specific index.
    • Chaining: You can chain these. OS1 means "Go to my Owner, then go to their 2nd Super."
  4. Terminator: What data to extract from the target node.
    • N: Name (The target's raw Title attribute).
    • T: RTitle (The target's fully compiled Recursive Title).

Visualizing the Order

If the File Title is [TITLE], the positions fill as follows: ... [-2] [-1] [TITLE] [+1] [+2] ...


🧪 Examples

Example 1: Simple Prefix

  • Title: Tissue
  • Owner: [[Pathophysiology. Body]] (Title: "Body")
  • NamingTag:
    1. -1ON: -1: Prefix, immediate left, O: Go to Owner (Pathophysiology. Body), N: Get Name ("Body").
  • Result: Body Tissue.md

Example: Composition with a title

  • Title: Carpal
  • PartOf: [[Human Wrist(Joint)]] (RTitle: "Human Wrist")
  • Supers: [[Body. Tunnel]] (RTitle: "Body")
  • NamingTags:
    1. -1OT: Prefix (-1), Owner (O), Recursive Title (T) -> "Human"
    2. +1S0T: Suffix (+1), First Super (S0), Recursive Title (T) -> "Body"
  • Result: Human Carpal Tunnel.md Note: Since their is no owner the owner is taken from the first PartOf

Example: Composition without a title

  • Owner: [[Taxonomy. Human]] (RTitle: "Human")
  • Supers: [[Pathophysiology. Body]] (RTitle: "Body")
  • NamingTags:
    1. -1OT: Prefix (-1), Owner (O), Recursive Title (T) -> "Human"
    2. +1S0T: Suffix (+1), First Super (S0), Recursive Title (T) -> "Body"
  • Result: Human Body.md

🛠️ Installation & Usage

  1. Dependencies:
    pip install python-frontmatter
  2. Setup: Place .py in the root of your Obsidian vault.
  3. Run:
    python .py

⚠️ Warning: This script performs destructive actions (renaming files and rewriting content). Always backup your vault before running.

About

An automated ontology manager for Obsidian.md. Enforces strict file naming conventions based on metadata relationships (Owner/Supers/Parts) and automatically refactors Wikilinks to maintain referential integrity

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages