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'
class ExposoGraph.models.RecordOrigin(value)[source]
IMPORTED = 'imported'
SEEDED = 'seeded'
USER = 'user'
LLM = 'llm'
class ExposoGraph.models.MatchStatus(value)[source]
UNKNOWN = 'unknown'
CANONICAL = 'canonical'
ALIAS = 'alias'
UNMATCHED = 'unmatched'
CUSTOM = 'custom'

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:
  • source_db (str | None)

  • record_id (str | None)

  • evidence (str | None)

  • pmid (str | None)

  • tissue (str | None)

  • citation (str | None)

  • url (str | None)

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:
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:
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").

Parameters:

label (str)

Return type:

str

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:
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ExposoGraph.models.KnowledgeGraph(*, nodes=<factory>, edges=<factory>)[source]

Bases: BaseModel

Parameters:
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].