From 16bb72513a9a4bd7a58f9d6e4c01fac930c2567e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 07:18:06 +0000 Subject: [PATCH] fix(dataset-registry-client): drop workaround for LDkit count() ignoring $id Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01RW8UxaJonYPi5cb37TgXYL --- package-lock.json | 139 ++++++------------ packages/dataset-registry-client/package.json | 2 +- .../dataset-registry-client/src/client.ts | 13 +- 3 files changed, 46 insertions(+), 108 deletions(-) diff --git a/package-lock.json b/package-lock.json index 83d39991..4732d592 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19817,7 +19817,7 @@ "version": "1.9.2", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz", "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@emnapi/wasi-threads": "1.2.1", @@ -19828,7 +19828,7 @@ "version": "1.9.2", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz", "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.4.0" @@ -19838,7 +19838,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.4.0" @@ -21217,9 +21217,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -21234,9 +21231,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -21251,9 +21245,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -21268,9 +21259,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -21786,7 +21774,7 @@ }, "node_modules/@polka/url": { "version": "1.0.0-next.29", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/@protobufjs/aspromise": { @@ -22199,6 +22187,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22215,6 +22204,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22231,6 +22221,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22247,6 +22238,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22263,6 +22255,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22279,9 +22272,7 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22298,9 +22289,7 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22317,9 +22306,7 @@ "cpu": [ "ppc64" ], - "libc": [ - "glibc" - ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22336,9 +22323,7 @@ "cpu": [ "s390x" ], - "libc": [ - "glibc" - ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22355,9 +22340,7 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22374,9 +22357,7 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22393,6 +22374,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22409,6 +22391,7 @@ "cpu": [ "wasm32" ], + "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -22424,6 +22407,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz", "integrity": "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==", + "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -22442,6 +22426,7 @@ "version": "0.10.2", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", + "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -22455,6 +22440,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22471,6 +22457,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -22579,9 +22566,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22596,9 +22580,6 @@ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -22613,9 +22594,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22630,9 +22608,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -22647,9 +22622,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22664,9 +22636,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -22681,9 +22650,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22698,9 +22664,6 @@ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -22715,9 +22678,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22732,9 +22692,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -22749,9 +22706,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22766,9 +22720,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -22783,9 +22734,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -25098,7 +25046,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.1.0.tgz", "integrity": "sha512-sTSDtVM1GOevRGsCNhp1mBUHKo9Qlc55+HCreFT4fe99AHxl1QQNXSL3uj4Pkjh5yEuWZIx8E2tVC94nnBZECQ==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@vitest/utils": "4.1.0", @@ -29401,7 +29349,7 @@ }, "node_modules/fflate": { "version": "0.8.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/figures": { @@ -29646,7 +29594,7 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.0.tgz", "integrity": "sha512-kC6Bb+ooptOIvWj5B63EQWkF0FEnNjV2ZNkLMLZRDDduIiWeFF4iKnslwhiWxjAdbg4NzTNo6h0qLuvFrcx+Sw==", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/fn.name": { @@ -31581,9 +31529,9 @@ } }, "node_modules/ldkit": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/ldkit/-/ldkit-2.8.0.tgz", - "integrity": "sha512-RopMsEtWf6l++XFkrcVnBThHrpuSkzmATwzB8ezIgV6O7+CgxeSsQVkyk+2AlrxUeXkbZ+TFTDIhXay0ItMRLg==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/ldkit/-/ldkit-2.9.0.tgz", + "integrity": "sha512-tfhPGof+HJPrRqQLXiBUgggdlEq2+5XgbZ52EhyDkT2BAFI5N3TO55jxns3Blrx40HWYPy2uGmDIIrjb0kjtAA==", "license": "MIT", "dependencies": { "@comunica/types": "^5", @@ -31763,6 +31711,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31783,6 +31732,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31803,6 +31753,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31823,6 +31774,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31843,6 +31795,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31863,9 +31816,7 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31886,9 +31837,7 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31909,9 +31858,7 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31932,9 +31879,7 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31955,6 +31900,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -31975,6 +31921,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -32711,7 +32658,7 @@ }, "node_modules/mrmime": { "version": "2.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -36099,7 +36046,7 @@ }, "node_modules/sirv": { "version": "3.0.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@polka/url": "^1.0.0-next.24", @@ -37112,7 +37059,7 @@ }, "node_modules/totalist": { "version": "3.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -38790,7 +38737,7 @@ "version": "2.9.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -38892,7 +38839,7 @@ "@traqula/generator-sparql-1-1": "^1.3.1", "@traqula/parser-sparql-1-1": "^1.3.1", "@traqula/rules-sparql-1-1": "^1.2.0", - "ldkit": "^2.8.0", + "ldkit": "^2.9.0", "tslib": "^2.3.0" }, "devDependencies": { diff --git a/packages/dataset-registry-client/package.json b/packages/dataset-registry-client/package.json index b6e874b3..4e16dcc9 100644 --- a/packages/dataset-registry-client/package.json +++ b/packages/dataset-registry-client/package.json @@ -28,7 +28,7 @@ "@traqula/generator-sparql-1-1": "^1.3.1", "@traqula/parser-sparql-1-1": "^1.3.1", "@traqula/rules-sparql-1-1": "^1.2.0", - "ldkit": "^2.8.0", + "ldkit": "^2.9.0", "tslib": "^2.3.0" }, "devDependencies": { diff --git a/packages/dataset-registry-client/src/client.ts b/packages/dataset-registry-client/src/client.ts index 8290b4dd..527b5b1e 100644 --- a/packages/dataset-registry-client/src/client.ts +++ b/packages/dataset-registry-client/src/client.ts @@ -1,6 +1,6 @@ import { Dataset, Distribution } from '@lde/dataset'; import { DatasetSchema } from './schema.js'; -import { type SchemaSearchInterface, type SchemaInterface } from 'ldkit'; +import { type SchemaSearchInterface } from 'ldkit'; import { createLens } from 'ldkit'; import { prepareQuery } from './query.js'; import { Paginator } from './paginator.js'; @@ -23,7 +23,7 @@ export class Client { // logQuery: (query) => console.debug(query), }); - let results: SchemaInterface[] | undefined; + let results; let total; let pageSize; @@ -32,12 +32,6 @@ export class Client { results = await datasets.query(prepareQuery(args)); total = results.length; pageSize = total; - } else if (args.$id) { - // Work around LDkit bug: count() ignores $id. - // IRI lookups don't need pagination. - results = await datasets.find({ where: args }); - total = results.length; - pageSize = total; } else { // With search criteria the results are paginated. total = await datasets.count({ where: args }); @@ -51,9 +45,6 @@ export class Client { // Custom query has no paginated results. // TODO: we could add a convention here like {OFFSET} {LIMIT} in the query string. items = await datasets.query(prepareQuery(args)); - } else if (results) { - // Pre-fetched results ($id workaround): return them directly. - items = results; } else { items = await datasets.find({ where: args,