@twin.org/federated-catalogue-service 0.0.2-next.6 → 0.0.3-next.2

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 (61) hide show
  1. package/dist/es/entities/dataset.js +255 -0
  2. package/dist/es/entities/dataset.js.map +1 -0
  3. package/dist/es/federatedCatalogueRoutes.js +182 -0
  4. package/dist/es/federatedCatalogueRoutes.js.map +1 -0
  5. package/dist/es/index.js +10 -0
  6. package/dist/es/index.js.map +1 -0
  7. package/dist/es/models/IFederatedCatalogueServiceConstructorOptions.js +2 -0
  8. package/dist/es/models/IFederatedCatalogueServiceConstructorOptions.js.map +1 -0
  9. package/dist/es/restEntryPoints.js +10 -0
  10. package/dist/es/restEntryPoints.js.map +1 -0
  11. package/dist/es/schema.js +11 -0
  12. package/dist/es/schema.js.map +1 -0
  13. package/dist/es/services/federatedCatalogueService.js +218 -0
  14. package/dist/es/services/federatedCatalogueService.js.map +1 -0
  15. package/dist/es/utils/datasetConverters.js +20 -0
  16. package/dist/es/utils/datasetConverters.js.map +1 -0
  17. package/dist/types/entities/dataset.d.ts +128 -0
  18. package/dist/types/federatedCatalogueRoutes.d.ts +4 -105
  19. package/dist/types/index.d.ts +7 -10
  20. package/dist/types/models/IFederatedCatalogueServiceConstructorOptions.d.ts +6 -30
  21. package/dist/types/schema.d.ts +1 -1
  22. package/dist/types/services/federatedCatalogueService.d.ts +52 -0
  23. package/dist/types/utils/datasetConverters.d.ts +17 -0
  24. package/docs/changelog.md +4 -267
  25. package/docs/open-api/spec.json +2117 -2325
  26. package/docs/reference/classes/Dataset.md +255 -0
  27. package/docs/reference/classes/FederatedCatalogueService.md +50 -260
  28. package/docs/reference/functions/datasetEntityToModel.md +20 -0
  29. package/docs/reference/functions/datasetModelToEntity.md +21 -0
  30. package/docs/reference/functions/generateRestRoutesFederatedCatalogue.md +4 -4
  31. package/docs/reference/functions/initSchema.md +1 -1
  32. package/docs/reference/index.md +3 -17
  33. package/docs/reference/interfaces/IFederatedCatalogueServiceConstructorOptions.md +7 -71
  34. package/locales/en.json +9 -15
  35. package/package.json +8 -14
  36. package/dist/cjs/index.cjs +0 -2209
  37. package/dist/esm/index.mjs +0 -2191
  38. package/dist/types/entities/dataResourceEntry.d.ts +0 -64
  39. package/dist/types/entities/dataSpaceConnectorEntry.d.ts +0 -71
  40. package/dist/types/entities/participantEntry.d.ts +0 -47
  41. package/dist/types/entities/serviceOfferingEntry.d.ts +0 -60
  42. package/dist/types/federatedCatalogueService.d.ts +0 -93
  43. package/dist/types/models/IFederatedCatalogueServiceConfig.d.ts +0 -15
  44. package/dist/types/verification/complianceCredentialVerificationService.d.ts +0 -32
  45. package/docs/reference/classes/DataResourceEntry.md +0 -126
  46. package/docs/reference/classes/DataSpaceConnectorEntry.md +0 -141
  47. package/docs/reference/classes/ParticipantEntry.md +0 -93
  48. package/docs/reference/classes/ServiceOfferingEntry.md +0 -117
  49. package/docs/reference/functions/complianceCredentialPresentation.md +0 -37
  50. package/docs/reference/functions/dataResourceCredentialPresentation.md +0 -37
  51. package/docs/reference/functions/dataResourceGet.md +0 -31
  52. package/docs/reference/functions/dataResourceList.md +0 -31
  53. package/docs/reference/functions/dataSpaceConnectorCredentialPresentation.md +0 -37
  54. package/docs/reference/functions/dataSpaceConnectorGet.md +0 -31
  55. package/docs/reference/functions/dataSpaceConnectorList.md +0 -31
  56. package/docs/reference/functions/participantGet.md +0 -31
  57. package/docs/reference/functions/participantList.md +0 -31
  58. package/docs/reference/functions/serviceOfferingCredentialPresentation.md +0 -37
  59. package/docs/reference/functions/serviceOfferingGet.md +0 -31
  60. package/docs/reference/functions/serviceOfferingList.md +0 -31
  61. package/docs/reference/interfaces/IFederatedCatalogueServiceConfig.md +0 -21
