cognitive/docs/guides/obsidian/linking_patterns.md
Daniel Ari Friedman 59a4bfb111 Updates
2025-02-12 10:51:38 -08:00

4.1 KiB

title type status created tags semantic_relations
Obsidian Linking Patterns guide stable 2024-02-12
obsidian
linking
organization
type links
implements
../documentation_standards
type links
relates
obsidian_usage
folder_structure

Obsidian Linking Patterns

  1. Direct Links

    [[filename]]
    
  2. Aliased Links

    [[filename|Display Text]]
    
  3. Section Links

    [[filename#Section Name]]
    
  4. Block Links

    [[filename#^block-id]]
    
  1. Relative Path Links

    [[../parent_folder/filename]]
    [[./current_folder/filename]]
    
  2. Multi-section Links

    [[filename#section1#subsection]]
    
  3. Embedded Links

    ![[filename]]
    ![[filename#section]]
    

Semantic Grouping

## Theory
- [[active_inference|Active Inference Theory]]
- [[free_energy|Free Energy Principle]]

## Implementation
- [[active_inference_impl|Implementation Details]]
- [[free_energy_calc|Calculations]]

Hierarchical Organization

## Core Concepts
- [[parent_concept]]
  - [[child_concept_1]]
  - [[child_concept_2]]
    - [[grandchild_1]]
    - [[grandchild_2]]
## Concept Definition
- Base: [[concept_name]]
- Theory: [[concept_theory]]
- Implementation: [[concept_implementation]]
- Examples: [[concept_examples]]
## Documentation Structure
- Guide: [[user_guide]]
- API: [[api_documentation]]
- Examples: [[usage_examples]]
- Tests: [[test_documentation]]
## Code References
- Source: [[source_file]]
- Tests: [[test_file]]
- Examples: [[example_file]]
- Benchmarks: [[benchmark_file]]
---
related_concepts:
  - [[concept_a]]
  - [[concept_b]]
dependencies:
  - [[dependency_1]]
  - [[dependency_2]]
implementations:
  - [[impl_1]]
  - [[impl_2]]
---
## Theoretical Links
- [[theory_a]]
- [[theory_b]]

## Implementation Links
- [[impl_x]]
- [[impl_y]]

## Test Links
- [[test_1]]
- [[test_2]]

Best Practices

  1. Use descriptive names
  2. Maintain consistency
  3. Follow naming conventions
  4. Use appropriate aliases
  1. Group related links
  2. Use clear hierarchy
  3. Maintain bidirectional links
  4. Document relationships
  1. Regular validation
  2. Update broken links
  3. Clean unused links
  4. Check consistency

Automation

def validate_links(content: str) -> List[str]:
    """Validate all links in content."""
    pattern = r'\[\[(.*?)\]\]'
    links = re.findall(pattern, content)
    return validate_link_targets(links)
def generate_backlinks(source: str, target: str) -> str:
    """Generate bidirectional links."""
    return f"""
    // In {source}:
    [[{target}]]
    
    // In {target}:
    [[{source}]]
    """

Common Patterns

Theory Documentation

## Theoretical Foundation
- Base Theory: [[base_theory]]
- Extensions: [[theory_extension]]
- Applications: [[theory_application]]

Implementation Documentation

## Implementation Details
- Core: [[core_implementation]]
- Modules: [[module_documentation]]
- Tests: [[test_documentation]]

Research Documentation

## Research Notes
- Papers: [[research_papers]]
- Experiments: [[experiment_notes]]
- Results: [[research_results]]

Graph View

  • Node types
  • Link types
  • Clustering
  • Filtering

Local Graphs

  • Depth settings
  • Node filtering
  • Link filtering
  • Layout options

Troubleshooting

Common Issues

  1. Broken links
  2. Circular references
  3. Ambiguous links
  4. Missing backlinks

Solutions

  1. Regular validation
  2. Clear naming
  3. Proper organization
  4. Consistent patterns