Q37, run 2026-11-06-0041-sonnet-query
How many distinct legal entities does the data describe?
Tests: Identity: records with the same LEI are one entity.
Expected: count = 331
sql run 1
344. This is the number of distinct LEIs among the 370 entity rows, with the LEI-less sovereigns CV and VD counted by their IDs.
JSON: {"count": 344}
Why: count: expected 331, got 344
sql run 2
344. This is the number of distinct LEIs, with RESEARCH duplicates collapsed.
JSON: {"count": 344}
Why: count: expected 331, got 344
sql run 3
344. The 370 records contain 342 distinct LEIs, and the two sovereigns (CV, VD) have no LEI.
JSON: {"count": 344}
Why: count: expected 331, got 344
sql run 4
344. There are 342 distinct LEIs plus the 2 sovereigns, which have no LEI.
JSON: {"count": 344}
Why: count: expected 331, got 344
sql run 5
344. This counts distinct LEIs, plus the sovereigns that have no LEI.
JSON: {"count": 344}
Why: count: expected 331, got 344
sql+markdown run 1
331. This is the count of distinct LEIs plus the two sovereigns, with QA excluded.
JSON: {"count": 331}
sql+markdown run 2
331 distinct entities, counting by LEI with QA excluded and the two sovereigns counted by record ID.
JSON: {"count": 331}
sql+markdown run 3
331 distinct LEIs among non-QA records. This collapses same-LEI duplicates and excludes QA test records.
JSON: {"count": 331}
sql+markdown run 4
331 distinct legal entities, counted by LEI with QA records excluded.
JSON: {"count": 331}
sql+markdown run 5
331 distinct legal entities, matched by LEI with QA records excluded.
JSON: {"count": 331}
sparql run 1
344. There are 370 entity records, which fall to 344 distinct legal entities after merging records that share an LEI.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql run 2
344. There are 370 entity records and 26 LEIs shared by two records each.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql run 3
344. There are 370 entity records, with 342 distinct LEIs plus 2 records without an LEI.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql run 4
344. There are 370 entity records and 26 LEIs shared by two records each.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql run 5
344, counting records that share an LEI once.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql+ontology run 1
331. This counts non-QA records by LEI (record ID for sovereigns, which have none).
JSON: {"count": 331}
sparql+ontology run 2
331. This counts distinct LEIs (or IDs, for sovereigns) among non-QA records.
JSON: {"count": 331}
sparql+ontology run 3
331, counting distinct LEIs (record ID for the sovereigns, which have none) and excluding QA records.
JSON: {"count": 331}
sparql+ontology run 4
331. There are 329 distinct LEIs among non-QA records, plus the two sovereigns (CV, VD), which have none.
JSON: {"count": 331}
sparql+ontology run 5
329 distinct entities, counted by LEI (sovereigns by ID), excluding QA.
JSON: {"count": 329}
Why: count: expected 331, got 329
sql+executed run 1
331. Duplicate records are already merged into the 331 entity rows.
JSON: {"count": 331}
sql+executed run 2
331 rows in entities, which is already after duplicate records were merged.
JSON: {"count": 331}
sql+executed run 3
331. The entities table has 331 distinct entity_ids, after merging.
JSON: {"count": 331}
sql+executed run 4
331 entities, with duplicate records already merged.
JSON: {"count": 331}
sql+executed run 5
331 entities, after duplicate records are merged.
JSON: {"count": 331}
sparql+axioms run 1
344. There are 370 records; the 342 distinct LEIs plus the two sovereigns without LEIs give 344.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql+axioms run 2
344 distinct legal entities, after merging the 370 records linked by sameEntityAs.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql+axioms run 3
344, merging same-entity records.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql+axioms run 4
344. This counts distinct entities after merging records that share an LEI.
JSON: {"count": 344}
Why: count: expected 331, got 344
sparql+axioms run 5
344 distinct legal entities, after merging sameEntityAs duplicates.
JSON: {"count": 344}
Why: count: expected 331, got 344