@netwerk-digitaal-erfgoed/network-of-terms-query 6.2.8 → 6.2.10

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/{build → dist}/catalog.d.ts.map +1 -1
  3. package/{build → dist}/catalog.js +6 -7
  4. package/dist/config.d.ts.map +1 -0
  5. package/{build → dist}/config.js +0 -1
  6. package/{build → dist}/distributions.d.ts.map +1 -1
  7. package/{build → dist}/distributions.js +0 -1
  8. package/{build → dist}/helpers/logger-pino.d.ts.map +1 -1
  9. package/{build → dist}/helpers/logger-pino.js +0 -1
  10. package/{build → dist}/helpers/logger.js +0 -1
  11. package/{build → dist}/index.d.ts.map +1 -1
  12. package/{build → dist}/index.js +0 -1
  13. package/{build → dist}/instrumentation.js +0 -1
  14. package/{build → dist}/literal.d.ts +1 -1
  15. package/{build → dist}/literal.d.ts.map +1 -1
  16. package/{build → dist}/literal.js +7 -7
  17. package/{build → dist}/lookup/lookup.d.ts.map +1 -1
  18. package/{build → dist}/lookup/lookup.js +6 -4
  19. package/dist/query.d.ts.map +1 -0
  20. package/{build → dist}/query.js +58 -8
  21. package/{build → dist}/search/query-mode.js +2 -3
  22. package/{build → dist}/terms.d.ts +1 -1
  23. package/{build → dist}/terms.js +2 -3
  24. package/{build/server-test.d.ts → dist/test-utils.d.ts} +1 -1
  25. package/dist/test-utils.d.ts.map +1 -0
  26. package/{build/server-test.js → dist/test-utils.js} +2 -3
  27. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  28. package/eslint.config.mjs +22 -0
  29. package/package.json +37 -41
  30. package/src/catalog.ts +157 -0
  31. package/src/config.ts +24 -0
  32. package/src/distributions.ts +94 -0
  33. package/src/helpers/logger-pino.ts +45 -0
  34. package/src/helpers/logger.ts +52 -0
  35. package/src/index.ts +12 -0
  36. package/src/instrumentation.ts +51 -0
  37. package/src/literal.ts +42 -0
  38. package/src/lookup/lookup.ts +147 -0
  39. package/src/query.ts +302 -0
  40. package/src/search/query-mode.ts +54 -0
  41. package/src/terms.ts +141 -0
  42. package/src/test-utils.ts +207 -0
  43. package/test/fixtures/terms.ttl +46 -0
  44. package/test/query.test.ts +68 -0
  45. package/test/search/query-mode.test.ts +71 -0
  46. package/tsconfig.json +13 -0
  47. package/tsconfig.lib.json +20 -0
  48. package/tsconfig.test.json +27 -0
  49. package/vite.config.ts +26 -0
  50. package/build/catalog.js.map +0 -1
  51. package/build/config.d.ts.map +0 -1
  52. package/build/config.js.map +0 -1
  53. package/build/distributions.js.map +0 -1
  54. package/build/helpers/logger-pino.js.map +0 -1
  55. package/build/helpers/logger.js.map +0 -1
  56. package/build/index.js.map +0 -1
  57. package/build/instrumentation.js.map +0 -1
  58. package/build/literal.js.map +0 -1
  59. package/build/lookup/lookup.js.map +0 -1
  60. package/build/query.d.ts.map +0 -1
  61. package/build/query.js.map +0 -1
  62. package/build/search/query-mode.js.map +0 -1
  63. package/build/server-test.d.ts.map +0 -1
  64. package/build/server-test.js.map +0 -1
  65. package/build/terms.js.map +0 -1
  66. /package/{build → dist}/catalog.d.ts +0 -0
  67. /package/{build → dist}/config.d.ts +0 -0
  68. /package/{build → dist}/distributions.d.ts +0 -0
  69. /package/{build → dist}/helpers/logger-pino.d.ts +0 -0
  70. /package/{build → dist}/helpers/logger.d.ts +0 -0
  71. /package/{build → dist}/helpers/logger.d.ts.map +0 -0
  72. /package/{build → dist}/index.d.ts +0 -0
  73. /package/{build → dist}/instrumentation.d.ts +0 -0
  74. /package/{build → dist}/instrumentation.d.ts.map +0 -0
  75. /package/{build → dist}/lookup/lookup.d.ts +0 -0
  76. /package/{build → dist}/query.d.ts +0 -0
  77. /package/{build → dist}/search/query-mode.d.ts +0 -0
  78. /package/{build → dist}/search/query-mode.d.ts.map +0 -0
  79. /package/{build → dist}/terms.d.ts.map +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ ## 6.2.10 (2026-01-29)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **query:** extend workaround for Comunica v5 initialBindings bug to VALUES clauses ([#1703](https://github.com/netwerk-digitaal-erfgoed/network-of-terms/pull/1703))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - David de Boer @ddeboer
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,qBAAa,OAAO;IAGN,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC;IAFrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmB;gBAE9B,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC;IAIrD;;OAEG;IACI,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS;IAQ9C,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,EAAE;IAMxD,2BAA2B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS;IAM1D,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS;IAUlD,gCAAgC,CACrC,WAAW,EAAE,WAAW,GACvB,YAAY,EAAE;IAWjB;;OAEG;IACI,YAAY,IAAI,MAAM,EAAE;IAU/B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAcpC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtD,qBAAa,OAAO;IAEhB,QAAQ,CAAC,GAAG,EAAE,GAAG;IACjB,QAAQ,CAAC,IAAI,EAAE,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,gBAAgB;IACtC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACtB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,MAAM;IACjC,QAAQ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AU,CAAC,OAAO,EAAE,WAAW;CAGvC;AAED,qBAAa,OAAO;IAEhB,QAAQ,CAAC,IAAI,EAAE,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,GAAG;gBADR,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,GAAG;CAEpB;AAED,oBAAY,WAAW;IACrB,cAAc,uDAAuD;CACtE;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE9C,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC"}
@@ -9,13 +9,13 @@ export class Catalog {
9
9
  * Get dataset by IRI, accepting distribution IRIs too for BC.
10
10
  */
11
11
  getDatasetByIri(iri) {
12
- return (this.datasets.find(dataset => dataset.iri.toString() === iri.toString()) ?? this.getDatasetByDistributionIri(iri));
12
+ return (this.datasets.find((dataset) => dataset.iri.toString() === iri.toString()) ?? this.getDatasetByDistributionIri(iri));
13
13
  }
14
14
  getDatasetsSortedByName(languageCode) {
15
15
  return [...this.datasets].sort((a, b) => a.name[languageCode].localeCompare(b.name[languageCode]));
16
16
  }
17
17
  getDatasetByDistributionIri(iri) {
18
- return this.datasets.find(dataset => dataset.getDistributionByIri(iri) !== undefined);
18
+ return this.datasets.find((dataset) => dataset.getDistributionByIri(iri) !== undefined);
19
19
  }
20
20
  getDatasetByTermIri(iri) {
21
21
  for (const [prefix, datasetIri] of this.prefixToDataset) {
@@ -29,7 +29,7 @@ export class Catalog {
29
29
  return this.datasets.reduce((acc, dataset) => {
30
30
  return [
31
31
  ...acc,
32
- ...dataset.distributions.filter(distribution => distribution.hasFeature(featureType)),
32
+ ...dataset.distributions.filter((distribution) => distribution.hasFeature(featureType)),
33
33
  ];
34
34
  }, []);
35
35
  }
@@ -52,7 +52,7 @@ export class Catalog {
52
52
  return new Map([
53
53
  ...this.datasets
54
54
  .reduce((acc, dataset) => {
55
- dataset.termsPrefixes.forEach(prefix => {
55
+ dataset.termsPrefixes.forEach((prefix) => {
56
56
  acc.set(prefix.toString(), dataset.iri);
57
57
  });
58
58
  return acc;
@@ -85,10 +85,10 @@ export class Dataset {
85
85
  this.alternateName = alternateName;
86
86
  }
87
87
  getSparqlDistribution() {
88
- return this.distributions.find(distribution => distribution instanceof SparqlDistribution);
88
+ return this.distributions.find((distribution) => distribution instanceof SparqlDistribution);
89
89
  }
90
90
  getDistributionByIri(iri) {
91
- return this.distributions.find(distribution => distribution.iri.toString() === iri.toString());
91
+ return this.distributions.find((distribution) => distribution.iri.toString() === iri.toString());
92
92
  }
93
93
  }
94
94
  export class Organization {
@@ -130,4 +130,3 @@ export var FeatureType;
130
130
  (function (FeatureType) {
131
131
  FeatureType["RECONCILIATION"] = "https://reconciliation-api.github.io/specs/latest/";
132
132
  })(FeatureType || (FeatureType = {}));
133
- //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,YAAY,CAAC;AAgBvD,UAAU,GAAG;IACX,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,GAAG,CAErC,CAAC"}
@@ -15,4 +15,3 @@ const schema = {
15
15
  export const config = envSchema({
16
16
  schema,
17
17
  });
18
- //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"distributions.d.ts","sourceRoot":"","sources":["../src/distributions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEnD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAoB,aAAa,EAAC,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,OAAO,EAAE,GAAG,EAAC,MAAM,cAAc,CAAC;AAI1C,UAAU,gBAAgB;IACxB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eAAgB,SAAQ,gBAAgB;IACvD,OAAO,EAAE,GAAG,EAAE,CAAC;CAChB;AAiBD,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAc;gBAElB,OAAO,EAAE;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,WAAW,CAAC;KACxB;IAMK,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAsBpD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAiBnE"}
@@ -53,4 +53,3 @@ export class DistributionsService {
53
53
  return Promise.all(requests);
54
54
  }
55
55
  }
56
- //# sourceMappingURL=distributions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger-pino.d.ts","sourceRoot":"","sources":["../../src/helpers/logger-pino.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB;AAED,qBAAa,UAAW,SAAQ,MAAM;IACpC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;gBAElB,OAAO,EAAE,kBAAkB;IAMvC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKvC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;CAGxC"}
1
+ {"version":3,"file":"logger-pino.d.ts","sourceRoot":"","sources":["../../src/helpers/logger-pino.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB;AAED,qBAAa,UAAW,SAAQ,MAAM;IACpC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;gBAElB,OAAO,EAAE,kBAAkB;IAMvC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKvC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAKxC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;CAGxC"}
@@ -30,4 +30,3 @@ export class LoggerPino extends Logger {
30
30
  this.logger.warn(message, data);
31
31
  }
32
32
  }
33
- //# sourceMappingURL=logger-pino.js.map
@@ -41,4 +41,3 @@ export function getHttpLogger(options) {
41
41
  level: args.level,
42
42
  });
43
43
  }
44
- //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,QAAQ,kEAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,eAAO,MAAM,QAAQ,kEAA0B,CAAC"}
@@ -8,4 +8,3 @@ export * from './distributions.js';
8
8
  export * from './helpers/logger.js';
9
9
  import { QueryEngine } from '@comunica/query-sparql';
10
10
  export const comunica = () => new QueryEngine();
11
- //# sourceMappingURL=index.js.map
@@ -27,4 +27,3 @@ export const sourceQueriesHistogram = meter.createHistogram(sourceQueriesHistogr
27
27
  valueType: ValueType.INT,
28
28
  unit: 'ms',
29
29
  });
30
- //# sourceMappingURL=instrumentation.js.map
@@ -1,5 +1,5 @@
1
1
  import * as RDF from '@rdfjs/types';
2
- export declare function filterLiteralsByLanguage(literals: RDF.Literal[], languages: string[]): RDF.Literal[];
2
+ export declare function filterLiteralsByLanguage(literals: RDF.Literal[], languages: string[]): RDF.Literal[] | import("rdf-data-factory").Literal[];
3
3
  /**
4
4
  * Return value from {@link Literal} in the given languages.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../src/literal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAGpC,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,EACvB,SAAS,EAAE,MAAM,EAAE,iBAapB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,EACvB,SAAS,GAAE,MAAM,EAAW,YAW7B"}
1
+ {"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../src/literal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAKpC,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,EACvB,SAAS,EAAE,MAAM,EAAE,wDAapB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,EACvB,SAAS,GAAE,MAAM,EAAW,YAW7B"}
@@ -1,13 +1,14 @@
1
- import Literal from '@rdfjs/data-model/lib/Literal.js';
1
+ import { DataFactory } from 'rdf-data-factory';
2
+ const dataFactory = new DataFactory();
2
3
  export function filterLiteralsByLanguage(literals, languages) {
3
- const preferredLanguageLiterals = literals.filter(literal => languages.includes(literal.language));
4
+ const preferredLanguageLiterals = literals.filter((literal) => languages.includes(literal.language));
4
5
  if (preferredLanguageLiterals.length > 0) {
5
6
  return preferredLanguageLiterals;
6
7
  }
7
8
  // If literal has no language tag, we assume it is in the Network of Terms’ default language, Dutch.
8
9
  return literals
9
- .filter(literal => literal.language === '')
10
- .map(literal => new Literal(literal.value, 'nl'));
10
+ .filter((literal) => literal.language === '')
11
+ .map((literal) => dataFactory.literal(literal.value, 'nl'));
11
12
  }
12
13
  /**
13
14
  * Return value from {@link Literal} in the given languages.
@@ -18,9 +19,8 @@ export function filterLiteralsByLanguage(literals, languages) {
18
19
  export function literalValues(literals, languages = ['nl']) {
19
20
  const languageLiterals = filterLiteralsByLanguage(literals, languages);
20
21
  if (languageLiterals.length > 0) {
21
- return languageLiterals.map(literal => literal.value);
22
+ return languageLiterals.map((literal) => literal.value);
22
23
  }
23
24
  // Fall back to English for sources that provide no Dutch labels.
24
- return filterLiteralsByLanguage(literals, ['en']).map(literal => literal.value);
25
+ return filterLiteralsByLanguage(literals, ['en']).map((literal) => literal.value);
25
26
  }
26
- //# sourceMappingURL=literal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/lookup/lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAW,YAAY,EAAM,MAAM,eAAe,CAAC;AAClE,OAAO,EAEL,iBAAiB,EACjB,WAAW,EAIX,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAGjC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IAErB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,mBAAmB,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,CAAC;AAE7E,qBAAa,mBAAmB;IAGlB,QAAQ,CAAC,GAAG,EAAE,MAAM;IAFhC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEJ,GAAG,EAAE,MAAM;CAGjC;AAED,qBAAa,aAAa;IAGZ,QAAQ,CAAC,GAAG,EAAE,MAAM;IAFhC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEJ,GAAG,EAAE,MAAM;CAGjC;AAED,qBAAa,aAAa;IAEtB,OAAO,CAAC,OAA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BAAiB,EAAE,CAAC;CAqFhC"}
@@ -60,10 +60,13 @@ export class LookupService {
60
60
  }
61
61
  return acc;
62
62
  }, new Map());
63
- return iris.map(iri => {
63
+ return iris.map((iri) => {
64
64
  const dataset = irisToDataset.get(iri.toString());
65
65
  if (dataset === undefined) {
66
- clientQueriesCounter.add(1, { type: 'lookup', error: 'SourceNotFound' });
66
+ clientQueriesCounter.add(1, {
67
+ type: 'lookup',
68
+ error: 'SourceNotFound',
69
+ });
67
70
  return {
68
71
  uri: iri,
69
72
  distribution: new SourceNotFoundError(iri),
@@ -86,7 +89,6 @@ function result(result, iri) {
86
89
  if (result instanceof Error) {
87
90
  return result;
88
91
  }
89
- return (result.terms.find(term => term.id.value === iri.toString()) ??
92
+ return (result.terms.find((term) => term.id.value === iri.toString()) ??
90
93
  new NotFoundError(iri));
91
94
  }
92
- //# sourceMappingURL=lookup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAkDrD,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,WAAW,CAAC;AAE7D,qBAAa,aAAa;IAEtB,QAAQ,CAAC,MAAM,EAAE,WAAW;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM;gBADtB,MAAM,EAAE,WAAW,EACnB,cAAc,EAAE,MAAM;CAElC;AAED,qBAAa,KAAK;IAEd,QAAQ,CAAC,YAAY,EAAE,YAAY;IACnC,QAAQ,CAAC,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YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAM,GACtC,OAAO,CAAC,aAAa,CAAC;CAuG1B"}
@@ -10,6 +10,46 @@ import { BindingsFactory } from '@comunica/utils-bindings-factory';
10
10
  import { DataFactory } from 'rdf-data-factory';
11
11
  import { sourceQueriesHistogram } from './instrumentation.js';
12
12
  import { config } from './config.js';
13
+ /**
14
+ * Check if a query requires string substitution instead of initialBindings.
15
+ * Workaround for Comunica v5 traqula bug that crashes with:
16
+ * - SERVICE clauses
17
+ * - VALUES combination
18
+ */
19
+ function requiresStringSubstitution(query) {
20
+ const hasService = /\bSERVICE\b/i.test(query);
21
+ const hasValues = /\bVALUES\b/i.test(query);
22
+ return hasService || hasValues;
23
+ }
24
+ /**
25
+ * Substitute bindings directly into a SPARQL query string.
26
+ * This is a workaround for Comunica v5's initialBindings bug with SERVICE clauses.
27
+ */
28
+ function substituteBindings(query, bindings) {
29
+ let result = query;
30
+ for (const [name, term] of Object.entries(bindings)) {
31
+ const pattern = new RegExp(`\\?${name}\\b`, 'g');
32
+ if (term.termType === 'NamedNode') {
33
+ result = result.replace(pattern, `<${term.value}>`);
34
+ }
35
+ else if (term.termType === 'Literal') {
36
+ const literal = term;
37
+ const datatype = literal.datatype?.value;
38
+ if (datatype &&
39
+ datatype !== 'http://www.w3.org/2001/XMLSchema#string' &&
40
+ datatype !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString') {
41
+ result = result.replace(pattern, `"${term.value}"^^<${datatype}>`);
42
+ }
43
+ else if (literal.language) {
44
+ result = result.replace(pattern, `"${term.value}"@${literal.language}`);
45
+ }
46
+ else {
47
+ result = result.replace(pattern, `"${term.value}"`);
48
+ }
49
+ }
50
+ }
51
+ return result;
52
+ }
13
53
  export class TermsResponse {
14
54
  result;
15
55
  responseTimeMs;
@@ -80,7 +120,7 @@ export class QueryTermsService {
80
120
  queryWithLimit, distribution, timeoutMs, bindingsWithLimit);
81
121
  }
82
122
  async lookup(iris, distribution, timeoutMs) {
83
- return this.run(distribution.lookupQuery.replace('?uris', iris.map(iri => `<${iri}>`).join(' ')), distribution, timeoutMs);
123
+ return this.run(distribution.lookupQuery.replace('?uris', iris.map((iri) => `<${iri}>`).join(' ')), distribution, timeoutMs);
84
124
  }
85
125
  async run(query, distribution, timeoutMs, bindings = {}) {
86
126
  Joi.attempt(timeoutMs, Joi.number()
@@ -92,10 +132,18 @@ export class QueryTermsService {
92
132
  const logger = new LoggerPino({ logger: this.logger });
93
133
  // Extract HTTP credentials if the distribution URL contains any.
94
134
  const url = new URL(distribution.endpoint.toString());
95
- this.logger.info(`Querying "${url}" with "${query}"...`);
96
- const quadStream = await this.engine.queryQuads(query, {
135
+ // Workaround for https://github.com/comunica/comunica/issues/1655, so use
136
+ // string substitution instead of initialBindings for:
137
+ // - SERVICE clauses crash with initialBindings
138
+ // - VALUES crashes in some combinations
139
+ const useStringSubstitution = requiresStringSubstitution(query);
140
+ const finalQuery = useStringSubstitution
141
+ ? substituteBindings(query, bindings)
142
+ : query;
143
+ this.logger.info(`Querying "${url}" with "${finalQuery}"...`);
144
+ const quadStream = await this.engine.queryQuads(finalQuery, {
97
145
  log: logger,
98
- httpAuth: url.username === '' ? '' : url.username + ':' + url.password,
146
+ httpAuth: url.username === '' ? undefined : url.username + ':' + url.password,
99
147
  httpTimeout: timeoutMs,
100
148
  noCache: true,
101
149
  sources: [
@@ -104,11 +152,14 @@ export class QueryTermsService {
104
152
  value: url.origin + url.pathname,
105
153
  },
106
154
  ],
107
- initialBindings: bindingsFactory.fromRecord(bindings),
155
+ // Only pass initialBindings when NOT using string substitution
156
+ ...(useStringSubstitution
157
+ ? {}
158
+ : { initialBindings: bindingsFactory.fromRecord(bindings) }),
108
159
  });
109
- return new Promise(resolve => {
160
+ return new Promise((resolve) => {
110
161
  const termsTransformer = new TermsTransformer();
111
- quadStream.on('error', error => {
162
+ quadStream.on('error', (error) => {
112
163
  const elapsed = Math.round(timer.elapsed());
113
164
  this.logger.error(`An error occurred when querying "${distribution.endpoint}": ${error} with %o`, error);
114
165
  if (error.message.startsWith('Fetch timed out')) {
@@ -164,4 +215,3 @@ const alphabeticallyByLabels = (a, b) => {
164
215
  const dataFactory = new DataFactory();
165
216
  const bindingsFactory = new BindingsFactory(dataFactory);
166
217
  const obfuscateHttpCredentials = (message) => message.replace(/(https?):\/\/.+:.+@/, '$1://***@');
167
- //# sourceMappingURL=query.js.map
@@ -24,8 +24,8 @@ const split = (query) => query.split(/\s+/);
24
24
  /**
25
25
  * Quote parts that are not boolean operators.
26
26
  */
27
- const quote = (queryParts) => queryParts.map(part => (isBooleanOperator(part) ? part : `'${part}'`));
28
- const filterStopWords = (queryParts) => queryParts.filter(part => part !== '&');
27
+ const quote = (queryParts) => queryParts.map((part) => (isBooleanOperator(part) ? part : `'${part}'`));
28
+ const filterStopWords = (queryParts) => queryParts.filter((part) => part !== '&');
29
29
  /**
30
30
  * Join query parts with boolean AND if they are not yet connected with a boolean.
31
31
  */
@@ -37,4 +37,3 @@ const join = (queryParts) => queryParts.reduce((previousValue, currentValue, cur
37
37
  return `${previousValue} ${currentValue}`;
38
38
  });
39
39
  const isBooleanOperator = (maybeBool) => maybeBool.toLowerCase() === 'and' || maybeBool.toLowerCase() === 'or';
40
- //# sourceMappingURL=query-mode.js.map
@@ -1,4 +1,4 @@
1
- import * as RDF from '@rdfjs/types';
1
+ import type RDF from '@rdfjs/types';
2
2
  export declare class Term {
3
3
  readonly id: RDF.Term;
4
4
  readonly type: RDF.Term | undefined;
@@ -94,7 +94,7 @@ export class TermsTransformer {
94
94
  const propertyValue = currentTerm[propertyName]; // eslint-disable-line @typescript-eslint/no-explicit-any
95
95
  if (Array.isArray(propertyValue)) {
96
96
  // Prevent duplicate prefLabel values due to duplicate quads.
97
- if (!propertyValue.find(value => value.equals(quad.object))) {
97
+ if (!propertyValue.find((value) => value.equals(quad.object))) {
98
98
  propertyValue.push(quad.object);
99
99
  }
100
100
  }
@@ -104,7 +104,7 @@ export class TermsTransformer {
104
104
  }
105
105
  }
106
106
  asArray() {
107
- return [...this.termsIris].map(iri => {
107
+ return [...this.termsIris].map((iri) => {
108
108
  const term = this.termsMap.get(iri);
109
109
  return new Term(term.id, term.type, term.prefLabels, term.altLabels, term.hiddenLabels, term.scopeNotes, term.seeAlso, this.mapRelatedTerms(term.broaderTerms).sort(alphabeticallyByPrefLabel), this.mapRelatedTerms(term.narrowerTerms).sort(alphabeticallyByPrefLabel), this.mapRelatedTerms(term.relatedTerms).sort(alphabeticallyByPrefLabel), this.mapRelatedTerms(term.exactMatches).sort(alphabeticallyByPrefLabel), term.inScheme, term.score);
110
110
  });
@@ -126,4 +126,3 @@ const alphabeticallyByPrefLabel = (a, b) => {
126
126
  const prefLabelB = b.prefLabels[0]?.value ?? '';
127
127
  return prefLabelA.localeCompare(prefLabelB);
128
128
  };
129
- //# sourceMappingURL=terms.js.map
@@ -2,4 +2,4 @@ import { Catalog } from './index.js';
2
2
  export declare const teardown: () => Promise<void>;
3
3
  export declare const testCatalog: (port: number) => Catalog;
4
4
  export declare function startDistributionSparqlEndpoint(port: number): Promise<void>;
5
- //# sourceMappingURL=server-test.d.ts.map
5
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAMR,MAAM,YAAY,CAAC;AAapB,eAAO,MAAM,QAAQ,qBAEpB,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,YAyKpC,CAAC;AAEL,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAQf"}
@@ -93,14 +93,13 @@ export const testCatalog = (port) => new Catalog([
93
93
  ], ['http://data.beeldengeluid.nl/gtaa/'], 'https://example.com/gtaa', ['nl'], [
94
94
  new Organization('https://www.beeldengeluid.nl/', { nl: 'Nederlands Instituut voor Beeld en Geluid' }, { nl: 'Beeld en Geluid' }),
95
95
  ], [
96
- new SparqlDistribution('https://data.beeldengeluid.nl/id/datadownload/0026', 'https://username:password@gtaa.apis.beeldengeluid.nl/sparql', 'CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }', 'CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }'),
96
+ new SparqlDistribution('https://data.beeldengeluid.nl/id/datadownload/0026', 'https://username:password@gtaa.apis.beeldengeluid.nl/sparql', 'CONSTRUCT { ?s ?p ?o } WHERE { ?s skos:inScheme ?datasetUri ; ?p ?o }', 'CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }'),
97
97
  ]),
98
98
  ]);
99
99
  export async function startDistributionSparqlEndpoint(port) {
100
100
  servers = await setup({
101
- command: `npx comunica-sparql-file-http ${dirname(fileURLToPath(import.meta.url))}/../test/fixtures/terms.ttl -p ${port}`,
101
+ command: `npx --no comunica-sparql-file-http ${dirname(fileURLToPath(import.meta.url))}/../test/fixtures/terms.ttl -p ${port}`,
102
102
  port,
103
103
  launchTimeout: 20000,
104
104
  });
105
105
  }
106
- //# sourceMappingURL=server-test.js.map