Back to prompt library
Build a Corporate Sanctions Contagion and Lineage Graph Visualizer — implementation
Linked challenge: Build a Corporate Sanctions Contagion and Lineage Graph Visualizer
Prompt source
implementation84 lines11 sectionsNo variables1 code block
## Build
Trace corporate restructuring events using GLEIF relationship records and screen historical entities against yente sanctions data. Map merger and spin-off events to detect inherited sanctions risk.
## User
Corporate entity resolution officer
## Workflow
1. Ingest legal entity relationship records detailing parent, successor, and predecessor associations from GLEIF structures.
2. Reconstruct the chronological restructuring DAG encompassing corporate acquisitions, spin-offs, and absorbed entities.
3. Evaluate sanctions list records against all historical corporate nodes to identify inherited risk.
4. Produce an audit lineage report mapping sanctions contagion across corporate successor transitions.
## Interface
Interactive timeline and graph visualizer displaying corporate lineage transitions, split events, and historical sanctions matches.
## Data
Construct a mock dataset of 40 legal entities undergoing mergers and carve-outs using simplified GLEIF relationship schema records.
Starter examples below are synthetic. They are not downloaded records.
## Source
[GLEIF API](https://www.gleif.org/en/lei-data/gleif-api)
Leverages GLEIF corporate structure records capturing parent and child relationships as described in source excerpt 0.
## Tools
langgraph, networkx, fastapi.
LangGraph manages stateful traversal and cycle detection across historical corporate merger and split graphs.
Lightweight local model (Ollama or hosted API) to summarize complex lineage paths into human-readable briefs.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Successfully identifies all predecessor legal entities across a minimum 3-tier merger chain.
- Detects corporate spin-offs where legacy obligations attach to newly created entities.
- Exports a validated JSON lineage graph with timestamps for each restructuring action.
## Starter Examples
```json
[
{
"input": {
"target_lei": "984500A1B2C3D4E5F677",
"relationship_records": [
{
"relationship_type": "IS_SUCCESSOR_TO",
"predecessor": "11223344556677889900",
"successor": "984500A1B2C3D4E5F677",
"effective_date": "2022-04-01"
}
]
},
"expected_output": {
"root_lei": "984500A1B2C3D4E5F677",
"predecessors": [
"11223344556677889900"
],
"lineage_depth": 1,
"has_split_events": false
}
},
{
"input": {
"target_lei": "55667788990011223344",
"relationship_records": [
{
"relationship_type": "SPUN_OFF_FROM",
"predecessor": "99887766554433221100",
"successor": "55667788990011223344",
"effective_date": "2023-01-15"
},
{
"relationship_type": "ACQUIRED_ASSETS_FROM",
"predecessor": "22334455667788990011",
"successor": "55667788990011223344",
"effective_date": "2023-06-10"
}
]
},
"expected_output": {
"root_lei": "55667788990011223344",
"predecessors": [
"99887766554433221100",
"22334455667788990011"
],
"lineage_depth": 1,
"has_split_events": true
}
}
]
```
## Safety
Performs analytical historical lineage audits; does not alter legal corporate records or trigger regulatory enforcement.
Use mock external writes. Require human review before any real deployment.