diff --git a/packages/client/src/docs.ts b/packages/client/src/docs.ts index b51b5b5..f405f0e 100644 --- a/packages/client/src/docs.ts +++ b/packages/client/src/docs.ts @@ -93,7 +93,11 @@ export async function sparqlQuery( // rows under an identity that should see nothing) can be appended. Skip the // rowCount work entirely when the log is off. if (accessLogEnabled()) { - logAccess("READ", anchor ?? "(no anchor)", label, " → " + rowCount(result) + " rows"); + // `rows` here are raw RDF triple bindings (the SPARQL `?s ?p ?o` result), NOT + // domain objects — one document's entity is spread across several triple rows. + // Spell that out so the log isn't mistaken for an object count (the app-level + // object/shape count is logged separately by useShapeQuery → dataStats). + logAccess("READ", anchor ?? "(no anchor)", label, " → " + rowCount(result) + " triple-rows"); } return result; } diff --git a/packages/client/test/access-log.test.ts b/packages/client/test/access-log.test.ts index f64c4f6..2a39bd9 100644 --- a/packages/client/test/access-log.test.ts +++ b/packages/client/test/access-log.test.ts @@ -164,7 +164,7 @@ describe("access-log: ON via configure({ debugAccessLog: true })", () => { expect(lines[0]).toMatch(/READ/); expect(lines[0]).toMatch(/did:ng:o:q/); expect(lines[0]).toMatch(/myLabel/); - expect(lines[0]).toMatch(/→ 1 rows/); // row-count from the 1-row fake result + expect(lines[0]).toMatch(/→ 1 triple-rows/); // triple-count from the 1-row fake result }); it("sparqlUpdate emits a WRITE line with identity, anchor nuri, and label", async () => {