Graph Databases
Preserve assets with no qualifying inspection
A newly registered pump has no relationships
The required-match report hid P8, which has no completed inspection. Botie needs the asset register to remain the population even when a match is absent.
BOTIE
The inputs we are comparing
Maintenance graph
P8 has only open work
Nodes and properties (6)
- P7 · Asset
- P8 · Asset
- I1 · Inspection
- status: closed
- I2 · Inspection
- status: open
- T1 · Technician
- T2 · Technician
- P7 to I1: HAS_INSPECTION
- P8 to I2: HAS_INSPECTION
- I1 to T1: CARRIED_OUT_BY
- I2 to T2: CARRIED_OUT_BY
Inspect the node and relationship records
{
"nodes": [
{
"id": "P7",
"kind": "Asset"
},
{
"id": "P8",
"kind": "Asset"
},
{
"id": "I1",
"kind": "Inspection",
"status": "closed"
},
{
"id": "I2",
"kind": "Inspection",
"status": "open"
},
{
"id": "T1",
"kind": "Technician"
},
{
"id": "T2",
"kind": "Technician"
}
],
"edges": [
{
"id": "h1",
"source": "P7",
"target": "I1",
"type": "HAS_INSPECTION"
},
{
"id": "h2",
"source": "P8",
"target": "I2",
"type": "HAS_INSPECTION"
},
{
"id": "t1",
"source": "I1",
"target": "T1",
"type": "CARRIED_OUT_BY"
},
{
"id": "t2",
"source": "I2",
"target": "T2",
"type": "CARRIED_OUT_BY"
}
]
}An isolated P9 enters the registry
Nodes and properties (7)
- P7 · Asset
- P8 · Asset
- I1 · Inspection
- status: closed
- I2 · Inspection
- status: open
- T1 · Technician
- T2 · Technician
- P9 · Asset
- P7 to I1: HAS_INSPECTION
- P8 to I2: HAS_INSPECTION
- I1 to T1: CARRIED_OUT_BY
- I2 to T2: CARRIED_OUT_BY
Inspect the node and relationship records
{
"nodes": [
{
"id": "P7",
"kind": "Asset"
},
{
"id": "P8",
"kind": "Asset"
},
{
"id": "I1",
"kind": "Inspection",
"status": "closed"
},
{
"id": "I2",
"kind": "Inspection",
"status": "open"
},
{
"id": "T1",
"kind": "Technician"
},
{
"id": "T2",
"kind": "Technician"
},
{
"id": "P9",
"kind": "Asset"
}
],
"edges": [
{
"id": "h1",
"source": "P7",
"target": "I1",
"type": "HAS_INSPECTION"
},
{
"id": "h2",
"source": "P8",
"target": "I2",
"type": "HAS_INSPECTION"
},
{
"id": "t1",
"source": "I1",
"target": "T1",
"type": "CARRIED_OUT_BY"
},
{
"id": "t2",
"source": "I2",
"target": "T2",
"type": "CARRIED_OUT_BY"
}
]
}Result for p8 has only open work
[
{
"origin": "P7",
"n": 1
},
{
"origin": "P8",
"n": 0
}
]For a list use brackets, such as [2, 4]. For a matrix put each row in brackets. Text answers can stay as text.
A shared inspection counts within each asset
This check uses the pieces from “Preserve an unmatched asset binding”.
BOTIE
- Maintenance graph
Nodes and properties (6)
- R3 · Asset
- R2 · Asset
- R1 · Asset
- I4 · Inspection
- status: closed
- I5 · Inspection
- status: open
- T4 · Technician
- status: closed
- R1 to I4: HAS_INSPECTION
- R2 to I4: HAS_INSPECTION
- R1 to I4: HAS_INSPECTION
- R3 to I5: HAS_INSPECTION
- R3 to T4: HAS_INSPECTION
Inspect the node and relationship records
{ "nodes": [ { "id": "R3", "kind": "Asset" }, { "id": "R2", "kind": "Asset" }, { "id": "R1", "kind": "Asset" }, { "id": "I4", "kind": "Inspection", "status": "closed" }, { "id": "I5", "kind": "Inspection", "status": "open" }, { "id": "T4", "kind": "Technician", "status": "closed" } ], "edges": [ { "id": "a", "source": "R1", "target": "I4", "type": "HAS_INSPECTION" }, { "id": "b", "source": "R2", "target": "I4", "type": "HAS_INSPECTION" }, { "id": "copy", "source": "R1", "target": "I4", "type": "HAS_INSPECTION" }, { "id": "open", "source": "R3", "target": "I5", "type": "HAS_INSPECTION" }, { "id": "bad-kind", "source": "R3", "target": "T4", "type": "HAS_INSPECTION" } ] }
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Why would counting every optional binding row give a missing inspection a count of one?
A placeholder preserves the starting record; it is not an observed related entity.
These components operate on the supplied records in your browser. They do not run a graph database or interpret Cypher.
Work through the Python challenges →