@piveau/dpi 0.1.0-beta.5 → 0.1.0-beta.51

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 (74) 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/DataProviderInterface.vue2.js +45 -40
  4. package/dist/data-provider-interface/HappyFlowComponents/ComponentLibrary.vue.js +1 -1
  5. package/dist/data-provider-interface/HappyFlowComponents/HomeTable.vue.js +58 -53
  6. package/dist/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +78 -66
  7. package/dist/data-provider-interface/HappyFlowComponents/ui/CloseOpenButtonV3.vue.js +11 -10
  8. package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.js +100 -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 +7 -7
  11. package/dist/data-provider-interface/HappyFlowComponents/ui/ModalV3.vue.js +434 -360
  12. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AccessServiceV3.vue.js +103 -71
  13. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AvailabilityV3.vue.js +17 -22
  14. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChangeLicenseV3.vue.js +130 -77
  15. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ChecksumV3.vue.js +91 -61
  16. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/ConformsToV3.vue.js +111 -74
  17. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/DocumentationsV3.vue.js +170 -99
  18. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/LanguageV3.vue.js +109 -52
  19. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/PolicyV3.vue.js +65 -86
  20. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/StatusV3.vue.js +29 -28
  21. package/dist/data-provider-interface/HappyFlowComponents/ui/RapModal.vue.js +153 -102
  22. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/AdditionalsSubModal.vue.js +571 -207
  23. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +100 -53
  24. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/DistributionModal.vue.js +34 -56
  25. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/EssentialsModal.vue.js +301 -100
  26. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/FindabilityChips.vue.js +46 -27
  27. package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/HVDSwitch.vue.js +70 -39
  28. package/dist/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +182 -105
  29. package/dist/data-provider-interface/HappyFlowComponents/ui/TextAreaV3.vue.js +19 -14
  30. package/dist/data-provider-interface/HappyFlowComponents/ui/TextButtonSmall.vue.js +1 -1
  31. package/dist/data-provider-interface/HappyFlowComponents/ui/Toast.vue.js +30 -29
  32. package/dist/data-provider-interface/components/ContactPage.vue.js +153 -105
  33. package/dist/data-provider-interface/components/DiscoverabilityPage.vue.js +32 -32
  34. package/dist/data-provider-interface/components/DistLicense.vue.js +198 -99
  35. package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +856 -790
  36. package/dist/data-provider-interface/components/Dropup.vue.js +6 -6
  37. package/dist/data-provider-interface/components/HVDPage.vue.js +105 -82
  38. package/dist/data-provider-interface/components/InfoSlot.vue.js +5 -5
  39. package/dist/data-provider-interface/components/PolGeoUriPage.vue.js +89 -46
  40. package/dist/data-provider-interface/components/PublisherPage.vue.js +111 -81
  41. package/dist/data-provider-interface/components/ReviewAndPublishPage.vue.js +302 -251
  42. package/dist/data-provider-interface/components/TempResPage.vue.js +267 -187
  43. package/dist/data-provider-interface/components/TempResPageInModal.vue.js +395 -0
  44. package/dist/data-provider-interface/components/UpdateDate.vue.js +33 -29
  45. package/dist/data-provider-interface/components/dpiV3Description.vue.js +7 -6
  46. package/dist/data-provider-interface/composables/useDpiContext.js +5 -7
  47. package/dist/data-provider-interface/composables/useDpiEditMode.js +15 -13
  48. package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +397 -244
  49. package/dist/data-provider-interface/config/dcatapde/vocab-prefixes.js +1 -1
  50. package/dist/data-provider-interface/config/dcatapdeHappyFlow/converter.js +472 -95
  51. package/dist/data-provider-interface/config/dcatapdeHappyFlow/input-definition.js +104 -152
  52. package/dist/data-provider-interface/config/dcatapdeHappyFlow/page-content-config.js +10 -3
  53. package/dist/data-provider-interface/store/index.js +32 -0
  54. package/dist/data-provider-interface/store/modules/authStore.js +301 -0
  55. package/dist/data-provider-interface/store/modules/catalogueDetailsStore.js +34 -0
  56. package/dist/data-provider-interface/store/modules/cataloguesStore.js +256 -0
  57. package/dist/data-provider-interface/store/modules/datasetDetailsStore.js +644 -0
  58. package/dist/data-provider-interface/store/modules/datasetsStore.js +361 -0
  59. package/dist/data-provider-interface/store/{dpiStore.js → modules/dpiStore.js} +11 -12
  60. package/dist/data-provider-interface/store/modules/snackbarStore.js +45 -0
  61. package/dist/data-provider-interface/views/DraftsPage.vue.js +3 -3
  62. package/dist/data-provider-interface/views/InputPage.vue.js +378 -752
  63. package/dist/index.js +4 -4
  64. package/dist/styles/_dpi.scss +1614 -0
  65. package/dist/styles/_maps.scss +24 -0
  66. package/dist/styles/_variables.scss +973 -0
  67. package/dist/utils/draftApi.js +33 -0
  68. package/dist/utils/helpers.js +36 -22
  69. package/dist/utils/identifiersApi.js +16 -0
  70. package/dist/utils/jwt.js +7 -0
  71. package/package.json +12 -7
  72. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AccessRightsV3.vue.js +0 -41
  73. package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/LicenseAttributionByText.vue.js +0 -46
  74. package/dist/data-provider-interface/store/modules/formSchemaStore.js +0 -94
