@piveau/dpi 0.1.0-beta.45 → 0.1.0-beta.47

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