ExposoGraph.grounding¶
Grounding and graph-preparation helpers used to reconcile free-text or seeded content with canonical reference entities.
Grounding helpers for reconciling nodes and graphs to canonical references.
This module adds a lightweight normalization layer on top of the existing knowledge-graph schema. It does not rewrite node IDs; instead it annotates nodes and edges with canonical metadata so later merge/validation stages can decide whether to keep, normalize, or reject exploratory content.
- class ExposoGraph.grounding.GroundingMatch(canonical_id, canonical_label, canonical_namespace, match_status, extra_fields=<factory>)[source]¶
Canonical match metadata for a grounded term.
- Parameters:
- match_status: MatchStatus¶
- ExposoGraph.grounding.normalize_grounding_key(value)[source]¶
Normalize a label or identifier for fuzzy exact-match grounding.
- ExposoGraph.grounding.build_graph_grounding_index(graph, *, namespace)[source]¶
Build a normalized lookup index from a reference KnowledgeGraph.
- Parameters:
graph (KnowledgeGraph)
namespace (str)
- Return type:
- ExposoGraph.grounding.build_iarc_grounding_index(classifier=None)[source]¶
Build a normalized lookup index from the bundled IARC classifier data.
- Parameters:
classifier (IARCClassifier | None)
- Return type:
- ExposoGraph.grounding.build_default_grounding_index(*, reference_graphs=None, classifier=None)[source]¶
Build the default grounding index from reference panels plus IARC.
- Parameters:
reference_graphs (Sequence[tuple[str, KnowledgeGraph]] | None)
classifier (IARCClassifier | None)
- Return type:
- ExposoGraph.grounding.ground_node(node, *, grounding_index=None, reference_graphs=None, classifier=None)[source]¶
Return a grounded copy of node using built-in or supplied references.
- Parameters:
node (Node)
grounding_index (dict[str, GroundingMatch] | None)
reference_graphs (Sequence[tuple[str, KnowledgeGraph]] | None)
classifier (IARCClassifier | None)
- Return type:
- ExposoGraph.grounding.ground_knowledge_graph(graph, *, grounding_index=None, reference_graphs=None, classifier=None)[source]¶
Ground all nodes in graph and derive edge grounding status.
- Parameters:
graph (KnowledgeGraph)
grounding_index (dict[str, GroundingMatch] | None)
reference_graphs (Sequence[tuple[str, KnowledgeGraph]] | None)
classifier (IARCClassifier | None)
- Return type:
- ExposoGraph.grounding.prepare_knowledge_graph(graph, *, mode=GraphMode.EXPLORATORY, grounding_index=None, reference_graphs=None, classifier=None)[source]¶
Ground graph and optionally filter it for strict-mode workflows.
- Parameters:
graph (KnowledgeGraph)
grounding_index (dict[str, GroundingMatch] | None)
reference_graphs (Sequence[tuple[str, KnowledgeGraph]] | None)
classifier (IARCClassifier | None)
- Return type: