Use risk to order the review queue
Confirm the actual risk distribution, prioritize medium orders, and avoid treating the score as an automatic rejection.
Question for this chapter
Which of the 12 orders should a person review first?
Try it
Open the risk_assessment pipeline under refund_ops and select Run. The score combines past refund
count, order amount, and customer tier on a 0.0–1.0 scale.
- Below 0.3:
low - 0.3 through 0.6:
medium - Above 0.6:
high
Success looks like this
risk_assessed_orders contains 12 rows.
| Risk level | Count | Review action |
|---|---|---|
high | 0 | No current orders |
medium | 5 | Priority review queue |
low | 7 | Standard review queue |
Inspect the five highest scores.
| Order | Score | Level |
|---|---|---|
| ORD-2025-0010 | 0.600 | medium |
| ORD-2025-0002 | 0.560 | medium |
| ORD-2025-0001 | 0.440 | medium |
| ORD-2025-0004 | 0.340 | medium |
| ORD-2025-0003 | 0.330 | medium |
The maximum 0.600 is still not high; the code requires a value above 0.6.

Trace one order relationship
Run ontology_materialization. It produces 10 customer rows, 12 order rows, 6 refund-request rows
connected to current orders, and 18 relation rows. Run this query in Graph Explorer:
MATCH path=(r:refund_request)-[:requested_for]->(o:sales_order)-[:placed_by]->(c:customer)
WHERE o.order_id = 'ORD-2025-0001'
RETURN path
The result should show RF-2025-005 → ORD-2025-0001 → CUS-001, placing risk and customer context
around the same order.
Next decision
You have five orders to review first. Next, retrieve policy for a refund reason instead of deciding from the risk score alone.