Serializer & Relationship Resolutionο
This module provides the internal machinery for resolving mmCIF dictionary relationships and building nested JSON structures.
Cache Managementο
- class sloth.mmcif.serializer.CacheManager[source]ο
Bases:
objectUnified cache manager that combines global in-memory caching with optional disk persistence.
Dictionary Parsingο
Mapping Generationο
- class sloth.mmcif.serializer.MappingGenerator[source]ο
Bases:
objectGenerates mapping rules from mmCIF dictionary metadata
- __init__(dict_parser, cache_manager, quiet=False)[source]ο
- Parameters:
dict_parser (DictionaryParser)
cache_manager (CacheManager)
quiet (bool)
Relationship Resolutionο
- class sloth.mmcif.serializer.RelationshipResolver[source]ο
Bases:
objectResolves entity relationships for nested JSON output from mmCIF data
- __init__(mapping_generator)[source]ο
- Parameters:
mapping_generator (MappingGenerator)
- class sloth.mmcif.serializer.RelationshipMetadata[source]ο
Bases:
objectFormal relationship metadata extracted from dictionary
Ownership Analysisο
- class sloth.mmcif.serializer.OwnershipAnalyzer[source]ο
Bases:
objectAnalyzes relationships to determine ownership using structural algorithms.
Rule Hierarchy (applied in order): 1. PK extension (CORE STRUCTURAL - child PK extends parent PK) 2. Single-FK child (CORE STRUCTURAL - detail table with one FK) 3. Strong FK dependency (STRUCTURAL/SEMANTIC - mandatory FK + name tokens) 4. Explicit constraint type (dictionary metadata)
- __init__(mapping_generator)[source]ο
- Parameters:
mapping_generator (MappingGenerator)