@piveau/dpi 0.2.0-alpha.47 → 0.2.0-alpha.48

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