Q37, run 2026-11-04-1738-sonnet-query

← back to the run

How many distinct legal entities does the data describe?

Tests: Identity: records with the same LEI are one entity.

Expected: count = 331

❌ D1 sql run 1 graded by code · query session

344. This counts distinct LEIs, using entity_id for the sovereigns, which have no LEI.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D1 sql run 2 graded by code · query session

344. This is the number of distinct LEIs, with the two sovereigns without an LEI counted by their own ID.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D1 sql run 3 graded by code · query session

344. This counts distinct LEIs, with an entity ID standing in where there is no LEI (the sovereigns).

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D1 sql run 4 graded by code · query session

344. There are 370 records, 26 of which are duplicate LEIs (342 distinct LEIs), plus the two sovereigns that have no LEI.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D1 sql run 5 graded by code · query session

344. There are 342 distinct LEIs, plus the two sovereigns CV and VD, which have no LEI.

JSON: {"count": 344}

Why: count: expected 331, got 344

✅ D2 sql+markdown run 1 graded by code · query session

331. That is the distinct LEIs or IDs after excluding the QA records.

JSON: {"count": 331}

✅ D2 sql+markdown run 2 graded by code · query session

331. This counts distinct LEIs (sovereigns by their own ID) and excludes QA records.

JSON: {"count": 331}

✅ D2 sql+markdown run 3 graded by code · query session

331 distinct entities, counting non-QA records by LEI (and by record ID for the two sovereigns, which have no LEI).

JSON: {"count": 331}

✅ D2 sql+markdown run 4 graded by code · query session

331 distinct LEI-based entities, with QA records excluded.

JSON: {"count": 331}

✅ D2 sql+markdown run 5 graded by code · query session

331 distinct legal entities, deduplicated by LEI and excluding QA records.

JSON: {"count": 331}

❌ D4 sparql run 1 graded by code · query session

344. There are 342 distinct LEIs, plus the two sovereigns (CV, VD), which have no LEI.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D4 sparql run 2 graded by code · query session

344. There are 370 entity records, with 342 distinct LEIs plus the two sovereigns that have none.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D4 sparql run 3 graded by code · query session

344. There are 370 records, 368 of them with an LEI, and those 368 share only 342 distinct LEIs, so 26 are duplicates.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D4 sparql run 4 graded by code · query session

344. There are 370 entity records but 342 distinct LEIs, plus the 2 records with no LEI.

JSON: {"count": 344}

Why: count: expected 331, got 344

❌ D4 sparql run 5 graded by code · query session

344. There are 370 entity records with 342 distinct LEIs, and the two sovereigns have no LEI.

JSON: {"count": 344}

Why: count: expected 331, got 344

✅ D5 sparql+ontology run 1 graded by code · query session

331. This counts distinct LEIs plus the two sovereigns, with QA records excluded.

JSON: {"count": 331}

✅ D5 sparql+ontology run 2 graded by code · query session

331. There are 329 distinct LEIs among non-QA records, plus the two sovereigns (CV and VD).

JSON: {"count": 331}

✅ D5 sparql+ontology run 3 graded by code · query session

331, counting distinct LEIs (sovereigns by record ID) and excluding QA records.

JSON: {"count": 331}

✅ D5 sparql+ontology run 4 graded by code · query session

331: 329 distinct LEIs plus the two sovereigns, which have none. QA records are excluded.

JSON: {"count": 331}

✅ D5 sparql+ontology run 5 graded by code · query session

331 distinct entities, counting non-QA records by LEI, or by record ID where there is no LEI.

JSON: {"count": 331}