@lde/pipeline-void 0.2.28 → 0.2.30

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.
@@ -1 +1 @@
1
- {"version":3,"file":"perClassAnalyzer.d.ts","sourceRoot":"","sources":["../src/perClassAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAIN,MAAM,eAAe,CAAC;AA4CvB,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,KAAK,CAAC,CAEpD;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,KAAK,CAAC,CAEpD;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,KAAK,CAAC,CAEvD"}
1
+ {"version":3,"file":"perClassAnalyzer.d.ts","sourceRoot":"","sources":["../src/perClassAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAKN,MAAM,eAAe,CAAC;AA4CvB,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,KAAK,CAAC,CAEpD;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,KAAK,CAAC,CAEpD;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,KAAK,CAAC,CAEvD"}
@@ -1,20 +1,16 @@
1
- import { Stage, SparqlSelector, SparqlConstructExecutor, readQueryFile, } from '@lde/pipeline';
1
+ import { Stage, SparqlItemSelector, SparqlConstructExecutor, readQueryFile, } from '@lde/pipeline';
2
2
  import { resolve, dirname } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  const __dirname = dirname(fileURLToPath(import.meta.url));
5
5
  /**
6
6
  * Create a Stage that first selects classes from the endpoint,
7
7
  * then runs a per-class CONSTRUCT query with `?class` bound via VALUES.
8
- *
9
- * The selector is a factory that receives the runtime distribution,
10
- * so no distribution is needed at construction time.
11
8
  */
12
9
  async function createPerClassStage(queryFilename) {
13
10
  const rawQuery = await readQueryFile(resolve(__dirname, 'queries', queryFilename));
14
11
  const executor = new SparqlConstructExecutor({ query: rawQuery });
15
- return new Stage({
16
- name: queryFilename,
17
- selector: (distribution) => {
12
+ const itemSelector = {
13
+ select: (distribution) => {
18
14
  const subjectFilter = distribution.subjectFilter ?? '';
19
15
  const fromClause = distribution.namedGraph
20
16
  ? `FROM <${distribution.namedGraph}>`
@@ -25,12 +21,15 @@ async function createPerClassStage(queryFilename) {
25
21
  `WHERE { ${subjectFilter} ?s a ?class . }`,
26
22
  'LIMIT 1000',
27
23
  ].join('\n');
28
- return new SparqlSelector({
24
+ return new SparqlItemSelector({
29
25
  query: selectorQuery,
30
- endpoint: distribution.accessUrl,
31
26
  pageSize: 1000,
32
- });
27
+ }).select(distribution);
33
28
  },
29
+ };
30
+ return new Stage({
31
+ name: queryFilename,
32
+ itemSelector,
34
33
  executors: executor,
35
34
  });
36
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/pipeline-void",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "VOiD (Vocabulary of Interlinked Datasets) statistical analysis for RDF datasets",
5
5
  "repository": {
6
6
  "url": "https://github.com/ldengine/lde",
@@ -24,7 +24,7 @@
24
24
  "!**/*.tsbuildinfo"
25
25
  ],
26
26
  "dependencies": {
27
- "@lde/pipeline": "0.6.26",
27
+ "@lde/pipeline": "0.6.28",
28
28
  "@rdfjs/types": "^2.0.1",
29
29
  "n3": "^1.17.0",
30
30
  "tslib": "^2.3.0"