@lde/pipeline-void 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,11 +10,13 @@ Returns all VoID stages in their recommended execution order. The ordering is op
10
10
 
11
11
  Accepts an optional `VoidStagesOptions` object:
12
12
 
13
- | Option | Default | Description |
14
- | ---------------- | ------- | -------------------------------------------------- |
15
- | `batchSize` | 10 | Maximum number of bindings per executor call |
16
- | `maxConcurrency` | 10 | Maximum concurrent in-flight executor batches |
17
- | `uriSpaces` | | When provided, includes the object URI space stage |
13
+ | Option | Default | Description |
14
+ | ---------------- | ------- | --------------------------------------------------------------------- |
15
+ | `timeout` | 60 000 | SPARQL query timeout in milliseconds |
16
+ | `batchSize` | 10 | Maximum class bindings per executor call (per-class stages only) |
17
+ | `maxConcurrency` | 10 | Maximum concurrent in-flight executor batches (per-class stages only) |
18
+ | `perClass` | — | Override per-class iteration for all five per-class stages |
19
+ | `uriSpaces` | — | When provided, includes the object URI space stage |
18
20
 
19
21
  ```typescript
20
22
  import { voidStages } from '@lde/pipeline-void';
@@ -34,7 +36,7 @@ await new Pipeline({
34
36
 
35
37
  ### Individual stage factories
36
38
 
37
- All factories accept an optional `VoidStageOptions` (`batchSize`, `maxConcurrency`) and return `Promise<Stage>`.
39
+ Global and domain-specific factories accept `VoidStageOptions` (`timeout`) and return `Promise<Stage>`. Per-class factories accept `PerClassVoidStageOptions` (`timeout`, `batchSize`, `maxConcurrency`, `perClass`) they default `perClass` to `true`; set it to `false` to run them as monolithic queries instead.
38
40
 
39
41
  #### Global stages (one CONSTRUCT query per dataset):
40
42
 
package/dist/stage.d.ts CHANGED
@@ -4,15 +4,27 @@ import type { Quad } from '@rdfjs/types';
4
4
  * Options for configuring VoID stage execution.
5
5
  */
6
6
  export interface VoidStageOptions {
7
- /** Maximum number of bindings per executor call. @default 10 */
7
+ /** SPARQL query timeout in milliseconds. @default 60000 */
8
+ timeout?: number;
9
+ }
10
+ /**
11
+ * Options for per-class VoID stages that iterate over classes.
12
+ *
13
+ * `batchSize` and `maxConcurrency` control how class bindings are batched
14
+ * and processed concurrently — they have no effect on global (non-per-class) stages.
15
+ */
16
+ export interface PerClassVoidStageOptions extends VoidStageOptions {
17
+ /** Maximum number of class bindings per executor call. @default 10 */
8
18
  batchSize?: number;
9
19
  /** Maximum concurrent in-flight executor batches. @default 10 */
10
20
  maxConcurrency?: number;
21
+ /** When true, iterate queries per class using a class selector. @default true */
22
+ perClass?: boolean;
11
23
  }
12
24
  /**
13
25
  * Options for the {@link voidStages} convenience function.
14
26
  */
15
- export interface VoidStagesOptions extends VoidStageOptions {
27
+ export interface VoidStagesOptions extends PerClassVoidStageOptions {
16
28
  /** When provided, includes the object URI space stage using this map. */
17
29
  uriSpaces?: ReadonlyMap<string, readonly Quad[]>;
18
30
  }
@@ -23,13 +35,13 @@ export declare function countObjectUris(options?: VoidStageOptions): Promise<Sta
23
35
  export declare function countProperties(options?: VoidStageOptions): Promise<Stage>;
24
36
  export declare function countSubjects(options?: VoidStageOptions): Promise<Stage>;
25
37
  export declare function countTriples(options?: VoidStageOptions): Promise<Stage>;
26
- export declare function classPropertySubjects(options?: VoidStageOptions): Promise<Stage>;
27
- export declare function classPropertyObjects(options?: VoidStageOptions): Promise<Stage>;
38
+ export declare function classPropertySubjects(options?: PerClassVoidStageOptions): Promise<Stage>;
39
+ export declare function classPropertyObjects(options?: PerClassVoidStageOptions): Promise<Stage>;
28
40
  export declare function countDatatypes(options?: VoidStageOptions): Promise<Stage>;
29
41
  export declare function detectLicenses(options?: VoidStageOptions): Promise<Stage>;
30
- export declare function perClassObjectClasses(options?: VoidStageOptions): Promise<Stage>;
31
- export declare function perClassDatatypes(options?: VoidStageOptions): Promise<Stage>;
32
- export declare function perClassLanguages(options?: VoidStageOptions): Promise<Stage>;
42
+ export declare function perClassObjectClasses(options?: PerClassVoidStageOptions): Promise<Stage>;
43
+ export declare function perClassDatatypes(options?: PerClassVoidStageOptions): Promise<Stage>;
44
+ export declare function perClassLanguages(options?: PerClassVoidStageOptions): Promise<Stage>;
33
45
  export declare function uriSpaces(uriSpaceMap: ReadonlyMap<string, readonly Quad[]>, options?: VoidStageOptions): Promise<Stage>;
34
46
  export declare function detectVocabularies(options?: VoidStageOptions): Promise<Stage>;
35
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../src/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAMN,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAYzC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,yEAAyE;IACzE,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;CAClD;AAwDD,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAE3E;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAE1E;AAED,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,KAAK,CAAC,CAEhB;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAE1E;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAE1E;AAED,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,C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BAAoB,CAClC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,KAAK,CAAC,CAKhB;AAED,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAEzE;AAED,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAEzE;AAID,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,KAAK,CAAC,CAKhB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,KAAK,CAAC,CAKhB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,KAAK,CAAC,CAKhB;AAID,wBAAgB,SAAS,CACvB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,EACjD,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,KAAK,CAAC,CAYhB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAW7E;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,KAAK,EAAE,CAAC,CA4BlB"}
package/dist/stage.js CHANGED
@@ -6,8 +6,12 @@ import { UriSpaceExecutor } from './uriSpaceExecutor.js';
6
6
  const queriesDir = resolve(dirname(fileURLToPath(import.meta.url)), '..', 'queries');
7
7
  async function createVoidStage(filename, options) {
8
8
  const query = await readQueryFile(resolve(queriesDir, filename));
9
- const executor = options?.executor?.(query) ?? new SparqlConstructExecutor({ query });
10
- if (options?.selection === 'perClass') {
9
+ const executor = options?.executor?.(query) ??
10
+ new SparqlConstructExecutor({
11
+ query,
12
+ timeout: options?.timeout ?? 60_000,
13
+ });
14
+ if (options?.perClass) {
11
15
  return new Stage({
12
16
  name: filename,
13
17
  itemSelector: classSelector(),
@@ -19,8 +23,6 @@ async function createVoidStage(filename, options) {
19
23
  return new Stage({
20
24
  name: filename,
21
25
  executors: executor,
22
- batchSize: options?.batchSize,
23
- maxConcurrency: options?.maxConcurrency,
24
26
  });
25
27
  }
26
28
  function classSelector() {
@@ -68,13 +70,13 @@ export function countTriples(options) {
68
70
  export function classPropertySubjects(options) {
69
71
  return createVoidStage('class-properties-subjects.rq', {
70
72
  ...options,
71
- selection: 'perClass',
73
+ perClass: options?.perClass ?? true,
72
74
  });
73
75
  }
74
76
  export function classPropertyObjects(options) {
75
77
  return createVoidStage('class-properties-objects.rq', {
76
78
  ...options,
77
- selection: 'perClass',
79
+ perClass: options?.perClass ?? true,
78
80
  });
79
81
  }
80
82
  export function countDatatypes(options) {
@@ -87,32 +89,38 @@ export function detectLicenses(options) {
87
89
  export function perClassObjectClasses(options) {
88
90
  return createVoidStage('class-property-object-classes.rq', {
89
91
  ...options,
90
- selection: 'perClass',
92
+ perClass: options?.perClass ?? true,
91
93
  });
92
94
  }
93
95
  export function perClassDatatypes(options) {
94
96
  return createVoidStage('class-property-datatypes.rq', {
95
97
  ...options,
96
- selection: 'perClass',
98
+ perClass: options?.perClass ?? true,
97
99
  });
98
100
  }
99
101
  export function perClassLanguages(options) {
100
102
  return createVoidStage('class-property-languages.rq', {
101
103
  ...options,
102
- selection: 'perClass',
104
+ perClass: options?.perClass ?? true,
103
105
  });
104
106
  }
105
107
  // Domain-specific executor stages
106
108
  export function uriSpaces(uriSpaceMap, options) {
107
109
  return createVoidStage('object-uri-space.rq', {
108
110
  ...options,
109
- executor: (query) => new UriSpaceExecutor(new SparqlConstructExecutor({ query }), uriSpaceMap),
111
+ executor: (query) => new UriSpaceExecutor(new SparqlConstructExecutor({
112
+ query,
113
+ timeout: options?.timeout ?? 60_000,
114
+ }), uriSpaceMap),
110
115
  });
111
116
  }
112
117
  export function detectVocabularies(options) {
113
118
  return createVoidStage('entity-properties.rq', {
114
119
  ...options,
115
- executor: (query) => new VocabularyExecutor(new SparqlConstructExecutor({ query })),
120
+ executor: (query) => new VocabularyExecutor(new SparqlConstructExecutor({
121
+ query,
122
+ timeout: options?.timeout ?? 60_000,
123
+ })),
116
124
  });
117
125
  }
118
126
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/pipeline-void",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "VOiD (Vocabulary of Interlinked Datasets) statistical analysis for RDF datasets",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
@@ -32,6 +32,6 @@
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@lde/dataset": "0.7.1",
35
- "@lde/pipeline": "0.23.0"
35
+ "@lde/pipeline": "0.24.0"
36
36
  }
37
37
  }