@@ -1,75 +1,83 @@
1
- import { toRef as O, toValue as x, ref as E, computed as T, watch as F } 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 O, watch as E } from "vue";
2
+ import { useAsyncState as ie } from "@vueuse/core";
3
+ import { defineJsonldResolver as re, dcatDatasetTransformer as oe, datasetResolvers as ae } from "@piveau/jsonld";
4
+ import { isEmpty as ne } 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 && !ne(t)
19
+ )
20
+ );
17
21
  }
18
- function ce(e, i) {
19
- const { enabled: t, hubSearchUrl: r } = i, n = O(x(t) ?? !1), { 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, n = ee(t), { safeTransform: f } = re({
24
+ baseUrl: i,
25
+ resolvers: ae(),
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(x(e));
33
- if (c.error)
34
- return p.value.push({
35
+ var D;
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 || !((D = h["dpi:isDPIv3"]) != null && D["@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 = O(
54
+ () => n.value && !y.value && !!g.value
55
+ ), L = O(
56
+ () => n.value && !!R.value
57
+ ), v = O(() => L.value), w = O(() => {
58
+ var l;
59
+ return (l = m.value) == null ? void 0 : l.dpiData;
60
+ }), P = O(() => {
61
+ var l;
62
+ return (l = m.value) == null ? void 0 : l.data;
55
63
  });
56
- return F(
57
- () => x(e),
58
- (c) => c && n.value ? R() : null
59
- ), F(A, (c) => {
60
- console.log("jsonld resolved result:", c);
61
- }), F(v, (c) => {
62
- console.log("jsonld error:", c);
64
+ return E(
65
+ () => N(e),
66
+ (l) => l && n.value ? B() : null
67
+ ), E(P, (l) => {
68
+ console.log("jsonld resolved result:", l);
69
+ }), E(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: v,
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,450 @@ 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
+ (n) => n["@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 K(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 T(e, r) {
112
118
  const t = e.prefLabel;
113
- return S({
119
+ return K({
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, n] of Object.entries(r))
161
+ t[i] = u(e == null ? void 0 : e[n]);
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
214
  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
- })];
215
+ t["dct:publisher"] = [
216
+ Y(n, {
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
224
  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
- })];
225
+ t["dcat:contactPoint"] = [
226
+ Y(n, {
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, n) => {
258
+ const c = o(n["dcat:startDate"]), m = o(n["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] : "", v = 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: v || ""
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, n, f, c, m, g, y, b, B, R, L, v, w, P, l, h, U, D, x, F, j, z, M;
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: ((n = o(e["dct:format"])) == null ? void 0 : n["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(T(e["dct:accessRights"])) : [],
252
311
  "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) || ""
312
+ // Redundant label and title for better compatibility
313
+ label: ((b = o(e["dcatap:availability"])) == null ? void 0 : b.prefLabel) || "",
314
+ title: ((B = o(e["dcatap:availability"])) == null ? void 0 : B.prefLabel) || "",
315
+ uri: ((R = o(e["dcatap:availability"])) == null ? void 0 : R["@id"]) || ""
255
316
  },
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"]) || ""
259
- }),
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"]) || ""
317
+ "dct:language": ((L = e["dct:language"]) == null ? void 0 : L.map((p) => T(p)).filter(Boolean)) || [],
318
+ "dcat:mediaType": K({
319
+ label: d(
320
+ (v = o(e["dcat:mediaType"])) == null ? void 0 : v.prefLabel
321
+ ) || "",
322
+ uri: ((w = o(e["dcat:mediaType"])) == null ? void 0 : w["@id"]) || ""
263
323
  }),
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"]) || ""
324
+ "dcat:compressFormat": K({
325
+ label: d(
326
+ (P = o(e["dcat:compressFormat"])) == null ? void 0 : P.prefLabel
327
+ ) || "",
328
+ uri: ((l = o(e["dcat:compressFormat"])) == null ? void 0 : l["@id"]) || ""
267
329
  }),
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"]) || ""
330
+ "dcat:packageFormat": K({
331
+ label: d(
332
+ (h = o(e["dcat:packageFormat"])) == null ? void 0 : h.prefLabel
333
+ ) || "",
334
+ uri: ((U = o(e["dcat:packageFormat"])) == null ? void 0 : U["@id"]) || ""
271
335
  }),
272
- "adms:status": ((A = o(e["adms:status"])) == null ? void 0 : A["@id"]) || "",
336
+ "adms:status": {
337
+ uri: ((D = o(e["adms:status"])) == null ? void 0 : D["@id"]) || "",
338
+ "@value": d((x = o(e["adms:status"])) == null ? void 0 : x.prefLabel) || ""
339
+ },
273
340
  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#")
341
+ title: u(o(t == null ? void 0 : t["spdx:checksumValue"])),
342
+ "spdx:checksum": ((F = u(o(t == null ? void 0 : t["spdx:algorithm"]))) == null ? void 0 : F.split("_").pop()) || "",
343
+ uri: (j = u(
344
+ o(t == null ? void 0 : t["spdx:algorithm"])
345
+ )) == null ? void 0 : j.replace("spdx:", "http://spdx.org/rdf/terms#")
277
346
  },
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)
347
+ accessServices: he(e["dcat:accessService"] || []),
348
+ documentations: Re(e["foaf:page"] || []),
349
+ conformsToItems: (z = e["dct:conformsTo"]) == null ? void 0 : z.map((p, I) => ({
350
+ // for some reason dct:conformsTo is different from the one on dcat:dataset level
351
+ id: I + 1,
352
+ "dcat:accessURL": p["@id"],
353
+ "dct:title": d(p["rdfs:label"]) || "",
354
+ "dcat:downloadURL": p["@id"],
355
+ // redundancy to match properties on dcat:dataset level
356
+ "rdfs:label": d(p["rdfs:label"]) || "",
357
+ uri: p["@id"]
358
+ })).filter(Boolean),
359
+ policyItems: ((M = e["odrl:hasPolicy"]) == null ? void 0 : M.map((p, I) => ({
360
+ // don't ask
361
+ id: I + 1,
362
+ "dcat:downloadURL": p["@id"],
363
+ "dcat:accessURL": p["@id"]
364
+ }))) || [{ id: 1, "dcat:downloadURL": "", "dcat:accessURL": "" }]
286
365
  };
287
366
  }
288
- function W(e) {
289
- var t;
290
- const i = {
291
- "dcat:distribution": [],
292
- "dct:license": [{
293
- label: ""
294
- }]
367
+ function me(e) {
368
+ var t, i;
369
+ const r = {
370
+ "dcat:distribution": []
295
371
  };
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
372
  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);
373
+ const n = V(e["dcat:distribution"]);
374
+ r["dcat:distribution"] = n.map((f, c) => pe(f, c)).filter((f) => Object.keys(f).length > 0);
309
375
  }
310
- return i;
376
+ 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
377
  }
312
- function Y(e) {
378
+ function be(e) {
313
379
  return {
314
380
  reviewAndPublishPage: [{ isValid: !0 }]
315
381
  };
316
382
  }
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"]
383
+ function ge(e) {
384
+ var t, i, n, f, c, m, g, y, b, B, R, L, v, w, P, l, h, U, D, x, F, j, z, M, p, I, C, q;
385
+ const r = {
386
+ "dct:language": (t = e["dct:language"]) == null ? void 0 : t.map((a) => T(a)).filter(Boolean),
387
+ "dcatde:politicalGeocodingLevelURI": (i = e["dcatapde:politicalGeocodingLevelURI"]) == null ? void 0 : i.map((a) => ({
388
+ uri: a["@id"],
389
+ "@value": d(a.prefLabel)
390
+ })),
391
+ "dct:conformsTo": (n = e["dct:conformsTo"]) == null ? void 0 : n.map((a) => ({
392
+ "rdfs:label": d(a["rdfs:label"]) || "",
393
+ "@id": a["@id"]
324
394
  })).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"]
395
+ "dct:accessRights": e["dct:accessRights"] ? s(T(e["dct:accessRights"])) : [],
396
+ "dct:issued": V(e["dct:issued"]),
397
+ "dct:provenance": (f = e["dct:provenance"]) == null ? void 0 : f.map((a) => ({
398
+ "rdfs:label": d(a["rdfs:label"]) || "",
399
+ uri: a["@id"]
329
400
  })).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 })),
401
+ "dct:accrualPeriodicity": e["dct:accrualPeriodicity"] ? s(T(e["dct:accrualPeriodicity"])) : [],
402
+ "dct:type": (c = e["dct:type"]) == null ? void 0 : c.map((a) => T(a)).filter(Boolean),
403
+ "dcat:spatialResolutionInMeters": ((m = e["dcat:spatialResolutionInMeters"]) == null ? void 0 : m.map(H)) || void 0,
404
+ "dcat:temporalResolution": e["dcat:temporalResolution"] ? e["dcat:temporalResolution"].map(H).map((a) => {
405
+ const G = a["@value"].match(
406
+ /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/
407
+ );
408
+ if (G) {
409
+ const [, _, k, $, J, W, Q] = G.map(
410
+ (Z) => Z || "0"
411
+ );
412
+ return [
413
+ { Year: _ },
414
+ { Month: k },
415
+ { Day: $ },
416
+ { Hour: J },
417
+ { Minute: W },
418
+ { Second: Q }
419
+ ];
420
+ }
421
+ }).filter(Boolean).flat() : void 0,
422
+ "dcat:qualifiedRelation": (g = s(
423
+ e["dcat:qualifiedRelation"]
424
+ )) == null ? void 0 : g.filter(Boolean),
425
+ "dct:creator": (y = s(e["dct:creator"])) == null ? void 0 : y.filter(Boolean),
426
+ "dct:contributor": (b = s(e["dct:contributor"])) == null ? void 0 : b.filter(Boolean),
427
+ "dcatde:contributorID": (B = e["dcatapde:contributorID"]) == null ? void 0 : B.map((a) => T(a)).filter(Boolean),
428
+ "dcatde:geocodingDescription": (R = s(
429
+ e["dcatapde:geocodingDescription"]
430
+ )) == null ? void 0 : R.filter(Boolean),
431
+ "dct:identifier": (L = e["dct:identifier"]) == null ? void 0 : L.map((a) => ({
432
+ "@value": a
433
+ })),
434
+ "adms:identifier": (v = s(e["adms:identifier"])) == null ? void 0 : v.filter(Boolean),
435
+ "owl:versionInfo": (w = e["owl:versionInfo"]) == null ? void 0 : w.map((a) => ({
436
+ "@value": a
437
+ })),
342
438
  "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)
439
+ "dcatde:legalBasis": (P = s(e["dcatapde:legalBasis"])) == null ? void 0 : P.filter(
440
+ Boolean
441
+ ),
442
+ "dct:relation": (l = s(e["dct:relation"])) == null ? void 0 : l.filter(Boolean),
443
+ "dcat:landingPage": (h = s(e["dcat:landingPage"])) == null ? void 0 : h.filter(
444
+ Boolean
445
+ ),
446
+ "prov:wasGeneratedBy": (U = s(e["prov:wasGeneratedBy"])) == null ? void 0 : U.filter(
447
+ Boolean
448
+ ),
449
+ "dct:isReferencedBy": (D = s(e["dct:isReferencedBy"])) == null ? void 0 : D.filter(
450
+ Boolean
451
+ ),
452
+ "dct:source": (x = s(e["dct:source"])) == null ? void 0 : x.filter(Boolean),
453
+ "dct:hasVersion": (F = s(e["dct:hasVersion"])) == null ? void 0 : F.filter(Boolean),
454
+ "dct:isVersionOf": (j = s(e["dct:isVersionOf"])) == null ? void 0 : j.filter(Boolean),
455
+ "prov:qualifiedAttribution": (z = s(
456
+ e["prov:qualifiedAttribution"]
457
+ )) == null ? void 0 : z.filter(Boolean),
458
+ "dcat:keyword": (M = s(e["dcat:keyword"])) == null ? void 0 : M.filter(Boolean),
459
+ "dct:spatial": (p = s(e["dct:spatial"])) == null ? void 0 : p.filter((a) => a ? !a["@id"].startsWith(
460
+ "http://dcat-ap.de/def/politicalGeocoding/"
461
+ ) : !1).filter(Boolean),
462
+ "dct:references": (I = s(e["dct:references"])) == null ? void 0 : I.filter(Boolean),
463
+ "foaf:page": (C = s(e["foaf:page"])) == null ? void 0 : C.filter(Boolean).map((a) => {
464
+ if (!a) return;
465
+ const A = o(a["dct:format"]);
466
+ return {
467
+ "dct:title": o(a["dct:title"]),
468
+ "dct:description": o(a["dct:description"]),
469
+ "@value": A ? d(A.prefLabel) : "",
470
+ uri: A ? A["@id"] : "",
471
+ "foaf:homepage": o(a["foaf:homepage"]) || ""
472
+ };
473
+ }),
474
+ "dcatap:availability": (q = e["dcatap:availability"]) == null ? void 0 : q.map(
475
+ (a) => {
476
+ var A, G, _, k;
477
+ return {
478
+ // Redundant label and title for better compatibility
479
+ label: ((A = o(a)) == null ? void 0 : A.prefLabel) || "",
480
+ title: ((G = o(a)) == null ? void 0 : G.prefLabel) || "",
481
+ uri: ((_ = o(a)) == null ? void 0 : _["@id"]) || "",
482
+ "@value": d((k = o(a)) == null ? void 0 : k.prefLabel) || ""
483
+ };
484
+ }
485
+ )
351
486
  };
352
- return $(i);
487
+ return ce(r);
353
488
  }
354
- function ee(e) {
489
+ function ye(e) {
355
490
  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)
491
+ Landing: le(),
492
+ Discoverability: se(e),
493
+ BasicInfos: fe(e),
494
+ Covering: ue(e),
495
+ DistributionSimple: me(e),
496
+ ReviewAndPublish: be(),
497
+ Additionals: ge(e)
363
498
  };
364
499
  }
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
- }));
500
+ function he(e) {
501
+ return !e || !Array.isArray(e) || e.length === 0 ? [] : e.map((r, t) => {
502
+ var i, n;
503
+ return {
504
+ id: t + 1,
505
+ "dcat:downloadURL": ((i = o(r["dcat:endpointURL"])) == null ? void 0 : i["@id"]) || "",
506
+ "dcat:endpointURL": ((n = o(r["dcat:endpointURL"])) == null ? void 0 : n["@id"]) || "",
507
+ "dct:description": d(r["dct:description"]) || "",
508
+ "dct:title": d(r["dct:title"]) || ""
509
+ };
510
+ });
511
+ }
512
+ function Re(e) {
513
+ return !e || !Array.isArray(e) || e.length === 0 ? [] : e.map((r, t) => {
514
+ var i, n, f, c;
515
+ return {
516
+ id: t + 1,
517
+ "dcat:downloadURL": ((i = o(r["dcat:accessURL"])) == null ? void 0 : i["@id"]) || "",
518
+ "dcat:accessURL": ((n = o(r["dcat:accessURL"])) == null ? void 0 : n["@id"]) || "",
519
+ "dct:description": d(r["dct:description"]) || "",
520
+ "dct:title": d(r["dct:title"]) || "",
521
+ "dct:format": r["dct:format"] && ((f = T(o(r["dct:format"]))) == null ? void 0 : f.label) || "",
522
+ formatUri: r["dct:format"] && ((c = T(o(r["dct:format"]))) == null ? void 0 : c.uri) || ""
523
+ };
524
+ });
373
525
  }
374
526
  export {
375
- d as asSomeArray,
376
- s as extractLocalizedString,
377
- a as extractStringValue,
527
+ s as asSomeArray,
528
+ d as extractLocalizedString,
529
+ u as extractStringValue,
378
530
  o as getFirstItem,
379
- L as normalizeToArray,
380
- $ as purgeNullishAndEmptyProperties,
381
- te as toAccessService,
382
- ee as toDpi,
383
- ce as useDpiSimpleLoader
531
+ V as normalizeToArray,
532
+ ce as purgeNullishAndEmptyProperties,
533
+ he as toAccessService,
534
+ Re as toDocument,
535
+ ye as toDpi,
536
+ De as useDpiSimpleLoader
384
537
  };