Q37, run 2026-11-05-1515-sonnet-query
How many distinct legal entities does the data describe?
Tests: Identity: records with the same LEI are one entity.
Expected: count = 497
sql run 1
511. This is the count of distinct LEIs, treating the 2 entities with no LEI (VD, CV) as separate, which collapses the duplicate records.
JSON: {"count": 511}
Why: count: expected 497, got 511
sql run 2
511 distinct LEIs or entities across the 540 rows.
JSON: {"count": 511}
Why: count: expected 497, got 511
sql run 3
511. This is 540 rows with duplicates of the same LEI merged.
JSON: {"count": 511}
Why: count: expected 497, got 511
sql run 4
511 distinct legal entities after merging records with the same LEI.
JSON: {"count": 511}
Why: count: expected 497, got 511
sql run 5
511. That is 540 records minus duplicate LEI records (RESEARCH/QA copies).
JSON: {"count": 511}
Why: count: expected 497, got 511
sql+markdown run 1
497. There are 495 distinct LEIs plus 2 records with no LEI, with QA excluded.
JSON: {"count": 497}
sql+markdown run 2
497 distinct LEIs or records, excluding QA.
JSON: {"count": 497}
sql+markdown run 3
497. This is the count after merging records by LEI and excluding QA records.
JSON: {"count": 497}
sql+markdown run 4
497. This counts distinct LEIs, or the record ID where there is no LEI, excluding QA records.
JSON: {"count": 497}
sql+markdown run 5
497. This counts distinct LEIs or IDs across non-QA records.
JSON: {"count": 497}
sparql run 1
511. There are 540 records, 509 distinct LEIs, and 2 records without an LEI (CV, VD).
JSON: {"count": 511}
Why: count: expected 497, got 511
sparql run 2
511. There are 540 entity records; I counted by LEI where one exists, so duplicate records collapse.
JSON: {"count": 511}
Why: count: expected 497, got 511
sparql run 3
(no answer found)
JSON: {"count": null}
Why: count: expected 497, got None
sparql run 4
511. There are 540 records but only 509 distinct LEIs, plus 2 records with no LEI.
JSON: {"count": 511}
Why: count: expected 497, got 511
sparql run 5
509. This counts distinct LEIs, which collapses the duplicate records.
JSON: {"count": 509}
Why: count: expected 497, got 509
sparql+ontology run 1
(no answer found)
JSON: {"count": null}
Why: count: expected 497, got None
sparql+ontology run 2
497 distinct entities, counted by LEI with QA records excluded.
JSON: {"count": 497}
sparql+ontology run 3
497 distinct LEIs or record IDs, excluding QA.
JSON: {"count": 497}
sparql+ontology run 4
497. This counts distinct LEIs, or the record ID where there is no LEI, excluding QA records.
JSON: {"count": 497}
sparql+ontology run 5
About 497. The data has 509 distinct LEIs; I removed 14 QA LEIs and added the sovereigns (CV, VD), which have no LEI. This is approximate.
JSON: {"count": 497}
sql+executed run 1
497 entities.
JSON: {"count": 497}
sql+executed run 2
497. The entities table is already merged, with 497 unique entity_ids.
JSON: {"count": 497}
sql+executed run 3
497. The entities table is already merged, with one row per distinct legal entity.
JSON: {"count": 497}
sql+executed run 4
497 entities, with duplicate records already merged.
JSON: {"count": 497}
sql+executed run 5
497 entity records, which are already merged.
JSON: {"count": 497}
sparql+axioms run 1
511 distinct legal entities, after merging sameEntityAs duplicates.
JSON: {"count": 511}
Why: count: expected 497, got 511
sparql+axioms run 2
511 distinct legal entities, after merging the records linked by sameEntityAs.
JSON: {"count": 511}
Why: count: expected 497, got 511
sparql+axioms run 3
497. This is 495 distinct non-QA LEIs plus the two sovereigns (CV and VD), which have no LEI.
JSON: {"count": 497}
sparql+axioms run 4
511. There are 540 records, and 58 of them form 29 sameEntityAs pairs.
JSON: {"count": 511}
Why: count: expected 497, got 511
sparql+axioms run 5
509 distinct LEIs across 538 records. The sovereign records (e.g. VD, CV) have no LEI and are not counted.
JSON: {"count": 509}
Why: count: expected 497, got 509