@@ -0,0 +1,255 @@
1
+ // Copyright 2025 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { entity, property } from "@twin.org/entity";
4
+ /**
5
+ * Class describing a DCAT dataset for entity storage.
6
+ * This wrapper enables efficient database indexing and querying while preserving
7
+ * the full IDataset JSON-LD structure.
8
+ */
9
+ let Dataset = class Dataset {
10
+ /**
11
+ * The unique identifier for the dataset (@id from JSON-LD).
12
+ */
13
+ "@id";
14
+ /**
15
+ * The JSON-LD context for the dataset.
16
+ */
17
+ "@context";
18
+ /**
19
+ * The type of the resource (typically "Dataset").
20
+ */
21
+ "@type";
22
+ /**
23
+ * A name given to the resource.
24
+ */
25
+ "dcterms:title";
26
+ /**
27
+ * A free-text account of the resource.
28
+ */
29
+ "dcterms:description";
30
+ /**
31
+ * A unique identifier of the resource.
32
+ */
33
+ "dcterms:identifier";
34
+ /**
35
+ * Date of formal issuance (publication) of the resource.
36
+ */
37
+ "dcterms:issued";
38
+ /**
39
+ * Most recent date on which the resource was changed, updated or modified.
40
+ */
41
+ "dcterms:modified";
42
+ /**
43
+ * A language of the resource.
44
+ */
45
+ "dcterms:language";
46
+ /**
47
+ * An entity responsible for making the resource available.
48
+ */
49
+ "dcterms:publisher";
50
+ /**
51
+ * An entity responsible for producing the resource.
52
+ */
53
+ "dcterms:creator";
54
+ /**
55
+ * Information about who can access the resource or an indication of its security status.
56
+ */
57
+ "dcterms:accessRights";
58
+ /**
59
+ * A legal document under which the resource is made available.
60
+ */
61
+ "dcterms:license";
62
+ /**
63
+ * Information about rights held in and over the resource.
64
+ */
65
+ "dcterms:rights";
66
+ /**
67
+ * An established standard to which the resource conforms.
68
+ */
69
+ "dcterms:conformsTo";
70
+ /**
71
+ * The nature or genre of the resource.
72
+ */
73
+ "dcterms:type";
74
+ /**
75
+ * Relevant contact information for the catalogued resource.
76
+ */
77
+ "dcat:contactPoint";
78
+ /**
79
+ * A keyword or tag describing the resource.
80
+ */
81
+ "dcat:keyword";
82
+ /**
83
+ * A main category of the resource. A resource can have multiple themes.
84
+ */
85
+ "dcat:theme";
86
+ /**
87
+ * A Web page that can be navigated to gain access to the resource.
88
+ */
89
+ "dcat:landingPage";
90
+ /**
91
+ * Link to a description of a relationship with another resource.
92
+ */
93
+ "dcat:qualifiedRelation";
94
+ /**
95
+ * An ODRL conformant policy expressing the rights associated with the resource.
96
+ */
97
+ "odrl:hasPolicy";
98
+ /**
99
+ * An available distribution of the dataset.
100
+ */
101
+ "dcat:distribution";
102
+ /**
103
+ * The frequency at which the dataset is published.
104
+ */
105
+ "dcterms:accrualPeriodicity";
106
+ /**
107
+ * A dataset series of which the dataset is part.
108
+ */
109
+ "dcat:inSeries";
110
+ /**
111
+ * The geographical area covered by the dataset.
112
+ */
113
+ "dcterms:spatial";
114
+ /**
115
+ * Minimum spatial separation resolvable in a dataset, measured in meters.
116
+ */
117
+ "dcat:spatialResolutionInMeters";
118
+ /**
119
+ * The temporal period that the dataset covers.
120
+ */
121
+ "dcterms:temporal";
122
+ /**
123
+ * Minimum time period resolvable in the dataset.
124
+ */
125
+ "dcat:temporalResolution";
126
+ /**
127
+ * An activity that generated, or provides the business context for, the creation of the dataset.
128
+ */
129
+ "prov:wasGeneratedBy";
130
+ };
131
+ __decorate([
132
+ property({ type: "string", isPrimary: true }),
133
+ __metadata("design:type", String)
134
+ ], Dataset.prototype, "@id", void 0);
135
+ __decorate([
136
+ property({ type: "object" }),
137
+ __metadata("design:type", Object)
138
+ ], Dataset.prototype, "@context", void 0);
139
+ __decorate([
140
+ property({ type: "string" }),
141
+ __metadata("design:type", Object)
142
+ ], Dataset.prototype, "@type", void 0);
143
+ __decorate([
144
+ property({ type: "object", optional: true }),
145
+ __metadata("design:type", Object)
146
+ ], Dataset.prototype, "dcterms:title", void 0);
147
+ __decorate([
148
+ property({ type: "object", optional: true }),
149
+ __metadata("design:type", Object)
150
+ ], Dataset.prototype, "dcterms:description", void 0);
151
+ __decorate([
152
+ property({ type: "object", optional: true }),
153
+ __metadata("design:type", Object)
154
+ ], Dataset.prototype, "dcterms:identifier", void 0);
155
+ __decorate([
156
+ property({ type: "string", optional: true }),
157
+ __metadata("design:type", Object)
158
+ ], Dataset.prototype, "dcterms:issued", void 0);
159
+ __decorate([
160
+ property({ type: "string", optional: true }),
161
+ __metadata("design:type", Object)
162
+ ], Dataset.prototype, "dcterms:modified", void 0);
163
+ __decorate([
164
+ property({ type: "object", optional: true }),
165
+ __metadata("design:type", Object)
166
+ ], Dataset.prototype, "dcterms:language", void 0);
167
+ __decorate([
168
+ property({ type: "object", optional: true }),
169
+ __metadata("design:type", Object)
170
+ ], Dataset.prototype, "dcterms:publisher", void 0);
171
+ __decorate([
172
+ property({ type: "object", optional: true }),
173
+ __metadata("design:type", Object)
174
+ ], Dataset.prototype, "dcterms:creator", void 0);
175
+ __decorate([
176
+ property({ type: "object", optional: true }),
177
+ __metadata("design:type", Object)
178
+ ], Dataset.prototype, "dcterms:accessRights", void 0);
179
+ __decorate([
180
+ property({ type: "object", optional: true }),
181
+ __metadata("design:type", Object)
182
+ ], Dataset.prototype, "dcterms:license", void 0);
183
+ __decorate([
184
+ property({ type: "object", optional: true }),
185
+ __metadata("design:type", Object)
186
+ ], Dataset.prototype, "dcterms:rights", void 0);
187
+ __decorate([
188
+ property({ type: "object", optional: true }),
189
+ __metadata("design:type", Object)
190
+ ], Dataset.prototype, "dcterms:conformsTo", void 0);
191
+ __decorate([
192
+ property({ type: "string", optional: true }),
193
+ __metadata("design:type", Object)
194
+ ], Dataset.prototype, "dcterms:type", void 0);
195
+ __decorate([
196
+ property({ type: "object", optional: true }),
197
+ __metadata("design:type", Object)
198
+ ], Dataset.prototype, "dcat:contactPoint", void 0);
199
+ __decorate([
200
+ property({ type: "object", optional: true }),
201
+ __metadata("design:type", Object)
202
+ ], Dataset.prototype, "dcat:keyword", void 0);
203
+ __decorate([
204
+ property({ type: "object", optional: true }),
205
+ __metadata("design:type", Object)
206
+ ], Dataset.prototype, "dcat:theme", void 0);
207
+ __decorate([
208
+ property({ type: "object", optional: true }),
209
+ __metadata("design:type", Object)
210
+ ], Dataset.prototype, "dcat:landingPage", void 0);
211
+ __decorate([
212
+ property({ type: "object", optional: true }),
213
+ __metadata("design:type", Object)
214
+ ], Dataset.prototype, "dcat:qualifiedRelation", void 0);
215
+ __decorate([
216
+ property({ type: "object", optional: true }),
217
+ __metadata("design:type", Object)
218
+ ], Dataset.prototype, "odrl:hasPolicy", void 0);
219
+ __decorate([
220
+ property({ type: "object", optional: true }),
221
+ __metadata("design:type", Object)
222
+ ], Dataset.prototype, "dcat:distribution", void 0);
223
+ __decorate([
224
+ property({ type: "string", optional: true }),
225
+ __metadata("design:type", Object)
226
+ ], Dataset.prototype, "dcterms:accrualPeriodicity", void 0);
227
+ __decorate([
228
+ property({ type: "string", optional: true }),
229
+ __metadata("design:type", Object)
230
+ ], Dataset.prototype, "dcat:inSeries", void 0);
231
+ __decorate([
232
+ property({ type: "object", optional: true }),
233
+ __metadata("design:type", Object)
234
+ ], Dataset.prototype, "dcterms:spatial", void 0);
235
+ __decorate([
236
+ property({ type: "object", optional: true }),
237
+ __metadata("design:type", Object)
238
+ ], Dataset.prototype, "dcat:spatialResolutionInMeters", void 0);
239
+ __decorate([
240
+ property({ type: "object", optional: true }),
241
+ __metadata("design:type", Object)
242
+ ], Dataset.prototype, "dcterms:temporal", void 0);
243
+ __decorate([
244
+ property({ type: "object", optional: true }),
245
+ __metadata("design:type", Object)
246
+ ], Dataset.prototype, "dcat:temporalResolution", void 0);
247
+ __decorate([
248
+ property({ type: "object", optional: true }),
249
+ __metadata("design:type", Object)
250
+ ], Dataset.prototype, "prov:wasGeneratedBy", void 0);
251
+ Dataset = __decorate([
252
+ entity()
253
+ ], Dataset);
254
+ export { Dataset };
255
+ //# sourceMappingURL=dataset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../../src/entities/dataset.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;GAIG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAO;IACnB;;OAEG;IAEI,KAAK,C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AAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDAC0B;AAMhE;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACkB;AAnLnD,OAAO;IADnB,MAAM,EAAE;GACI,OAAO,CAoLnB","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { entity, property } from \"@twin.org/entity\";\nimport type { IDataset } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * Class describing a DCAT dataset for entity storage.\n * This wrapper enables efficient database indexing and querying while preserving\n * the full IDataset JSON-LD structure.\n */\n@entity()\nexport class Dataset {\n\t/**\n\t * The unique identifier for the dataset (@id from JSON-LD).\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic \"@id\"!: string;\n\n\t/**\n\t * The JSON-LD context for the dataset.\n\t */\n\t@property({ type: \"object\" })\n\tpublic \"@context\"!: IDataset[\"@context\"];\n\n\t/**\n\t * The type of the resource (typically \"Dataset\").\n\t */\n\t@property({ type: \"string\" })\n\tpublic \"@type\"!: IDataset[\"@type\"];\n\n\t/**\n\t * A name given to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:title\"?: IDataset[\"dcterms:title\"];\n\n\t/**\n\t * A free-text account of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:description\"?: IDataset[\"dcterms:description\"];\n\n\t/**\n\t * A unique identifier of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:identifier\"?: IDataset[\"dcterms:identifier\"];\n\n\t/**\n\t * Date of formal issuance (publication) of the resource.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:issued\"?: IDataset[\"dcterms:issued\"];\n\n\t/**\n\t * Most recent date on which the resource was changed, updated or modified.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:modified\"?: IDataset[\"dcterms:modified\"];\n\n\t/**\n\t * A language of the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:language\"?: IDataset[\"dcterms:language\"];\n\n\t/**\n\t * An entity responsible for making the resource available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:publisher\"?: IDataset[\"dcterms:publisher\"];\n\n\t/**\n\t * An entity responsible for producing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:creator\"?: IDataset[\"dcterms:creator\"];\n\n\t/**\n\t * Information about who can access the resource or an indication of its security status.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:accessRights\"?: IDataset[\"dcterms:accessRights\"];\n\n\t/**\n\t * A legal document under which the resource is made available.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:license\"?: IDataset[\"dcterms:license\"];\n\n\t/**\n\t * Information about rights held in and over the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:rights\"?: IDataset[\"dcterms:rights\"];\n\n\t/**\n\t * An established standard to which the resource conforms.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:conformsTo\"?: IDataset[\"dcterms:conformsTo\"];\n\n\t/**\n\t * The nature or genre of the resource.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:type\"?: IDataset[\"dcterms:type\"];\n\n\t/**\n\t * Relevant contact information for the catalogued resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:contactPoint\"?: IDataset[\"dcat:contactPoint\"];\n\n\t/**\n\t * A keyword or tag describing the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:keyword\"?: IDataset[\"dcat:keyword\"];\n\n\t/**\n\t * A main category of the resource. A resource can have multiple themes.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:theme\"?: IDataset[\"dcat:theme\"];\n\n\t/**\n\t * A Web page that can be navigated to gain access to the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:landingPage\"?: IDataset[\"dcat:landingPage\"];\n\n\t/**\n\t * Link to a description of a relationship with another resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:qualifiedRelation\"?: IDataset[\"dcat:qualifiedRelation\"];\n\n\t/**\n\t * An ODRL conformant policy expressing the rights associated with the resource.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"odrl:hasPolicy\"?: IDataset[\"odrl:hasPolicy\"];\n\n\t/**\n\t * An available distribution of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:distribution\"?: IDataset[\"dcat:distribution\"];\n\n\t/**\n\t * The frequency at which the dataset is published.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcterms:accrualPeriodicity\"?: IDataset[\"dcterms:accrualPeriodicity\"];\n\n\t/**\n\t * A dataset series of which the dataset is part.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic \"dcat:inSeries\"?: IDataset[\"dcat:inSeries\"];\n\n\t/**\n\t * The geographical area covered by the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:spatial\"?: IDataset[\"dcterms:spatial\"];\n\n\t/**\n\t * Minimum spatial separation resolvable in a dataset, measured in meters.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:spatialResolutionInMeters\"?: IDataset[\"dcat:spatialResolutionInMeters\"];\n\n\t/**\n\t * The temporal period that the dataset covers.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcterms:temporal\"?: IDataset[\"dcterms:temporal\"];\n\n\t/**\n\t * Minimum time period resolvable in the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"dcat:temporalResolution\"?: IDataset[\"dcat:temporalResolution\"];\n\n\t/**\n\t * An activity that generated, or provides the business context for, the creation of the dataset.\n\t */\n\t@property({ type: \"object\", optional: true })\n\tpublic \"prov:wasGeneratedBy\"?: IDataset[\"prov:wasGeneratedBy\"];\n}\n"]}
@@ -0,0 +1,182 @@
1
+ import { ComponentFactory, Guards } from "@twin.org/core";
2
+ import { FederatedCatalogueContexts } from "@twin.org/federated-catalogue-models";
3
+ import { CatalogTypes, DataspaceProtocolContexts } from "@twin.org/standards-dataspace-protocol";
4
+ import { DublinCoreContexts } from "@twin.org/standards-dublin-core";
5
+ import { DcatClasses, DcatContexts } from "@twin.org/standards-w3c-dcat";
6
+ /**
7
+ * The source used when communicating about these routes.
8
+ */
9
+ const ROUTES_SOURCE = "federatedCatalogueRoutes";
10
+ /**
11
+ * The tag to associate with the routes.
12
+ */
13
+ export const tagsFederatedCatalogue = [
14
+ {
15
+ name: "Federated Catalogue",
16
+ description: "Service providing Dataspace Protocol-compliant catalogue endpoints for dataset discovery and query."
17
+ }
18
+ ];
19
+ /**
20
+ * The REST routes for federated catalogue.
21
+ * @param baseRouteName Prefix to prepend to the paths.
22
+ * @param componentName The name of the component to use in the routes stored in the ComponentFactory.
23
+ * @returns The generated routes.
24
+ */
25
+ export function generateRestRoutesFederatedCatalogue(baseRouteName, componentName) {
26
+ const catalogRequestRoute = {
27
+ operationId: "catalogRequest",
28
+ summary: "Query the federated catalogue for datasets",
29
+ tag: tagsFederatedCatalogue[0].name,
30
+ method: "POST",
31
+ path: `${baseRouteName}/request`,
32
+ handler: async (httpRequestContext, request) => catalogRequest(httpRequestContext, componentName, request),
33
+ requestType: {
34
+ type: "ICatalogRequestRequest",
35
+ examples: [
36
+ {
37
+ id: "catalogRequestExample",
38
+ request: {
39
+ body: {
40
+ "@context": [DataspaceProtocolContexts.ContextRoot],
41
+ "@type": CatalogTypes.CatalogRequestMessage,
42
+ filter: [
43
+ {
44
+ "dcterms:title": "Energy Consumption Data"
45
+ }
46
+ ]
47
+ }
48
+ }
49
+ },
50
+ {
51
+ id: "catalogRequestNoFilterExample",
52
+ request: {
53
+ body: {
54
+ "@context": [DataspaceProtocolContexts.ContextRoot],
55
+ "@type": CatalogTypes.CatalogRequestMessage
56
+ }
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ responseType: [
62
+ {
63
+ type: "ICatalogRequestResponse",
64
+ examples: [
65
+ {
66
+ id: "catalogRequestResponseExample",
67
+ response: {
68
+ body: {
69
+ "@context": [
70
+ DataspaceProtocolContexts.ContextRoot,
71
+ {
72
+ dcat: DcatContexts.ContextRoot,
73
+ dcterms: DublinCoreContexts.ContextTerms,
74
+ cursor: `${FederatedCatalogueContexts.ContextRoot}cursor`
75
+ }
76
+ ],
77
+ "@id": "urn:x-catalog:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2",
78
+ "@type": DcatClasses.Catalog,
79
+ participantId: "did:example:node-identity-123",
80
+ "dcat:dataset": [
81
+ {
82
+ "@id": "urn:uuid:dataset-123",
83
+ "@type": DcatClasses.Dataset,
84
+ "dcterms:title": "Energy Consumption Data",
85
+ "dcterms:description": "Historical energy consumption data"
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ }
91
+ ]
92
+ }
93
+ ]
94
+ };
95
+ const getDatasetRoute = {
96
+ operationId: "getDataset",
97
+ summary: "Retrieve a specific dataset by ID",
98
+ tag: tagsFederatedCatalogue[0].name,
99
+ method: "GET",
100
+ path: `${baseRouteName}/datasets/:datasetId`,
101
+ handler: async (httpRequestContext, request) => getDataset(httpRequestContext, componentName, request),
102
+ requestType: {
103
+ type: "IGetDatasetRequest",
104
+ examples: [
105
+ {
106
+ id: "getDatasetRequestExample",
107
+ request: {
108
+ pathParams: {
109
+ datasetId: "urn:uuid:dataset-123"
110
+ }
111
+ }
112
+ }
113
+ ]
114
+ },
115
+ responseType: [
116
+ {
117
+ type: "IGetDatasetResponse",
118
+ examples: [
119
+ {
120
+ id: "getDatasetResponseExample",
121
+ response: {
122
+ body: {
123
+ "@context": [
124
+ DataspaceProtocolContexts.ContextRoot,
125
+ {
126
+ dcat: DcatContexts.ContextRoot,
127
+ dcterms: DublinCoreContexts.ContextTerms
128
+ }
129
+ ],
130
+ "@id": "urn:uuid:dataset-123",
131
+ "@type": DcatClasses.Dataset,
132
+ "dcterms:title": "Energy Consumption Data",
133
+ "dcterms:description": "Historical energy consumption data"
134
+ }
135
+ }
136
+ }
137
+ ]
138
+ }
139
+ ]
140
+ };
141
+ return [catalogRequestRoute, getDatasetRoute];
142
+ }
143
+ /**
144
+ * Handle the catalog request operation.
145
+ * @param httpRequestContext The request context for the operation.
146
+ * @param componentName The name of the component to use.
147
+ * @param request The request.
148
+ * @returns The response.
149
+ */
150
+ async function catalogRequest(httpRequestContext, componentName, request) {
151
+ Guards.object(ROUTES_SOURCE, "request", request);
152
+ Guards.object(ROUTES_SOURCE, "request.body", request.body);
153
+ const component = ComponentFactory.get(componentName);
154
+ const filter = request.body.filter;
155
+ const catalog = await component.query(filter);
156
+ // Add participantId from nodeIdentity (the node providing the catalog)
157
+ const nodeIdentity = httpRequestContext.nodeIdentity;
158
+ if (nodeIdentity) {
159
+ catalog.participantId = nodeIdentity;
160
+ }
161
+ return {
162
+ body: catalog
163
+ };
164
+ }
165
+ /**
166
+ * Handle the get dataset operation.
167
+ * @param httpRequestContext The request context for the operation.
168
+ * @param componentName The name of the component to use.
169
+ * @param request The request.
170
+ * @returns The response.
171
+ */
172
+ async function getDataset(httpRequestContext, componentName, request) {
173
+ Guards.object(ROUTES_SOURCE, "request", request);
174
+ Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
175
+ Guards.stringValue(ROUTES_SOURCE, "request.pathParams.datasetId", request.pathParams.datasetId);
176
+ const component = ComponentFactory.get(componentName);
177
+ const dataset = await component.get(request.pathParams.datasetId);
178
+ return {
179
+ body: dataset
180
+ };
181
+ }
182
+ //# sourceMappingURL=federatedCatalogueRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federatedCatalogueRoutes.js","sourceRoot":"","sources":["../../src/federatedCatalogueRoutes.ts"],"names":[],"mappings":"AAGA,OAAO,EA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qB,EACrB,OAA2B;IAE3B,MAAM,CAAC,MAAM,CAAqB,aAAa,aAAmB,OAAO,CAAC,CAAC;IAC3E,MAAM,CAAC,MAAM,CAAC,aAAa,wBAA8B,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7E,MAAM,CAAC,WAAW,CACjB,aAAa,kCAEb,OAAO,CAAC,UAAU,CAAC,SAAS,CAC5B,CAAC;IAEF,MAAM,SAAS,GAAiC,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAEpF,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAElE,OAAO;QACN,IAAI,EAAE,OAAO;KACb,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpRequestContext, IRestRoute, ITag } from \"@twin.org/api-models\";\nimport { ComponentFactory, Guards } from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionRoot } from \"@twin.org/data-json-ld\";\nimport type {\n\tICatalogRequestRequest,\n\tICatalogRequestResponse,\n\tIFederatedCatalogueComponent,\n\tIGetDatasetRequest,\n\tIGetDatasetResponse\n} from \"@twin.org/federated-catalogue-models\";\nimport { FederatedCatalogueContexts } from \"@twin.org/federated-catalogue-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { CatalogTypes, DataspaceProtocolContexts } from \"@twin.org/standards-dataspace-protocol\";\nimport { DublinCoreContexts } from \"@twin.org/standards-dublin-core\";\nimport { DcatClasses, DcatContexts, type DcatContextType } from \"@twin.org/standards-w3c-dcat\";\n\n/**\n * The source used when communicating about these routes.\n */\nconst ROUTES_SOURCE = \"federatedCatalogueRoutes\";\n\n/**\n * The tag to associate with the routes.\n */\nexport const tagsFederatedCatalogue: ITag[] = [\n\t{\n\t\tname: \"Federated Catalogue\",\n\t\tdescription:\n\t\t\t\"Service providing Dataspace Protocol-compliant catalogue endpoints for dataset discovery and query.\"\n\t}\n];\n\n/**\n * The REST routes for federated catalogue.\n * @param baseRouteName Prefix to prepend to the paths.\n * @param componentName The name of the component to use in the routes stored in the ComponentFactory.\n * @returns The generated routes.\n */\nexport function generateRestRoutesFederatedCatalogue(\n\tbaseRouteName: string,\n\tcomponentName: string\n): IRestRoute[] {\n\tconst catalogRequestRoute: IRestRoute<ICatalogRequestRequest, ICatalogRequestResponse> = {\n\t\toperationId: \"catalogRequest\",\n\t\tsummary: \"Query the federated catalogue for datasets\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"POST\",\n\t\tpath: `${baseRouteName}/request`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tcatalogRequest(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<ICatalogRequestRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"catalogRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.ContextRoot],\n\t\t\t\t\t\t\t\"@type\": CatalogTypes.CatalogRequestMessage,\n\t\t\t\t\t\t\tfilter: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"catalogRequestNoFilterExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\"@context\": [DataspaceProtocolContexts.ContextRoot],\n\t\t\t\t\t\t\t\"@type\": CatalogTypes.CatalogRequestMessage\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<ICatalogRequestResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"catalogRequestResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": [\n\t\t\t\t\t\t\t\t\tDataspaceProtocolContexts.ContextRoot,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdcat: DcatContexts.ContextRoot,\n\t\t\t\t\t\t\t\t\t\tdcterms: DublinCoreContexts.ContextTerms,\n\t\t\t\t\t\t\t\t\t\tcursor: `${FederatedCatalogueContexts.ContextRoot}cursor`\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t] as IJsonLdContextDefinitionRoot as DcatContextType,\n\t\t\t\t\t\t\t\t\"@id\":\n\t\t\t\t\t\t\t\t\t\"urn:x-catalog:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2\",\n\t\t\t\t\t\t\t\t\"@type\": DcatClasses.Catalog,\n\t\t\t\t\t\t\t\tparticipantId: \"did:example:node-identity-123\",\n\t\t\t\t\t\t\t\t\"dcat:dataset\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\t\t\t\"@type\": DcatClasses.Dataset,\n\t\t\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\tconst getDatasetRoute: IRestRoute<IGetDatasetRequest, IGetDatasetResponse> = {\n\t\toperationId: \"getDataset\",\n\t\tsummary: \"Retrieve a specific dataset by ID\",\n\t\ttag: tagsFederatedCatalogue[0].name,\n\t\tmethod: \"GET\",\n\t\tpath: `${baseRouteName}/datasets/:datasetId`,\n\t\thandler: async (httpRequestContext, request) =>\n\t\t\tgetDataset(httpRequestContext, componentName, request),\n\t\trequestType: {\n\t\t\ttype: nameof<IGetDatasetRequest>(),\n\t\t\texamples: [\n\t\t\t\t{\n\t\t\t\t\tid: \"getDatasetRequestExample\",\n\t\t\t\t\trequest: {\n\t\t\t\t\t\tpathParams: {\n\t\t\t\t\t\t\tdatasetId: \"urn:uuid:dataset-123\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tresponseType: [\n\t\t\t{\n\t\t\t\ttype: nameof<IGetDatasetResponse>(),\n\t\t\t\texamples: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"getDatasetResponseExample\",\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\t\t\"@context\": [\n\t\t\t\t\t\t\t\t\tDataspaceProtocolContexts.ContextRoot,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdcat: DcatContexts.ContextRoot,\n\t\t\t\t\t\t\t\t\t\tdcterms: DublinCoreContexts.ContextTerms\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t] as IJsonLdContextDefinitionRoot as DcatContextType,\n\t\t\t\t\t\t\t\t\"@id\": \"urn:uuid:dataset-123\",\n\t\t\t\t\t\t\t\t\"@type\": DcatClasses.Dataset,\n\t\t\t\t\t\t\t\t\"dcterms:title\": \"Energy Consumption Data\",\n\t\t\t\t\t\t\t\t\"dcterms:description\": \"Historical energy consumption data\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\n\treturn [catalogRequestRoute, getDatasetRoute];\n}\n\n/**\n * Handle the catalog request operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns The response.\n */\nasync function catalogRequest(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: ICatalogRequestRequest\n): Promise<ICatalogRequestResponse> {\n\tGuards.object<ICatalogRequestRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object(ROUTES_SOURCE, nameof(request.body), request.body);\n\n\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\tconst filter = request.body.filter;\n\n\tconst catalog = await component.query(filter);\n\n\t// Add participantId from nodeIdentity (the node providing the catalog)\n\tconst nodeIdentity = (httpRequestContext as { nodeIdentity?: string }).nodeIdentity;\n\tif (nodeIdentity) {\n\t\t(catalog as { participantId?: string }).participantId = nodeIdentity;\n\t}\n\n\treturn {\n\t\tbody: catalog\n\t};\n}\n\n/**\n * Handle the get dataset operation.\n * @param httpRequestContext The request context for the operation.\n * @param componentName The name of the component to use.\n * @param request The request.\n * @returns The response.\n */\nasync function getDataset(\n\thttpRequestContext: IHttpRequestContext,\n\tcomponentName: string,\n\trequest: IGetDatasetRequest\n): Promise<IGetDatasetResponse> {\n\tGuards.object<IGetDatasetRequest>(ROUTES_SOURCE, nameof(request), request);\n\tGuards.object(ROUTES_SOURCE, nameof(request.pathParams), request.pathParams);\n\tGuards.stringValue(\n\t\tROUTES_SOURCE,\n\t\tnameof(request.pathParams.datasetId),\n\t\trequest.pathParams.datasetId\n\t);\n\n\tconst component: IFederatedCatalogueComponent = ComponentFactory.get(componentName);\n\n\tconst dataset = await component.get(request.pathParams.datasetId);\n\n\treturn {\n\t\tbody: dataset\n\t};\n}\n"]}
@@ -0,0 +1,10 @@
1
+ // Copyright 2025 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./entities/dataset.js";
4
+ export * from "./federatedCatalogueRoutes.js";
5
+ export * from "./models/IFederatedCatalogueServiceConstructorOptions.js";
6
+ export * from "./restEntryPoints.js";
7
+ export * from "./schema.js";
8
+ export * from "./services/federatedCatalogueService.js";
9
+ export * from "./utils/datasetConverters.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0DAA0D,CAAC;AACzE,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,yCAAyC,CAAC;AACxD,cAAc,8BAA8B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./entities/dataset.js\";\nexport * from \"./federatedCatalogueRoutes.js\";\nexport * from \"./models/IFederatedCatalogueServiceConstructorOptions.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\nexport * from \"./services/federatedCatalogueService.js\";\nexport * from \"./utils/datasetConverters.js\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IFederatedCatalogueServiceConstructorOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFederatedCatalogueServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IFederatedCatalogueServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\n\n/**\n * Options for the FederatedCatalogueService constructor.\n */\nexport interface IFederatedCatalogueServiceConstructorOptions {\n\t/**\n\t * The type of the entity storage connector for datasets.\n\t */\n\tdatasetStorageConnectorType?: string;\n\n\t/**\n\t * The logging component for the service.\n\t */\n\tloggingComponent?: ILoggingComponent;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { generateRestRoutesFederatedCatalogue, tagsFederatedCatalogue } from "./federatedCatalogueRoutes.js";
2
+ export const restEntryPoints = [
3
+ {
4
+ name: "federated-catalogue",
5
+ defaultBaseRoute: "catalog",
6
+ tags: tagsFederatedCatalogue,
7
+ generateRoutes: generateRestRoutesFederatedCatalogue
8
+ }
9
+ ];
10
+ //# sourceMappingURL=restEntryPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,qBAAqB;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@twin.org/api-models\";\nimport {\n\tgenerateRestRoutesFederatedCatalogue,\n\ttagsFederatedCatalogue\n} from \"./federatedCatalogueRoutes.js\";\n\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"federated-catalogue\",\n\t\tdefaultBaseRoute: \"catalog\",\n\t\ttags: tagsFederatedCatalogue,\n\t\tgenerateRoutes: generateRestRoutesFederatedCatalogue\n\t}\n];\n"]}
@@ -0,0 +1,11 @@
1
+ // Copyright 2025 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { EntitySchemaFactory, EntitySchemaHelper } from "@twin.org/entity";
4
+ import { Dataset } from "./entities/dataset.js";
5
+ /**
6
+ * Initialize the schema for the federated catalogue entity storage.
7
+ */
8
+ export function initSchema() {
9
+ EntitySchemaFactory.register("Dataset", () => EntitySchemaHelper.getSchema(Dataset));
10
+ }
11
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,UAAU;IACzB,mBAAmB,CAAC,QAAQ,YAAoB,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { EntitySchemaFactory, EntitySchemaHelper } from \"@twin.org/entity\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { Dataset } from \"./entities/dataset.js\";\n\n/**\n * Initialize the schema for the federated catalogue entity storage.\n */\nexport function initSchema(): void {\n\tEntitySchemaFactory.register(nameof<Dataset>(), () => EntitySchemaHelper.getSchema(Dataset));\n}\n"]}