@piveau/dpi 0.2.0-alpha.12 → 0.2.0-alpha.14

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 (52) hide show
  1. package/dist/assets/dpi.css +1 -1
  2. package/dist/packages/dpi/src/data-provider-interface/DataProviderInterface.vue2.js +48 -47
  3. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +74 -71
  4. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue.js +4 -94
  5. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ProjectTable.vue2.js +104 -0
  6. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +1 -1
  7. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue.js +2 -2
  8. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocab.vue2.js +64 -52
  9. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectNameStep.vue.js +8 -8
  10. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DpiModalBase.vue.js +2 -2
  11. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/DpiModalBase.vue2.js +1 -1
  12. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/CategoriesStep.vue.js +2 -2
  13. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/Findability/CategoriesStep.vue2.js +4 -4
  14. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/OptionalDataStep/OptionalDataStep.vue.js +2 -2
  15. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/OptionalDataStep/OptionalDataStep.vue2.js +21 -21
  16. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/DatasetStep.vue.js +2 -2
  17. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/DatasetStep.vue2.js +73 -71
  18. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/GetResource.vue.js +4 -4
  19. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareForm.vue.js +2 -2
  20. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareStep.vue.js +2 -2
  21. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/HardwareStep.vue2.js +133 -131
  22. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/SoftwareStep.vue.js +2 -2
  23. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ProcessSteps/SoftwareStep.vue2.js +85 -83
  24. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue.js +2 -2
  25. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/ReviewStep/ReviewStep.vue2.js +4 -4
  26. package/dist/packages/dpi/src/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +179 -133
  27. package/dist/packages/dpi/src/data-provider-interface/components/DistLicense.vue.js +224 -133
  28. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue.js +2 -2
  29. package/dist/packages/dpi/src/data-provider-interface/components/StepActionsSection.vue2.js +111 -91
  30. package/dist/packages/dpi/src/data-provider-interface/components/TheCancelConfirmationDialog.vue.js +3 -3
  31. package/dist/packages/dpi/src/data-provider-interface/components/TheCancelConfirmationDialog.vue2.js +24 -19
  32. package/dist/packages/dpi/src/data-provider-interface/components/VisibilityPage.vue.js +106 -0
  33. package/dist/packages/dpi/src/data-provider-interface/components/dev-tools/ProjectDpiDevTools.vue.js +2 -2
  34. package/dist/packages/dpi/src/data-provider-interface/components/dev-tools/ProjectDpiDevTools.vue2.js +137 -94
  35. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/decodeProject.js +152 -135
  36. package/dist/packages/dpi/src/data-provider-interface/composables/project-transformer/encodeProject.js +201 -164
  37. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiContext.js +9 -10
  38. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiEditMode.js +88 -66
  39. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiSimpleLoader.js +274 -273
  40. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiStepper.js +33 -32
  41. package/dist/packages/dpi/src/data-provider-interface/composables/useDpiUtils.js +18 -9
  42. package/dist/packages/dpi/src/data-provider-interface/composables/useProjectActions.js +65 -0
  43. package/dist/packages/dpi/src/data-provider-interface/composables/useTwinbyHome.js +50 -0
  44. package/dist/packages/dpi/src/data-provider-interface/config/dcatapdeHappyFlow/input-definition.js +4 -0
  45. package/dist/packages/dpi/src/data-provider-interface/config/dcatapdeHappyFlow/page-content-config.js +1 -1
  46. package/dist/packages/dpi/src/data-provider-interface/schema/projectLdSchema.js +48 -45
  47. package/dist/packages/dpi/src/data-provider-interface/views/InputPage.vue.js +276 -251
  48. package/dist/packages/dpi/src/data-provider-interface/views/InputPageProject.vue.js +386 -397
  49. package/dist/packages/dpi/src/form/inputDefinitions.js +15 -10
  50. package/dist/packages/dpi/src/utils/schema/schemaProject.js +210 -0
  51. package/dist/packages/dpi/src/utils/schema/shared.js +23 -0
  52. package/package.json +3 -3
