@piveau/dpi 0.1.0-beta.8 → 0.1.0-beta.80

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