@lde/pipeline-void 0.26.4 → 0.26.6
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 +3 -2
- package/dist/stage.d.ts +7 -1
- package/dist/stage.d.ts.map +1 -1
- package/dist/stage.js +6 -4
- package/dist/vocabularyAnalyzer.d.ts +1 -0
- package/dist/vocabularyAnalyzer.d.ts.map +1 -1
- package/dist/vocabularyAnalyzer.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Accepts an optional `VoidStagesOptions` object:
|
|
|
17
17
|
| `maxConcurrency` | 10 | Maximum concurrent in-flight executor batches (per-class stages only) |
|
|
18
18
|
| `perClass` | — | Override per-class iteration for all five per-class stages |
|
|
19
19
|
| `uriSpaces` | — | When provided, includes the object URI space stage |
|
|
20
|
+
| `vocabularies` | — | Additional vocabulary namespace URIs to detect beyond the built-in defaults |
|
|
20
21
|
|
|
21
22
|
```typescript
|
|
22
23
|
import { voidStages } from '@lde/pipeline-void';
|
|
@@ -66,10 +67,10 @@ Global and domain-specific factories accept `VoidStageOptions` (`timeout`) and r
|
|
|
66
67
|
|
|
67
68
|
| Factory | Description |
|
|
68
69
|
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
-
| `detectVocabularies()` | [`entity-properties.rq`](queries/entity-properties.rq) — Entity properties with automatic `void:vocabulary` detection
|
|
70
|
+
| `detectVocabularies()` | [`entity-properties.rq`](queries/entity-properties.rq) — Entity properties with automatic `void:vocabulary` detection. Accepts `DetectVocabulariesOptions` with an optional `vocabularies` array to extend the built-in defaults. |
|
|
70
71
|
| `uriSpaces(uriSpaceMap)` | [`object-uri-space.rq`](queries/object-uri-space.rq) — Object URI namespace linksets, aggregated against a provided URI space map |
|
|
71
72
|
|
|
72
73
|
## Executor decorators
|
|
73
74
|
|
|
74
|
-
- `VocabularyExecutor` — Wraps an executor; detects known vocabulary namespace prefixes in `void:property` quads and appends `void:vocabulary` triples.
|
|
75
|
+
- `VocabularyExecutor` — Wraps an executor; detects known vocabulary namespace prefixes in `void:property` quads and appends `void:vocabulary` triples. The built-in defaults are exported as `defaultVocabularies` (sourced from `@zazuko/prefixes`).
|
|
75
76
|
- `UriSpaceExecutor` — Wraps an executor; consumes `void:Linkset` quads, matches each `void:objectsTarget` against configured URI space prefixes using `startsWith`, and aggregates triple counts per matched space. Emits `void:objectsTarget` pointing to the target dataset IRI (taken from the metadata quad subjects), not the raw prefix. Unmatched linksets are discarded.
|
package/dist/stage.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface PerClassVoidStageOptions extends VoidStageOptions {
|
|
|
27
27
|
export interface VoidStagesOptions extends PerClassVoidStageOptions {
|
|
28
28
|
/** When provided, includes the object URI space stage using this map. */
|
|
29
29
|
uriSpaces?: ReadonlyMap<string, readonly Quad[]>;
|
|
30
|
+
/** Additional vocabulary namespace URIs to detect beyond the built-in defaults. */
|
|
31
|
+
vocabularies?: readonly string[];
|
|
30
32
|
}
|
|
31
33
|
export declare function subjectUriSpaces(options?: VoidStageOptions): Promise<Stage>;
|
|
32
34
|
export declare function classPartitions(options?: VoidStageOptions): Promise<Stage>;
|
|
@@ -43,7 +45,11 @@ export declare function perClassObjectClasses(options?: PerClassVoidStageOptions
|
|
|
43
45
|
export declare function perClassDatatypes(options?: PerClassVoidStageOptions): Promise<Stage>;
|
|
44
46
|
export declare function perClassLanguages(options?: PerClassVoidStageOptions): Promise<Stage>;
|
|
45
47
|
export declare function uriSpaces(uriSpaceMap: ReadonlyMap<string, readonly Quad[]>, options?: VoidStageOptions): Promise<Stage>;
|
|
46
|
-
export
|
|
48
|
+
export interface DetectVocabulariesOptions extends VoidStageOptions {
|
|
49
|
+
/** Additional vocabulary namespace URIs to detect beyond the built-in defaults. */
|
|
50
|
+
vocabularies?: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
export declare function detectVocabularies(options?: DetectVocabulariesOptions): Promise<Stage>;
|
|
47
53
|
/**
|
|
48
54
|
* Create all VoID analysis stages in their recommended execution order.
|
|
49
55
|
*
|
package/dist/stage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../src/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAMN,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../src/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAMN,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAezC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,yEAAyE;IACzE,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IACjD,mFAAmF;IACnF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AA2DD,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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nF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,wBAAgB,kBAAkB,CAChC,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,KAAK,CAAC,CAchB;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,KAAK,EAAE,CAAC,CAgClB"}
|
package/dist/stage.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Stage, SparqlConstructExecutor, SparqlItemSelector, readQueryFile, } fr
|
|
|
2
2
|
import { assertSafeIri } from '@lde/dataset';
|
|
3
3
|
import { resolve, dirname } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { VocabularyExecutor } from './vocabularyAnalyzer.js';
|
|
5
|
+
import { VocabularyExecutor, defaultVocabularies, } from './vocabularyAnalyzer.js';
|
|
6
6
|
import { UriSpaceExecutor } from './uriSpaceExecutor.js';
|
|
7
7
|
const queriesDir = resolve(dirname(fileURLToPath(import.meta.url)), '..', 'queries');
|
|
8
8
|
async function createVoidStage(filename, options) {
|
|
@@ -122,7 +122,9 @@ export function detectVocabularies(options) {
|
|
|
122
122
|
executor: (query) => new VocabularyExecutor(new SparqlConstructExecutor({
|
|
123
123
|
query,
|
|
124
124
|
timeout: options?.timeout ?? 60_000,
|
|
125
|
-
})
|
|
125
|
+
}), options?.vocabularies
|
|
126
|
+
? [...defaultVocabularies, ...options.vocabularies]
|
|
127
|
+
: undefined),
|
|
126
128
|
});
|
|
127
129
|
}
|
|
128
130
|
/**
|
|
@@ -134,7 +136,7 @@ export function detectVocabularies(options) {
|
|
|
134
136
|
* when the cache is cold.
|
|
135
137
|
*/
|
|
136
138
|
export async function voidStages(options) {
|
|
137
|
-
const { uriSpaces: uriSpaceMap, ...stageOptions } = options ?? {};
|
|
139
|
+
const { uriSpaces: uriSpaceMap, vocabularies, ...stageOptions } = options ?? {};
|
|
138
140
|
return Promise.all([
|
|
139
141
|
// Global counting stages.
|
|
140
142
|
countSubjects(stageOptions),
|
|
@@ -153,7 +155,7 @@ export async function voidStages(options) {
|
|
|
153
155
|
perClassLanguages(stageOptions),
|
|
154
156
|
// Other stages.
|
|
155
157
|
detectLicenses(stageOptions),
|
|
156
|
-
detectVocabularies(stageOptions),
|
|
158
|
+
detectVocabularies({ ...stageOptions, vocabularies }),
|
|
157
159
|
subjectUriSpaces(stageOptions),
|
|
158
160
|
...(uriSpaceMap ? [uriSpaces(uriSpaceMap, stageOptions)] : []),
|
|
159
161
|
]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Dataset, Distribution } from '@lde/dataset';
|
|
2
2
|
import { NotSupported, type Executor, type ExecuteOptions } from '@lde/pipeline';
|
|
3
3
|
import type { Quad } from '@rdfjs/types';
|
|
4
|
+
export declare const defaultVocabularies: readonly string[];
|
|
4
5
|
/**
|
|
5
6
|
* Executor decorator that passes through all quads from the inner executor
|
|
6
7
|
* and appends `void:vocabulary` triples for detected vocabulary prefixes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabularyAnalyzer.d.ts","sourceRoot":"","sources":["../src/vocabularyAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"vocabularyAnalyzer.d.ts","sourceRoot":"","sources":["../src/vocabularyAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUzC,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAEhD,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,kBAAmB,YAAW,QAAQ;IAE/C,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,KAAK,EAAE,QAAQ,EACf,YAAY,GAAE,SAAS,MAAM,EAAwB;IAGlE,OAAO,CACX,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC;CAO/C"}
|
|
@@ -5,7 +5,7 @@ const { namedNode, quad } = DataFactory;
|
|
|
5
5
|
const VOID = 'http://rdfs.org/ns/void#';
|
|
6
6
|
const voidProperty = namedNode(`${VOID}property`);
|
|
7
7
|
const voidVocabulary = namedNode(`${VOID}vocabulary`);
|
|
8
|
-
const defaultVocabularies = [
|
|
8
|
+
export const defaultVocabularies = [
|
|
9
9
|
...new Set(Object.values(prefixes)),
|
|
10
10
|
];
|
|
11
11
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/pipeline-void",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.6",
|
|
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",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@lde/dataset": "0.7.2",
|
|
36
|
-
"@lde/pipeline": "0.28.
|
|
36
|
+
"@lde/pipeline": "0.28.5"
|
|
37
37
|
}
|
|
38
38
|
}
|