@@ -1,8 +1,8 @@
1
- import { toRef as Z, ref as ee, toValue as q, computed as j, watch as K } from "vue";
2
- import { useAsyncState as te } from "@vueuse/core";
3
- import { defineJsonldResolver as ie, dcatDatasetTransformer as re, datasetResolvers as oe } from "@piveau/jsonld";
4
- import { isEmpty as ne } from "lodash-es";
5
- function z(e) {
1
+ import { defineJsonldResolver as Z, dcatDatasetTransformer as ee, datasetResolvers as te } from "@piveau/jsonld";
2
+ import { useAsyncState as re } from "@vueuse/core";
3
+ import { isEmpty as ie } from "lodash-es";
4
+ import { toRef as oe, ref as ae, toValue as F, computed as z, watch as K } from "vue";
5
+ function M(e) {
6
6
  return e == null ? [] : Array.isArray(e) ? e : [e];
7
7
  }
8
8
  function o(e) {
@@ -12,69 +12,108 @@ function o(e) {
12
12
  function s(e) {
13
13
  return Array.isArray(e) ? e : e ? [e] : void 0;
14
14
  }
15
- function ae(e) {
15
+ function ne(e) {
16
16
  return Object.fromEntries(
17
17
  Object.entries(e).filter(
18
- ([r, i]) => i != null && !ne(i)
18
+ ([i, r]) => r != null && !ie(r)
19
19
  )
20
20
  );
21
21
  }
22
- function Te(e, r) {
23
- const { enabled: i, hubSearchUrl: t } = r, n = Z(i), { safeTransform: p } = ie({
22
+ function ve(e, i) {
23
+ const { enabled: r, hubSearchUrl: t } = i, c = oe(r), { safeTransform: h } = Z({
24
24
  baseUrl: t,
25
- resolvers: oe(),
26
- transformer: re
27
- }), c = ee([]), {
28
- state: u,
25
+ resolvers: te(),
26
+ transformer: ee
27
+ }), d = ae([]), {
28
+ state: p,
29
29
  isReady: b,
30
30
  isLoading: g,
31
31
  error: m,
32
- execute: B
33
- } = te(
32
+ execute: L
33
+ } = re(
34
34
  async () => {
35
- var D;
36
- const l = await p(q(e));
37
- if (l.error)
38
- return c.value.push({
39
- code: "transform_failed",
40
- message: l.error.message
35
+ var A;
36
+ if (!i.preprocess && !i.transform) {
37
+ const a = await h(F(e));
38
+ if (a.error)
39
+ return d.value.push({
40
+ code: "transform_failed",
41
+ message: a.error.message
42
+ }), null;
43
+ const y = a.data;
44
+ return (!y || !((A = y["dpi:isDPIv3"]) != null && A["@value"])) && d.value.push({
45
+ code: "not_dpi_v3",
46
+ message: `The dataset is not a DPI v3 dataset. ID ${y["@id"]}`
47
+ }), {
48
+ dpiData: ge(y),
49
+ data: y
50
+ };
51
+ }
52
+ let D;
53
+ if (i.preprocess)
54
+ try {
55
+ const a = await i.preprocess(F(e));
56
+ if (a && typeof a == "object" && "error" in a && a.error)
57
+ return d.value.push({
58
+ code: "preprocess_failed",
59
+ message: a.error.message || "Preprocess failed"
60
+ }), null;
61
+ D = a && typeof a == "object" && "data" in a ? a.data : a;
62
+ } catch (a) {
63
+ return d.value.push({
64
+ code: "preprocess_failed",
65
+ message: (a == null ? void 0 : a.message) || String(a)
66
+ }), null;
67
+ }
68
+ else
69
+ D = F(e);
70
+ if (!i.transform)
71
+ return d.value.push({
72
+ code: "missing_transform",
73
+ message: "No transform function provided. Either supply a transform or omit both preprocess and transform to use the default DCAT dataset path."
41
74
  }), null;
42
- const y = l.data;
43
- return (!y || !((D = y["dpi:isDPIv3"]) != null && D["@value"])) && c.value.push({
44
- code: "not_dpi_v3",
45
- message: `The dataset is not a DPI v3 dataset. ID ${y["@id"]}`
46
- }), {
47
- dpiData: ge(y),
48
- data: y
75
+ let P;
76
+ try {
77
+ const a = i.preprocess ? D : F(e);
78
+ P = await i.transform(a);
79
+ } catch (a) {
80
+ return d.value.push({
81
+ code: "transform_apply_failed",
82
+ message: (a == null ? void 0 : a.message) || String(a)
83
+ }), null;
84
+ }
85
+ return {
86
+ dpiData: P,
87
+ data: D
49
88
  };
50
89
  },
51
90
  null,
52
91
  { immediate: !1 }
53
- ), h = j(
54
- () => n.value && !g.value && !!b.value
55
- ), R = j(
56
- () => n.value && !!h.value
57
- ), v = j(() => R.value), P = j(() => {
58
- var l;
59
- return (l = u.value) == null ? void 0 : l.dpiData;
60
- }), w = j(() => {
61
- var l;
62
- return (l = u.value) == null ? void 0 : l.data;
92
+ ), R = z(
93
+ () => c.value && !g.value && !!b.value
94
+ ), B = z(
95
+ () => c.value && !!R.value
96
+ ), T = z(() => B.value), I = z(() => {
97
+ var u;
98
+ return (u = p.value) == null ? void 0 : u.dpiData;
99
+ }), S = z(() => {
100
+ var u;
101
+ return (u = p.value) == null ? void 0 : u.data;
63
102
  });
64
103
  return K(
65
- () => q(e),
66
- (l) => l && n.value ? B() : null
67
- ), K(w, (l) => {
68
- console.log("jsonld resolved result:", l);
69
- }), K(m, (l) => {
70
- console.log("jsonld error:", l);
104
+ () => F(e),
105
+ (u) => u && c.value ? L() : null
106
+ ), K(S, (u) => {
107
+ console.log("jsonld resolved result:", u);
108
+ }), K(m, (u) => {
109
+ console.log("jsonld error:", u);
71
110
  }), {
72
- processedInput: u,
73
- isProcessedInputReady: h,
74
- result: P,
75
- isMaterialized: R,
76
- isReady: v,
77
- errors: c
111
+ processedInput: p,
112
+ isProcessedInputReady: R,
113
+ result: I,
114
+ isMaterialized: B,
115
+ isReady: T,
116
+ errors: d
78
117
  };
79
118
  }
80
119
  function f(e) {
@@ -88,37 +127,35 @@ function f(e) {
88
127
  }
89
128
  return "";
90
129
  }
91
- function d(e, r = "de") {
130
+ function l(e, i = "de") {
92
131
  if (!e)
93
132
  return "";
94
133
  if (typeof e == "string")
95
134
  return e;
96
135
  if (typeof e == "object" && !Array.isArray(e) && !e["@value"] && !e["@id"])
97
- return e[r] || Object.values(e)[0] || "";
136
+ return e[i] || Object.values(e)[0] || "";
98
137
  if (Array.isArray(e)) {
99
- const i = e.find(
100
- (n) => n["@language"] === r
138
+ const r = e.find(
139
+ (c) => c["@language"] === i
101
140
  );
102
- if (i)
103
- return i["@value"] || "";
141
+ if (r)
142
+ return r["@value"] || "";
104
143
  const t = e[0];
105
144
  return (t == null ? void 0 : t["@value"]) || f(t) || "";
106
145
  }
107
146
  return e["@language"] && e["@value"] ? e["@value"] : f(e);
108
147
  }
109
- function k(e) {
148
+ function E(e) {
110
149
  return {
111
150
  uri: e.uri,
112
- label: e.label,
113
- //
114
- "@value": e.label
151
+ label: e.label
115
152
  };
116
153
  }
117
- function T(e, r) {
118
- const i = e.prefLabel;
119
- return k({
154
+ function x(e, i) {
155
+ const r = e.prefLabel;
156
+ return E({
120
157
  uri: e["@id"] || e["purl:identifier"] || "",
121
- label: i ? d(i) : e["purl:identifier"] || ""
158
+ "@value": r ? l(r) : e["purl:identifier"] || ""
122
159
  });
123
160
  }
124
161
  function N(e) {
@@ -126,40 +163,40 @@ function N(e) {
126
163
  "@value": e
127
164
  } : e;
128
165
  }
129
- function S(e, r = !0) {
166
+ function U(e, i = !0) {
130
167
  return {
131
- isValid: r,
168
+ isValid: i,
132
169
  ...e
133
170
  };
134
171
  }
135
- function H(e, r = "de") {
136
- return e ? z(e).map((t) => typeof t == "string" ? S({
172
+ function H(e, i = "de") {
173
+ return e ? M(e).map((t) => typeof t == "string" ? U({
137
174
  "@value": t,
138
- "@language": r
139
- }) : t && typeof t == "object" ? t["@language"] && t["@value"] ? S({
175
+ "@language": i
176
+ }) : t && typeof t == "object" ? t["@language"] && t["@value"] ? U({
140
177
  "@value": t["@value"],
141
178
  "@language": t["@language"]
142
- }) : S({
179
+ }) : U({
143
180
  "@value": f(t),
144
- "@language": r
145
- }) : S({
181
+ "@language": i
182
+ }) : U({
146
183
  "@value": "",
147
- "@language": r
184
+ "@language": i
148
185
  })) : [];
149
186
  }
150
- function ce(e, r) {
151
- return e ? z(e).map(
152
- (t) => S({
153
- "@type": r,
187
+ function ce(e, i) {
188
+ return e ? M(e).map(
189
+ (t) => U({
190
+ "@type": i,
154
191
  "@value": f(t)
155
192
  })
156
193
  ) : [];
157
194
  }
158
- function X(e, r) {
159
- const i = { isValid: !0 };
160
- for (const [t, n] of Object.entries(r))
161
- i[t] = f(e == null ? void 0 : e[n]);
162
- return i;
195
+ function X(e, i) {
196
+ const r = { isValid: !0 };
197
+ for (const [t, c] of Object.entries(i))
198
+ r[t] = f(e == null ? void 0 : e[c]);
199
+ return r;
163
200
  }
164
201
  function de(e) {
165
202
  return {
@@ -167,37 +204,35 @@ function de(e) {
167
204
  };
168
205
  }
169
206
  function le(e) {
170
- const r = {
207
+ const i = {
171
208
  discoverabilityPage: [{ isValid: !0 }]
172
209
  };
173
210
  if (e["dcatap:hvdCategory"]) {
174
- const i = z(
175
- e["dcatap:hvdCategory"]
176
- ).filter(Boolean);
177
- r.hvdPage = i == null ? void 0 : i.map((t) => ({
211
+ const r = M(e["dcatap:hvdCategory"]).filter(Boolean);
212
+ i.hvdPage = r == null ? void 0 : r.map((t) => ({
178
213
  isValid: !0,
179
214
  uri: t["@id"],
180
- label: d(t.prefLabel)
215
+ label: l(t.prefLabel)
181
216
  }));
182
217
  }
183
218
  if (e["dcat:theme"]) {
184
- const i = z(e["dcat:theme"]);
185
- r.discoverabilityPage = [
219
+ const r = M(e["dcat:theme"]);
220
+ i.discoverabilityPage = [
186
221
  { isValid: !0 },
187
- ...i.map(
188
- (t) => S({
222
+ ...r.map(
223
+ (t) => U({
189
224
  id: f(t).split("/").pop(),
190
225
  uri: f(t),
191
- label: d(t.prefLabel)
226
+ label: l(t.prefLabel)
192
227
  })
193
228
  )
194
229
  ];
195
230
  }
196
- return r;
231
+ return i;
197
232
  }
198
233
  function se(e) {
199
234
  var t;
200
- const i = {
235
+ const r = {
201
236
  datasetID: ((t = e["@id"]) == null ? void 0 : t.split("/").pop()) || "",
202
237
  "dct:title": [],
203
238
  "dct:description": [],
@@ -205,15 +240,15 @@ function se(e) {
205
240
  "dct:publisher": [],
206
241
  "dcat:contactPoint": []
207
242
  };
208
- if (e["dct:title"] && (i["dct:title"] = H(e["dct:title"])), e["dct:description"] && (i["dct:description"] = H(
243
+ if (e["dct:title"] && (r["dct:title"] = H(e["dct:title"])), e["dct:description"] && (r["dct:description"] = H(
209
244
  e["dct:description"]
210
- )), e["dct:modified"] && (i["dct:modified"] = ce(
245
+ )), e["dct:modified"] && (r["dct:modified"] = ce(
211
246
  e["dct:modified"],
212
247
  "http://www.w3.org/2001/XMLSchema#date"
213
248
  )), e["dct:publisher"]) {
214
- const n = o(e["dct:publisher"]);
215
- i["dct:publisher"] = [
216
- X(n, {
249
+ const c = o(e["dct:publisher"]);
250
+ r["dct:publisher"] = [
251
+ X(c, {
217
252
  "foaf:name": "foaf:name",
218
253
  "foaf:mbox": "foaf:mbox",
219
254
  "foaf:homepage": "foaf:homepage"
@@ -221,23 +256,23 @@ function se(e) {
221
256
  ];
222
257
  }
223
258
  if (e["dcat:contactPoint"]) {
224
- const n = o(e["dcat:contactPoint"]);
225
- i["dcat:contactPoint"] = [
226
- X(n, {
259
+ const c = o(e["dcat:contactPoint"]);
260
+ r["dcat:contactPoint"] = [
261
+ X(c, {
227
262
  "vcard:fn": "vcard:fn",
228
263
  "vcard:hasEmail": "vcard:hasEmail",
229
264
  "vcard:hasTelephone": "vcard:hasTelephone"
230
265
  })
231
266
  ];
232
267
  }
233
- return i;
268
+ return r;
234
269
  }
235
- function fe(e) {
236
- var r, i;
270
+ function ue(e) {
271
+ var i, r;
237
272
  return {
238
- "dcatde:politicalGeocodingURI": (r = e["dcatapde:politicalGeocodingURI"]) == null ? void 0 : r.map((t) => {
239
- var u;
240
- const p = {
273
+ "dcatde:politicalGeocodingURI": (i = e["dcatapde:politicalGeocodingURI"]) == null ? void 0 : i.map((t) => {
274
+ var p;
275
+ const h = {
241
276
  districtKey: "Kreis",
242
277
  governmentDistrictKey: "Bezirk",
243
278
  municipalityKey: "Gemeindeschlüssel",
@@ -245,126 +280,117 @@ function fe(e) {
245
280
  stateKey: "Bundesland",
246
281
  regionalKey: "Regionalschlüssel"
247
282
  };
248
- let c = t["@id"].split("/").slice(-2, -1)[0];
249
- return c = p[c] || c, {
283
+ let d = t["@id"].split("/").slice(-2, -1)[0];
284
+ return d = h[d] || d, {
250
285
  isValid: !0,
251
286
  uri: t["@id"],
252
- id: ((u = t.prefLabel) == null ? void 0 : u.de) || t["@id"].split("/").pop(),
253
- label: d(t.altLabel),
254
- inVoc: c
287
+ id: ((p = t.prefLabel) == null ? void 0 : p.de) || t["@id"].split("/").pop(),
288
+ label: l(t.altLabel),
289
+ inVoc: d
255
290
  };
256
291
  }),
257
- "dcat:temporalResolution": (i = e["dct:temporal"]) == null ? void 0 : i.reduce((t, n) => {
258
- const c = o(n["dcat:startDate"]), u = o(n["dcat:endDate"]), b = f(c) || "", g = f(u) || "", m = typeof c != "string" && (c == null ? void 0 : c["@type"]) === "http://www.w3.org/2001/XMLSchema#dateTime" ? "dateTime" : "date", B = m === "date" ? b : b.split("T")[0], h = m === "date" ? g : g.split("T")[0], R = m === "dateTime" ? b.split("T")[1] : "", v = m === "dateTime" ? g.split("T")[1] : "";
292
+ "dcat:temporalResolution": (r = e["dct:temporal"]) == null ? void 0 : r.reduce((t, c) => {
293
+ const d = o(c["dcat:startDate"]), p = o(c["dcat:endDate"]), b = f(d) || "", g = f(p) || "", m = typeof d != "string" && (d == null ? void 0 : d["@type"]) === "http://www.w3.org/2001/XMLSchema#dateTime" ? "dateTime" : "date", L = m === "date" ? b : b.split("T")[0], R = m === "date" ? g : g.split("T")[0], B = m === "dateTime" ? b.split("T")[1] : "", T = m === "dateTime" ? g.split("T")[1] : "";
259
294
  return {
260
295
  isValid: !0,
261
296
  type: "dct:PeriodOfTime",
262
297
  "dct:temporal": [
263
298
  {
264
299
  dataType: m,
265
- "dcat:startDate": B,
266
- "dcat:endDate": h,
267
- startTime: R || "",
268
- endTime: v || ""
300
+ "dcat:startDate": L,
301
+ "dcat:endDate": R,
302
+ startTime: B || "",
303
+ endTime: T || ""
269
304
  }
270
305
  ]
271
306
  };
272
307
  }, {})
273
308
  };
274
309
  }
275
- function ue(e, r) {
276
- var t, n, p, c, u, b, g, m, B, h, R, v, P, w, l, y, I, D, U, V, x;
310
+ function fe(e, i) {
311
+ var t, c, h, d, p, b, g, m, L, R, B, T, I, S, u, D, P, A, a, y, V;
277
312
  if (!e)
278
313
  return {};
279
- const i = o(e["spdx:checksum"]);
314
+ const r = o(e["spdx:checksum"]);
280
315
  return {
281
316
  isValid: !0,
282
- id: r + 1,
317
+ id: i + 1,
283
318
  "dcat:accessURL": f(o(e["dcat:accessURL"])) || "",
284
319
  "dct:format": {
285
320
  // redundancy in label and title for better compatibility
286
321
  label: ((t = o(e["dct:format"])) == null ? void 0 : t["purl:identifier"]) || "",
287
- title: ((n = o(e["dct:format"])) == null ? void 0 : n["purl:identifier"]) || "",
288
- uri: ((p = o(e["dct:format"])) == null ? void 0 : p["@id"]) || ""
322
+ title: ((c = o(e["dct:format"])) == null ? void 0 : c["purl:identifier"]) || "",
323
+ uri: ((h = o(e["dct:format"])) == null ? void 0 : h["@id"]) || ""
289
324
  },
290
- "dct:title": d(e["dct:title"]),
291
- "dct:description": d(e["dct:description"]),
325
+ "dct:title": l(e["dct:title"]),
326
+ "dct:description": l(e["dct:description"]),
292
327
  "dct:modified": f(o(e["dct:modified"])),
293
328
  "dct:issued": f(o(e["dct:issued"])),
294
329
  "dcat:byteSize": f(o(e["dcat:byteSize"])),
295
- "dcatde:licenseAttributionByText": d(e["dcatapde:licenseAttributionByText"]) || "",
296
- "dct:license": e["dct:license"] ? [
297
- {
298
- isValid: !0,
299
- uri: ((c = o(e["dct:license"])) == null ? void 0 : c["@id"]) || "",
300
- "dcterms:license": d(
301
- (u = o(e["dct:license"])) == null ? void 0 : u.altLabel
302
- ) || "",
303
- label: d(
304
- (b = o(e["dct:license"])) == null ? void 0 : b.prefLabel
305
- ) || "",
306
- title: d(
307
- (g = o(e["dct:license"])) == null ? void 0 : g.prefLabel
308
- ) || ""
309
- }
310
- ] : [],
311
- "dct:accessRights": e["dct:accessRights"] ? o(T(e["dct:accessRights"])) : [],
330
+ "dcatde:licenseAttributionByText": l(e["dcatapde:licenseAttributionByText"]) || "",
331
+ "dct:license": e["dct:license"] ? [{
332
+ isValid: !0,
333
+ uri: ((d = o(e["dct:license"])) == null ? void 0 : d["@id"]) || "",
334
+ "dcterms:license": l((p = o(e["dct:license"])) == null ? void 0 : p.altLabel) || "",
335
+ label: l((b = o(e["dct:license"])) == null ? void 0 : b.prefLabel) || "",
336
+ title: l((g = o(e["dct:license"])) == null ? void 0 : g.prefLabel) || ""
337
+ }] : [],
338
+ "dct:accessRights": f(o(e["dct:accessRights"])),
312
339
  "dcatap:availability": {
313
340
  // Redundant label and title for better compatibility
314
341
  label: ((m = o(e["dcatap:availability"])) == null ? void 0 : m.prefLabel) || "",
315
- title: ((B = o(e["dcatap:availability"])) == null ? void 0 : B.prefLabel) || "",
316
- uri: ((h = o(e["dcatap:availability"])) == null ? void 0 : h["@id"]) || ""
342
+ title: ((L = o(e["dcatap:availability"])) == null ? void 0 : L.prefLabel) || "",
343
+ uri: ((R = o(e["dcatap:availability"])) == null ? void 0 : R["@id"]) || ""
317
344
  },
318
- "dct:language": ((R = e["dct:language"]) == null ? void 0 : R.map((L) => T(L)).filter(Boolean)) || [],
319
- "dcat:mediaType": k({
320
- label: d(
321
- (v = o(e["dcat:mediaType"])) == null ? void 0 : v.prefLabel
345
+ "dct:language": ((B = e["dct:language"]) == null ? void 0 : B.map((v) => x(v)).filter(Boolean)) || [],
346
+ "dcat:mediaType": E({
347
+ label: l(
348
+ (T = o(e["dcat:mediaType"])) == null ? void 0 : T.prefLabel
322
349
  ) || "",
323
- uri: ((P = o(e["dcat:mediaType"])) == null ? void 0 : P["@id"]) || ""
350
+ uri: ((I = o(e["dcat:mediaType"])) == null ? void 0 : I["@id"]) || ""
324
351
  }),
325
- "dcat:compressFormat": k({
326
- label: d(
327
- (w = o(e["dcat:compressFormat"])) == null ? void 0 : w.prefLabel
352
+ "dcat:compressFormat": E({
353
+ label: l(
354
+ (S = o(e["dcat:compressFormat"])) == null ? void 0 : S.prefLabel
328
355
  ) || "",
329
- uri: ((l = o(e["dcat:compressFormat"])) == null ? void 0 : l["@id"]) || ""
356
+ uri: ((u = o(e["dcat:compressFormat"])) == null ? void 0 : u["@id"]) || ""
330
357
  }),
331
- "dcat:packageFormat": k({
332
- label: d(
333
- (y = o(e["dcat:packageFormat"])) == null ? void 0 : y.prefLabel
358
+ "dcat:packageFormat": E({
359
+ label: l(
360
+ (D = o(e["dcat:packageFormat"])) == null ? void 0 : D.prefLabel
334
361
  ) || "",
335
- uri: ((I = o(e["dcat:packageFormat"])) == null ? void 0 : I["@id"]) || ""
362
+ uri: ((P = o(e["dcat:packageFormat"])) == null ? void 0 : P["@id"]) || ""
336
363
  }),
337
- "adms:status": ((D = o(e["adms:status"])) == null ? void 0 : D["@id"]) || "",
364
+ "adms:status": ((A = o(e["adms:status"])) == null ? void 0 : A["@id"]) || "",
338
365
  checksum: {
339
- title: f(o(i == null ? void 0 : i["spdx:checksumValue"])),
340
- "spdx:checksum": ((U = f(o(i == null ? void 0 : i["spdx:algorithm"]))) == null ? void 0 : U.split("_").pop()) || "",
341
- uri: (V = f(
342
- o(i == null ? void 0 : i["spdx:algorithm"])
343
- )) == null ? void 0 : V.replace("spdx:", "http://spdx.org/rdf/terms#")
366
+ title: f(o(r == null ? void 0 : r["spdx:checksumValue"])),
367
+ "spdx:checksum": ((a = f(o(r == null ? void 0 : r["spdx:algorithm"]))) == null ? void 0 : a.split("_").pop()) || "",
368
+ uri: (y = f(
369
+ o(r == null ? void 0 : r["spdx:algorithm"])
370
+ )) == null ? void 0 : y.replace("spdx:", "http://spdx.org/rdf/terms#")
344
371
  },
345
372
  accessServices: ye(e["dcat:accessService"] || []),
346
- documentations: he(e["foaf:page"] || []),
347
- conformsToItems: (x = e["dct:conformsTo"]) == null ? void 0 : x.map((L, M) => ({
373
+ conformsToItems: (V = e["dct:conformsTo"]) == null ? void 0 : V.map((v, j) => ({
348
374
  // for some reason dct:conformsTo is different from the one on dcat:dataset level
349
- id: M + 1,
350
- "dcat:accessURL": L["@id"],
351
- "dct:title": d(L["rdfs:label"]) || "",
352
- "dcat:downloadURL": L["@id"],
375
+ id: j + 1,
376
+ "dcat:accessURL": v["@id"],
377
+ "dct:title": l(v["rdfs:label"]) || "",
378
+ "dcat:downloadURL": v["@id"],
353
379
  // redundancy to match properties on dcat:dataset level
354
- "rdfs:label": d(L["rdfs:label"]) || "",
355
- uri: L["@id"]
380
+ "rdfs:label": l(v["rdfs:label"]) || "",
381
+ uri: v["@id"]
356
382
  })).filter(Boolean)
357
383
  };
358
384
  }
359
385
  function pe(e) {
360
- const r = {
386
+ const i = {
361
387
  "dcat:distribution": []
362
388
  };
363
389
  if (e["dcat:distribution"]) {
364
- const i = z(e["dcat:distribution"]);
365
- r["dcat:distribution"] = i.map((t, n) => ue(t, n)).filter((t) => Object.keys(t).length > 0);
390
+ const r = M(e["dcat:distribution"]);
391
+ i["dcat:distribution"] = r.map((t, c) => fe(t, c)).filter((t) => Object.keys(t).length > 0);
366
392
  }
367
- return console.log(r), r;
393
+ return console.log(i), i;
368
394
  }
369
395
  function me(e) {
370
396
  return {
@@ -372,148 +398,123 @@ function me(e) {
372
398
  };
373
399
  }
374
400
  function be(e) {
375
- var i, t, n, p, c, u, b, g, m, B, h, R, v, P, w, l, y, I, D, U, V, x, L, M, E, G, C;
376
- const r = {
377
- "dct:language": (i = e["dct:language"]) == null ? void 0 : i.map((a) => T(a)).filter(Boolean),
378
- "dct:conformsTo": (t = e["dct:conformsTo"]) == null ? void 0 : t.map((a) => ({
379
- "rdfs:label": d(a["rdfs:label"]) || "",
380
- "@id": a["@id"]
401
+ var r, t, c, h, d, p, b, g, m, L, R, B, T, I, S, u, D, P, A, a, y, V, v, j, C, G, q;
402
+ const i = {
403
+ "dct:language": (r = e["dct:language"]) == null ? void 0 : r.map((n) => x(n)).filter(Boolean),
404
+ "dct:conformsTo": (t = e["dct:conformsTo"]) == null ? void 0 : t.map((n) => ({
405
+ "rdfs:label": l(n["rdfs:label"]) || "",
406
+ "@id": n["@id"]
381
407
  })).filter(Boolean),
382
- "dct:accessRights": e["dct:accessRights"] ? s(T(e["dct:accessRights"])) : [],
383
- "dct:provenance": (n = e["dct:provenance"]) == null ? void 0 : n.map((a) => ({
384
- "rdfs:label": d(a["rdfs:label"]) || "",
385
- uri: a["@id"]
408
+ "dct:accessRights": e["dct:accessRights"] ? s(x(e["dct:accessRights"])) : [],
409
+ "dct:provenance": (c = e["dct:provenance"]) == null ? void 0 : c.map((n) => ({
410
+ "rdfs:label": l(n["rdfs:label"]) || "",
411
+ uri: n["@id"]
386
412
  })).filter(Boolean),
387
- "dct:accrualPeriodicity": e["dct:accrualPeriodicity"] ? s(T(e["dct:accrualPeriodicity"])) : [],
388
- "dct:type": (p = e["dct:type"]) == null ? void 0 : p.map((a) => T(a)).filter(Boolean),
389
- "dcat:spatialResolutionInMeters": ((c = e["dcat:spatialResolutionInMeters"]) == null ? void 0 : c.map(N)) || void 0,
390
- "dcat:temporalResolution": e["dcat:temporalResolution"] ? e["dcat:temporalResolution"].map(N).map((a) => {
391
- const F = a["@value"].match(
392
- /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/
393
- );
394
- if (F) {
395
- const [, O, _, Y, $, J, Q] = F.map(
396
- (W) => W || "0"
397
- );
398
- return {
399
- Year: O,
400
- Month: _,
401
- Day: Y,
402
- Hour: $,
403
- Minute: J,
404
- Second: Q
405
- };
413
+ "dct:accrualPeriodicity": e["dct:accrualPeriodicity"] ? s(x(e["dct:accrualPeriodicity"])) : [],
414
+ "dct:type": (h = e["dct:type"]) == null ? void 0 : h.map((n) => x(n)).filter(Boolean),
415
+ "dcat:spatialResolutionInMeters": ((d = e["dcat:spatialResolutionInMeters"]) == null ? void 0 : d.map(N)) || void 0,
416
+ "dcat:temporalResolution": e["dcat:temporalResolution"] ? e["dcat:temporalResolution"].map(N).map((n) => {
417
+ const _ = n["@value"].match(/^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/);
418
+ if (_) {
419
+ const [, O, k, Y, $, J, Q] = _.map((W) => W || "0");
420
+ return { Year: O, Month: k, Day: Y, Hour: $, Minute: J, Second: Q };
406
421
  }
407
422
  }).filter(Boolean) : void 0,
408
- "dcat:qualifiedRelation": (u = s(
423
+ "dcat:qualifiedRelation": (p = s(
409
424
  e["dcat:qualifiedRelation"]
410
- )) == null ? void 0 : u.filter(Boolean),
425
+ )) == null ? void 0 : p.filter(Boolean),
411
426
  "dct:creator": (b = s(e["dct:creator"])) == null ? void 0 : b.filter(Boolean),
412
427
  "dct:contributor": (g = s(e["dct:contributor"])) == null ? void 0 : g.filter(Boolean),
413
- "dcatde:contributorID": (m = e["dcatapde:contributorID"]) == null ? void 0 : m.map((a) => T(a)).filter(Boolean),
414
- "dcatde:geocodingDescription": (B = s(
428
+ "dcatde:contributorID": (m = e["dcatapde:contributorID"]) == null ? void 0 : m.map((n) => x(n)).filter(Boolean),
429
+ "dcatde:geocodingDescription": (L = s(
415
430
  e["dcatapde:geocodingDescription"]
416
- )) == null ? void 0 : B.filter(Boolean),
417
- "dct:identifier": (h = e["dct:identifier"]) == null ? void 0 : h.map((a) => ({
418
- "@value": a
431
+ )) == null ? void 0 : L.filter(Boolean),
432
+ "dct:identifier": (R = e["dct:identifier"]) == null ? void 0 : R.map((n) => ({
433
+ "@value": n
419
434
  })),
420
- "adms:identifier": (R = s(e["adms:identifier"])) == null ? void 0 : R.filter(Boolean),
421
- "owl:versionInfo": (v = e["owl:versionInfo"]) == null ? void 0 : v.map((a) => ({
422
- "@value": a
435
+ "adms:identifier": (B = s(e["adms:identifier"])) == null ? void 0 : B.filter(Boolean),
436
+ "owl:versionInfo": (T = e["owl:versionInfo"]) == null ? void 0 : T.map((n) => ({
437
+ "@value": n
423
438
  })),
424
439
  "adms:versionNotes": e["adms:versionNotes"],
425
- "dcatde:legalBasis": (P = s(e["dcatapde:legalBasis"])) == null ? void 0 : P.filter(
440
+ "dcatde:legalBasis": (I = s(e["dcatapde:legalBasis"])) == null ? void 0 : I.filter(
426
441
  Boolean
427
442
  ),
428
- "dct:relation": (w = s(e["dct:relation"])) == null ? void 0 : w.filter(Boolean),
429
- "dcat:landingPage": (l = s(e["dcat:landingPage"])) == null ? void 0 : l.filter(
443
+ "dct:relation": (S = s(e["dct:relation"])) == null ? void 0 : S.filter(Boolean),
444
+ "dcat:landingPage": (u = s(e["dcat:landingPage"])) == null ? void 0 : u.filter(
430
445
  Boolean
431
446
  ),
432
- "prov:wasGeneratedBy": (y = s(e["prov:wasGeneratedBy"])) == null ? void 0 : y.filter(
447
+ "prov:wasGeneratedBy": (D = s(e["prov:wasGeneratedBy"])) == null ? void 0 : D.filter(
433
448
  Boolean
434
449
  ),
435
- "dct:isReferencedBy": (I = s(e["dct:isReferencedBy"])) == null ? void 0 : I.filter(
450
+ "dct:isReferencedBy": (P = s(e["dct:isReferencedBy"])) == null ? void 0 : P.filter(
436
451
  Boolean
437
452
  ),
438
- "dct:source": (D = s(e["dct:source"])) == null ? void 0 : D.filter(Boolean),
439
- "dct:hasVersion": (U = s(e["dct:hasVersion"])) == null ? void 0 : U.filter(Boolean),
440
- "dct:isVersionOf": (V = s(e["dct:isVersionOf"])) == null ? void 0 : V.filter(Boolean),
441
- "prov:qualifiedAttribution": (x = s(
453
+ "dct:source": (A = s(e["dct:source"])) == null ? void 0 : A.filter(Boolean),
454
+ "dct:hasVersion": (a = s(e["dct:hasVersion"])) == null ? void 0 : a.filter(Boolean),
455
+ "dct:isVersionOf": (y = s(e["dct:isVersionOf"])) == null ? void 0 : y.filter(Boolean),
456
+ "prov:qualifiedAttribution": (V = s(
442
457
  e["prov:qualifiedAttribution"]
443
- )) == null ? void 0 : x.filter(Boolean),
444
- "dcat:keyword": (L = s(e["dcat:keyword"])) == null ? void 0 : L.filter(Boolean),
445
- "dct:spatial": (M = s(e["dct:spatial"])) == null ? void 0 : M.filter(Boolean),
446
- "dct:references": (E = s(e["dct:references"])) == null ? void 0 : E.filter(Boolean),
447
- "foaf:page": (G = s(e["foaf:page"])) == null ? void 0 : G.filter(Boolean).map((a) => {
448
- if (!a) return;
449
- const A = o(a["dct:format"]);
458
+ )) == null ? void 0 : V.filter(Boolean),
459
+ "dcat:keyword": (v = s(e["dcat:keyword"])) == null ? void 0 : v.filter(Boolean),
460
+ "dct:spatial": (j = s(e["dct:spatial"])) == null ? void 0 : j.filter(Boolean),
461
+ "dct:references": (C = s(e["dct:references"])) == null ? void 0 : C.filter(Boolean),
462
+ "foaf:page": (G = s(e["foaf:page"])) == null ? void 0 : G.filter(Boolean).map((n) => {
463
+ if (!n)
464
+ return;
465
+ const w = o(n["dct:format"]);
450
466
  return {
451
- "dct:title": o(a["dct:title"]),
452
- "dct:description": o(a["dct:description"]),
453
- "@value": A ? d(A.prefLabel) : "",
454
- uri: A ? A["@id"] : "",
455
- "foaf:homepage": o(a["foaf:homepage"]) || ""
467
+ "dct:title": o(n["dct:title"]),
468
+ "dct:description": o(n["dct:description"]),
469
+ "@value": w ? l(w.prefLabel) : "",
470
+ uri: w ? w["@id"] : "",
471
+ "foaf:homepage": o(n["foaf:homepage"]) || ""
456
472
  };
457
473
  }),
458
- "dcatap:availability": (C = e["dcatap:availability"]) == null ? void 0 : C.map((a) => {
459
- var A, F, O, _;
474
+ "dcatap:availability": (q = e["dcatap:availability"]) == null ? void 0 : q.map((n) => {
475
+ var w, _, O, k;
460
476
  return {
461
477
  // Redundant label and title for better compatibility
462
- label: ((A = o(a)) == null ? void 0 : A.prefLabel) || "",
463
- title: ((F = o(a)) == null ? void 0 : F.prefLabel) || "",
464
- uri: ((O = o(a)) == null ? void 0 : O["@id"]) || "",
465
- "@value": d((_ = o(a)) == null ? void 0 : _.prefLabel) || ""
478
+ label: ((w = o(n)) == null ? void 0 : w.prefLabel) || "",
479
+ title: ((_ = o(n)) == null ? void 0 : _.prefLabel) || "",
480
+ uri: ((O = o(n)) == null ? void 0 : O["@id"]) || "",
481
+ "@value": l((k = o(n)) == null ? void 0 : k.prefLabel) || ""
466
482
  };
467
483
  })
468
484
  };
469
- return ae(r);
485
+ return ne(i);
470
486
  }
471
487
  function ge(e) {
472
488
  return {
473
489
  Landing: de(),
474
490
  Discoverability: le(e),
475
491
  BasicInfos: se(e),
476
- Covering: fe(e),
492
+ Covering: ue(e),
477
493
  DistributionSimple: pe(e),
478
494
  ReviewAndPublish: me(),
479
495
  Additionals: be(e)
480
496
  };
481
497
  }
482
498
  function ye(e) {
483
- return !e || !Array.isArray(e) || e.length === 0 ? [] : e.map((r, i) => {
484
- var t, n;
485
- return {
486
- id: i + 1,
487
- "dcat:downloadURL": ((t = o(r["dcat:endpointURL"])) == null ? void 0 : t["@id"]) || "",
488
- "dcat:endpointURL": ((n = o(r["dcat:endpointURL"])) == null ? void 0 : n["@id"]) || "",
489
- "dct:description": d(r["dct:description"]) || "",
490
- "dct:title": d(r["dct:title"]) || ""
491
- };
492
- });
493
- }
494
- function he(e) {
495
- return !e || !Array.isArray(e) || e.length === 0 ? [] : e.map((r, i) => {
496
- var t, n, p, c;
499
+ return !e || !Array.isArray(e) || e.length === 0 ? [] : e.map((i, r) => {
500
+ var t, c;
497
501
  return {
498
- id: i + 1,
499
- "dcat:downloadURL": ((t = o(r["dcat:accessURL"])) == null ? void 0 : t["@id"]) || "",
500
- "dcat:accessURL": ((n = o(r["dcat:accessURL"])) == null ? void 0 : n["@id"]) || "",
501
- "dct:description": d(r["dct:description"]) || "",
502
- "dct:title": d(r["dct:title"]) || "",
503
- "dct:format": r["dct:format"] && ((p = T(o(r["dct:format"]))) == null ? void 0 : p.label) || "",
504
- formatUri: r["dct:format"] && ((c = T(o(r["dct:format"]))) == null ? void 0 : c.uri) || ""
502
+ id: r + 1,
503
+ "dcat:downloadURL": ((t = o(i["dcat:endpointURL"])) == null ? void 0 : t["@id"]) || "",
504
+ "dcat:endpointURL": ((c = o(i["dcat:endpointURL"])) == null ? void 0 : c["@id"]) || "",
505
+ "dct:description": l(i["dct:description"]) || "",
506
+ "dct:title": l(i["dct:title"]) || ""
505
507
  };
506
508
  });
507
509
  }
508
510
  export {
509
511
  s as asSomeArray,
510
- d as extractLocalizedString,
512
+ l as extractLocalizedString,
511
513
  f as extractStringValue,
512
514
  o as getFirstItem,
513
- z as normalizeToArray,
514
- ae as purgeNullishAndEmptyProperties,
515
+ M as normalizeToArray,
516
+ ne as purgeNullishAndEmptyProperties,
515
517
  ye as toAccessService,
516
- he as toDocument,
517
518
  ge as toDpi,
518
- Te as useDpiSimpleLoader
519
+ ve as useDpiSimpleLoader
519
520
  };