@lde/search-pipeline 0.46.0 → 0.47.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.
@@ -54,14 +54,6 @@ export interface SearchIndexerPipelineOptions {
54
54
  /** {@link SearchType.name}s of the root types to source from it. */
55
55
  names: readonly string[];
56
56
  };
57
- /**
58
- * The {@link SearchType.name} of the root type that describes the dataset
59
- * being indexed, so a `derive` can copy a field of the dataset onto each
60
- * document through `ProjectionContext.datasetDocument` – see
61
- * `searchStages`’ `datasetType`. An unknown name throws here, at
62
- * wiring time.
63
- */
64
- datasetType?: string;
65
57
  /**
66
58
  * {@link QuadTransform}(s) attached to a root type’s reader, keyed by
67
59
  * {@link SearchType.name} – the extension point a deployment reaches for
@@ -1 +1 @@
1
- {"version":3,"file":"search-indexer-pipeline.d.ts","sourceRoot":"","sources":["../src/search-indexer-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAEzB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;IACtC;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C;;;;;;;OAOG;IACH,SAAS,EAAE,CACT,UAAU,EAAE,QAAQ,EACpB,MAA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ipeline(options) {
60
60
  sourceFor: fromRegistry.has(searchType.name) ? sourceFor : undefined,
61
61
  transform: transforms?.[searchType.name],
62
62
  })),
63
- datasetType: options.datasetType,
64
63
  }),
65
64
  writers: searchIndexWriter({ schema, writerFor: options.writerFor }),
66
65
  provenanceStore: options.provenanceStore,
@@ -82,15 +82,6 @@ export interface SearchStagesOptions {
82
82
  schema: SearchSchema;
83
83
  /** One entry per root type to index, each its own stage. */
84
84
  types: readonly SearchStageType[];
85
- /**
86
- * The {@link SearchType.name} of the root type that describes the dataset
87
- * being indexed. Its stage then runs first, and the document it projects
88
- * for the dataset itself – the one whose `id` is the dataset IRI – reaches
89
- * every other stage’s projection as `ProjectionContext.datasetDocument`, so
90
- * a `derive` can copy a field of the dataset onto each document. Must name
91
- * one of {@link types}.
92
- */
93
- datasetType?: string;
94
85
  }
95
86
  /**
96
87
  * Compose one projecting {@link Stage} per root type – the source side of a
@@ -102,8 +93,11 @@ export interface SearchStagesOptions {
102
93
  * by the dataset
103
94
  * ([ADR 13](https://github.com/ldelements/lde/blob/main/docs/decisions/0013-project-inside-the-batch-per-root-type.md)).
104
95
  *
105
- * With {@link SearchStagesOptions.datasetType}, that type’s stage runs first
106
- * and hands the dataset’s own document to every other stage’s projection.
96
+ * A root type whose `class` is `dcat:Dataset` describes the dataset being
97
+ * indexed: its stage runs first, and the document it projects for the dataset
98
+ * itself – the one whose `id` is the dataset IRI – reaches every other stage’s
99
+ * projection as `ProjectionContext.datasetDocument`, so a `derive` can copy a
100
+ * field of the dataset onto each document.
107
101
  *
108
102
  * Wire the result as `new Pipeline<TypedSearchDocument>({ datasetSelector,
109
103
  * stages: searchStages(...), writers: searchIndexWriter(...) })` – one terminal,
@@ -1 +1 @@
1
- {"version":3,"file":"search-stages.d.ts","sourceRoot":"","sources":["../src/search-stages.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAA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C;IACrB,4DAA4D;IAC5D,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,mBAAmB,GAC3B,KAAK,CAAC,mBAAmB,CAAC,EAAE,CA2G9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,QAAQ,EACpB,YAAY,SAAS,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,YAAY,CAWd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,GACZ,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAK3C"}
@@ -12,21 +12,20 @@ import { extractionQueryString } from './extraction.js';
12
12
  * by the dataset
13
13
  * ([ADR 13](https://github.com/ldelements/lde/blob/main/docs/decisions/0013-project-inside-the-batch-per-root-type.md)).
14
14
  *
15
- * With {@link SearchStagesOptions.datasetType}, that type’s stage runs first
16
- * and hands the dataset’s own document to every other stage’s projection.
15
+ * A root type whose `class` is `dcat:Dataset` describes the dataset being
16
+ * indexed: its stage runs first, and the document it projects for the dataset
17
+ * itself – the one whose `id` is the dataset IRI – reaches every other stage’s
18
+ * projection as `ProjectionContext.datasetDocument`, so a `derive` can copy a
19
+ * field of the dataset onto each document.
17
20
  *
18
21
  * Wire the result as `new Pipeline<TypedSearchDocument>({ datasetSelector,
19
22
  * stages: searchStages(...), writers: searchIndexWriter(...) })` – one terminal,
20
23
  * N stages.
21
24
  */
22
25
  export function searchStages(options) {
23
- const { schema, types, datasetType } = options;
24
- const isDatasetType = (type) => type.searchType.name === datasetType;
25
- if (datasetType !== undefined && !types.some(isDatasetType)) {
26
- // Without its stage the document is never projected, and every copy of a
27
- // dataset field would be silently absent.
28
- throw new Error(`Dataset type “${datasetType}” has no stage; name one of the types searchStages projects.`);
29
- }
26
+ const { schema, types } = options;
27
+ // The schema holds one root type per class, so at most one stage matches.
28
+ const isDatasetType = (type) => type.searchType.class === DCAT_DATASET;
30
29
  // The dataset being indexed and its own projected document, for the stages
31
30
  // that run after its type’s. The pipeline processes datasets one at a time,
32
31
  // so one slot holds one document, never one per dataset; it is read only for
@@ -209,3 +208,5 @@ export function registrySource(endpoint) {
209
208
  ? distribution
210
209
  : Distribution.sparql(endpoint, dataset.iri.toString());
211
210
  }
211
+ /** The class of a root type that describes the dataset being indexed. */
212
+ const DCAT_DATASET = 'http://www.w3.org/ns/dcat#Dataset';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search-pipeline",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Search indexing as an @lde/pipeline instance: a Writer<Quad> that applies the @lde/search projection to extracted RDF and fans each document out to the transactional engine writer for its type's collection. Glue between the pipeline quad world and the search-engine document world; owns no projection or engine logic itself.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
@@ -25,14 +25,14 @@
25
25
  "!**/*.tsbuildinfo"
26
26
  ],
27
27
  "dependencies": {
28
- "@lde/search": "^0.40.0",
28
+ "@lde/search": "^0.41.0",
29
29
  "@traqula/generator-sparql-1-1": "^1.3.1",
30
30
  "@traqula/parser-sparql-1-1": "^1.3.1",
31
31
  "@traqula/rules-sparql-1-1": "^1.2.0",
32
32
  "tslib": "^2.3.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@lde/search-typesense": "^0.49.0",
35
+ "@lde/search-typesense": "^0.50.0",
36
36
  "@rdfjs/types": "^2.0.1",
37
37
  "n3": "^2.13.12",
38
38
  "testcontainers": "^12.1.0",