ExposoGraph.models¶
Pydantic data models for nodes, edges, and the knowledge graph container.
Enums¶
- class ExposoGraph.models.NodeType(value)[source]¶
- CARCINOGEN = 'Carcinogen'¶
- ENZYME = 'Enzyme'¶
- GENE = 'Gene'¶
- METABOLITE = 'Metabolite'¶
- DNA_ADDUCT = 'DNA_Adduct'¶
- PATHWAY = 'Pathway'¶
- TISSUE = 'Tissue'¶
- class ExposoGraph.models.EdgeType(value)[source]¶
- ACTIVATES = 'ACTIVATES'¶
- DETOXIFIES = 'DETOXIFIES'¶
- TRANSPORTS = 'TRANSPORTS'¶
- FORMS_ADDUCT = 'FORMS_ADDUCT'¶
- REPAIRS = 'REPAIRS'¶
- PATHWAY = 'PATHWAY'¶
- EXPRESSED_IN = 'EXPRESSED_IN'¶
- INDUCES = 'INDUCES'¶
- INHIBITS = 'INHIBITS'¶
- ENCODES = 'ENCODES'¶
- CUSTOM = 'CUSTOM'¶
- class ExposoGraph.models.CurationStatus(value)[source]¶
- DRAFT = 'Draft'¶
- IN_REVIEW = 'In Review'¶
- REVIEWED = 'Reviewed'¶
- APPROVED = 'Approved'¶
- REJECTED = 'Rejected'¶
- class ExposoGraph.models.CurationConfidence(value)[source]¶
- LOW = 'Low'¶
- MEDIUM = 'Medium'¶
- HIGH = 'High'¶
Models¶
- class ExposoGraph.models.ProvenanceRecord(*, source_db=None, record_id=None, evidence=None, pmid=None, tissue=None, citation=None, url=None)[source]¶
Bases:
BaseModel- Parameters:
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ExposoGraph.models.CurationRecord(*, status=CurationStatus.DRAFT, confidence=None, curator=None, reviewed_by=None, reviewed_at=None, notes=None)[source]¶
Bases:
BaseModel- Parameters:
status (CurationStatus)
confidence (CurationConfidence | None)
curator (str | None)
reviewed_by (str | None)
reviewed_at (str | None)
notes (str | None)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ExposoGraph.models.Node(*, id, label, type, detail='', group=None, iarc=None, phase=None, role=None, reactivity=None, source_db=None, evidence=None, pmid=None, tissue=None, variant=None, phenotype=None, activity_score=None, tier=None, origin=RecordOrigin.IMPORTED, match_status=MatchStatus.UNKNOWN, canonical_id=None, canonical_label=None, canonical_namespace=None, custom_type=None, provenance=<factory>, curation=None)[source]¶
Bases:
BaseModel- Parameters:
id (str)
label (str)
type (NodeType)
detail (str)
group (str | None)
iarc (str | None)
phase (str | None)
role (str | None)
reactivity (str | None)
source_db (str | None)
evidence (str | None)
pmid (str | None)
tissue (str | None)
variant (str | None)
phenotype (str | None)
activity_score (float | None)
tier (int | None)
origin (RecordOrigin)
match_status (MatchStatus)
canonical_id (str | None)
canonical_label (str | None)
canonical_namespace (str | None)
custom_type (str | None)
provenance (list[ProvenanceRecord])
curation (CurationRecord | None)
- classmethod generate_id(label)[source]¶
Derive a safe node ID from a label.
Simple labels (e.g.
"CYP1A1") pass through unchanged. Labels containing special characters that are stripped during sanitisation get a short hash suffix to avoid collisions (e.g."Benzo[a]pyrene"→"Benzo_a_pyrene_a4f2c1").
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ExposoGraph.models.Edge(*, source, target, type, label=None, carcinogen=None, source_db=None, evidence=None, pmid=None, tissue=None, origin=RecordOrigin.IMPORTED, match_status=MatchStatus.UNKNOWN, canonical_predicate=None, canonical_namespace=None, custom_predicate=None, provenance=<factory>, curation=None)[source]¶
Bases:
BaseModel- Parameters:
source (str)
target (str)
type (EdgeType)
label (str | None)
carcinogen (str | None)
source_db (str | None)
evidence (str | None)
pmid (str | None)
tissue (str | None)
origin (RecordOrigin)
match_status (MatchStatus)
canonical_predicate (str | None)
canonical_namespace (str | None)
custom_predicate (str | None)
provenance (list[ProvenanceRecord])
curation (CurationRecord | None)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].