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

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.
@@ -1,12 +1,12 @@
1
- import { ref as d, getCurrentInstance as k, computed as L, createElementBlock as v, openBlock as g, createElementVNode as c, toDisplayString as I, createVNode as G, createCommentVNode as b, unref as f } from "vue";
1
+ import { ref as n, getCurrentInstance as k, computed as L, createElementBlock as v, openBlock as g, createElementVNode as s, toDisplayString as I, createVNode as G, createCommentVNode as b, unref as f } from "vue";
2
2
  import R from "../HappyFlowComponents/ui/Dropdown.vue.js";
3
- import { filterGeocodingURIs as A } from "../HappyFlowComponents/services/dpiV3_apis.js";
4
- import { PhMagnifyingGlass as w } from "@phosphor-icons/vue";
5
- import { useFormValues as P } from "../composables/useDpiFormValues.js";
3
+ import { filterGeocodingURIs as w } from "../HappyFlowComponents/services/dpiV3_apis.js";
4
+ import { PhMagnifyingGlass as P } from "@phosphor-icons/vue";
5
+ import { useFormValues as S } from "../composables/useDpiFormValues.js";
6
6
  /* empty css */
7
- import S from "../../_virtual/_plugin-vue_export-helper.js";
8
- import { useEditModeInfo as C } from "../composables/useDpiEditMode.js";
9
- const x = { class: "dpiV3InnerComponentWrap" }, E = { class: "copy-large-regular" }, K = { class: "dropdown-container" }, T = {
7
+ import C from "../../_virtual/_plugin-vue_export-helper.js";
8
+ import { useEditModeInfo as x } from "../composables/useDpiEditMode.js";
9
+ const A = { class: "dpiV3InnerComponentWrap" }, E = { class: "copy-large-regular" }, K = { class: "dropdown-container" }, T = {
10
10
  key: 0,
11
11
  class: "empty-state-message"
12
12
  }, D = {
@@ -18,44 +18,44 @@ const x = { class: "dpiV3InnerComponentWrap" }, E = { class: "copy-large-regular
18
18
  context: Object
19
19
  },
20
20
  setup(B) {
21
- const { isEditMode: y } = C(), { formValues: a } = P();
22
- let l = d([]), _ = k().appContext.app.config.globalProperties.$env, m;
23
- const o = d(!1), n = d(!1), u = d(""), s = d(!1), p = L(() => u.value && n.value && !o.value && l.value.length === 0 && !s.value);
24
- y.value || (a.value.Covering["dcatde:politicalGeocodingURI"] = [
21
+ const { isEditMode: y } = x(), { formValues: t } = S();
22
+ let o = n([]), _ = k().appContext.app.config.globalProperties.$env, m;
23
+ const l = n(!1), d = n(!1), c = n(""), r = n(!1), u = L(() => c.value && d.value && !l.value && o.value.length === 0 && !r.value);
24
+ y.value || (t.value.Covering["dcatde:politicalGeocodingURI"] = [
25
25
  { isValid: !0 }
26
26
  ]);
27
27
  const U = async (e) => {
28
- clearTimeout(m), u.value = e, s.value = !1, m = setTimeout(async () => {
28
+ clearTimeout(m), c.value = e, r.value = !1, m = setTimeout(async () => {
29
29
  if (e !== "")
30
30
  try {
31
- o.value = !0, n.value = !0, l.value = await A(e, _.api.baseUrl), h();
32
- } catch (t) {
33
- console.log("Error fetching geocoding data:", t), l.value = [], h();
31
+ l.value = !0, d.value = !0, o.value = await w(e, _.api.baseUrl), h();
32
+ } catch (a) {
33
+ console.log("Error fetching geocoding data:", a), o.value = [], h();
34
34
  } finally {
35
- o.value = !1;
35
+ l.value = !1;
36
36
  }
37
37
  else
38
- l.value = [], n.value = !1, s.value = !1, a.value.Covering["dcatde:politicalGeocodingURI"] = [
38
+ o.value = [], d.value = !1, r.value = !1, t.value.Covering["dcatde:politicalGeocodingURI"] = [
39
39
  { isValid: !0 }
40
40
  ];
41
41
  }, 500);
42
42
  }, h = () => {
43
- p.value, a.value.Covering["dcatde:politicalGeocodingURI"] = [
43
+ u.value, t.value.Covering["dcatde:politicalGeocodingURI"] = [
44
44
  { isValid: !0 }
45
45
  ];
46
- }, V = (e, t) => {
47
- s.value = !0, a.value.Covering["dcatde:politicalGeocodingURI"] = [
46
+ }, V = (e, a) => {
47
+ r.value = !0, t.value.Covering["dcatde:politicalGeocodingURI"] = [
48
48
  {
49
49
  isValid: !0,
50
50
  uri: e.resource,
51
51
  id: e.id,
52
52
  label: e.alt_label.de,
53
- inVoc: t
53
+ inVoc: a
54
54
  }
55
- ], a.value.Additionals["dct:spatial"] === void 0 ? (a.value.Additionals["dct:spatial"] = [], a.value.Additionals["dct:spatial"].push({ "@id": e.resource })) : a.value.Additionals["dct:spatial"] = [{ "@id": e.resource }];
56
- const r = e.resource.split("/").slice(-2, -1)[0];
55
+ ];
56
+ const p = e.resource.split("/").slice(-2, -1)[0];
57
57
  let i = "";
58
- switch (r) {
58
+ switch (p) {
59
59
  case "districtKey":
60
60
  i = "http://dcat-ap.de/def/politicalGeocoding/Level/administrativeDistrict";
61
61
  break;
@@ -72,22 +72,22 @@ const x = { class: "dpiV3InnerComponentWrap" }, E = { class: "copy-large-regular
72
72
  i = "http://dcat-ap.de/def/politicalGeocoding/Level/municipality";
73
73
  break;
74
74
  }
75
- console.log(r), a.value.Additionals["dcatapde:politicalGeocodingLevelURI"] === void 0 ? (a.value.Additionals["dcatapde:politicalGeocodingLevelURI"] = [], a.value.Additionals["dcatapde:politicalGeocodingLevelURI"].push({
75
+ t.value.Additionals["dcatapde:politicalGeocodingLevelURI"] === void 0 ? (t.value.Additionals["dcatapde:politicalGeocodingLevelURI"] = [], t.value.Additionals["dcatapde:politicalGeocodingLevelURI"].push({
76
76
  "@id": i
77
- })) : a.value.Additionals["dcatapde:politicalGeocodingLevelURI"] = [
77
+ })) : t.value.Additionals["dcatapde:politicalGeocodingLevelURI"] = [
78
78
  { "@id": i }
79
79
  ];
80
80
  };
81
- return (e, t) => (g(), v("div", x, [
82
- c("h4", null, I(e.$t("message.dataupload.datasets.dcatde:politicalGeocodingURI.title")), 1),
83
- c("div", E, I(e.$t(
81
+ return (e, a) => (g(), v("div", A, [
82
+ s("h4", null, I(e.$t("message.dataupload.datasets.dcatde:politicalGeocodingURI.title")), 1),
83
+ s("div", E, I(e.$t(
84
84
  "message.dataupload.datasets.dcatde:politicalGeocodingURI.description"
85
85
  )), 1),
86
- c("div", K, [
86
+ s("div", K, [
87
87
  G(R, {
88
88
  dropdownWidth: "large",
89
89
  type: "inputField",
90
- onInput: t[0] || (t[0] = (r) => U(r)),
90
+ onInput: a[0] || (a[0] = (p) => U(p)),
91
91
  inputFieldProps: {
92
92
  addOnText: !1,
93
93
  initialHintText: !1,
@@ -100,25 +100,25 @@ const x = { class: "dpiV3InnerComponentWrap" }, E = { class: "copy-large-regular
100
100
  placeholder: "Geben Sie die geopolitische Abdeckung ein..",
101
101
  inputFieldSize: "large",
102
102
  autocomplete: "true",
103
- error: p.value
103
+ error: u.value
104
104
  },
105
105
  onValueSent: V,
106
- data: f(l),
106
+ data: f(o),
107
107
  multi: "true",
108
108
  autocomplete: !0,
109
109
  buttonText: "Dropdown",
110
110
  text: "Dropdown",
111
- loading: o.value
111
+ loading: l.value
112
112
  }, null, 8, ["inputFieldProps", "data", "loading"]),
113
- n.value && !o.value && f(l).length === 0 ? (g(), v("div", T, [
114
- G(f(w), { size: 16 }),
115
- t[1] || (t[1] = c("span", null, "Keine Ergebnisse gefunden. Bitte versuchen Sie einen anderen Suchbegriff.", -1))
113
+ d.value && !l.value && f(o).length === 0 ? (g(), v("div", T, [
114
+ G(f(P), { size: 16 }),
115
+ a[1] || (a[1] = s("span", null, "Keine Ergebnisse gefunden. Bitte versuchen Sie einen anderen Suchbegriff.", -1))
116
116
  ])) : b("", !0),
117
- p.value && u.value ? (g(), v("div", D, " Bitte wählen Sie einen gültigen Wert aus der Liste aus. ")) : b("", !0)
117
+ u.value && c.value ? (g(), v("div", D, " Bitte wählen Sie einen gültigen Wert aus der Liste aus. ")) : b("", !0)
118
118
  ])
119
119
  ]));
120
120
  }
121
- }, q = /* @__PURE__ */ S(F, [["__scopeId", "data-v-06749e76"]]);
121
+ }, q = /* @__PURE__ */ C(F, [["__scopeId", "data-v-c8764ab4"]]);
122
122
  export {
123
123
  q as default
124
124
  };
@@ -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 _, watch as C } 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";
@@ -50,14 +50,14 @@ function De(e, r) {
50
50
  },
51
51
  null,
52
52
  { immediate: !1 }
53
- ), R = G(
53
+ ), R = _(
54
54
  () => n.value && !y.value && !!g.value
55
- ), L = G(
55
+ ), L = _(
56
56
  () => n.value && !!R.value
57
- ), v = G(() => L.value), w = G(() => {
57
+ ), v = _(() => L.value), w = _(() => {
58
58
  var l;
59
59
  return (l = p.value) == null ? void 0 : l.dpiData;
60
- }), P = G(() => {
60
+ }), P = _(() => {
61
61
  var l;
62
62
  return (l = p.value) == null ? void 0 : l.data;
63
63
  });
@@ -273,7 +273,7 @@ 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 t, n, m, d, p, g, y, b, B, R, L, v, w, P, l, h, U, D, x, F, j, z, M, G;
277
277
  if (!e)
278
278
  return {};
279
279
  const i = o(e["spdx:checksum"]);
@@ -362,7 +362,7 @@ function pe(e, r) {
362
362
  "rdfs:label": c(u["rdfs:label"]) || "",
363
363
  uri: u["@id"]
364
364
  })).filter(Boolean),
365
- policyItems: ((O = e["odrl:hasPolicy"]) == null ? void 0 : O.map((u, I) => ({
365
+ policyItems: ((G = e["odrl:hasPolicy"]) == null ? void 0 : G.map((u, I) => ({
366
366
  // don't ask
367
367
  id: I + 1,
368
368
  "dcat:downloadURL": u["@id"],
@@ -386,7 +386,7 @@ function be(e) {
386
386
  };
387
387
  }
388
388
  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;
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, G, u, I, q;
390
390
  const r = {
391
391
  "dct:language": (i = e["dct:language"]) == null ? void 0 : i.map((a) => T(a)).filter(Boolean),
392
392
  "dcatde:politicalGeocodingLevelURI": (t = e["dcatapde:politicalGeocodingLevelURI"]) == null ? void 0 : t.map((a) => ({
@@ -407,11 +407,11 @@ function ge(e) {
407
407
  "dct:type": (d = e["dct:type"]) == null ? void 0 : d.map((a) => T(a)).filter(Boolean),
408
408
  "dcat:spatialResolutionInMeters": ((p = e["dcat:spatialResolutionInMeters"]) == null ? void 0 : p.map(H)) || void 0,
409
409
  "dcat:temporalResolution": e["dcat:temporalResolution"] ? e["dcat:temporalResolution"].map(H).map((a) => {
410
- const _ = a["@value"].match(
410
+ const O = a["@value"].match(
411
411
  /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/
412
412
  );
413
- if (_) {
414
- const [, k, K, $, J, Q, W] = _.map(
413
+ if (O) {
414
+ const [, k, K, $, J, W, Q] = O.map(
415
415
  (Z) => Z || "0"
416
416
  );
417
417
  return [
@@ -419,8 +419,8 @@ function ge(e) {
419
419
  { Month: K },
420
420
  { Day: $ },
421
421
  { Hour: J },
422
- { Minute: Q },
423
- { Second: W }
422
+ { Minute: W },
423
+ { Second: Q }
424
424
  ];
425
425
  }
426
426
  }).filter(Boolean).flat() : void 0,
@@ -461,7 +461,7 @@ function ge(e) {
461
461
  e["prov:qualifiedAttribution"]
462
462
  )) == null ? void 0 : z.filter(Boolean),
463
463
  "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),
464
+ "dct:spatial": (G = s(e["dct:spatial"])) == null ? void 0 : G.filter((a) => a ? !a["@id"].startsWith("http://dcat-ap.de/def/politicalGeocoding/") : !1).filter(Boolean),
465
465
  "dct:references": (u = s(e["dct:references"])) == null ? void 0 : u.filter(Boolean),
466
466
  "foaf:page": (I = s(e["foaf:page"])) == null ? void 0 : I.filter(Boolean).map((a) => {
467
467
  if (!a) return;
@@ -476,11 +476,11 @@ function ge(e) {
476
476
  }),
477
477
  "dcatap:availability": (q = e["dcatap:availability"]) == null ? void 0 : q.map(
478
478
  (a) => {
479
- var A, _, k, K;
479
+ var A, O, k, K;
480
480
  return {
481
481
  // Redundant label and title for better compatibility
482
482
  label: ((A = o(a)) == null ? void 0 : A.prefLabel) || "",
483
- title: ((_ = o(a)) == null ? void 0 : _.prefLabel) || "",
483
+ title: ((O = o(a)) == null ? void 0 : O.prefLabel) || "",
484
484
  uri: ((k = o(a)) == null ? void 0 : k["@id"]) || "",
485
485
  "@value": c((K = o(a)) == null ? void 0 : K.prefLabel) || ""
486
486
  };
@@ -1,24 +1,24 @@
1
1
  import "axios";
2
- import { asSomeArray as lt } from "../../composables/useDpiSimpleLoader.js";
2
+ import { asSomeArray as pt } from "../../composables/useDpiSimpleLoader.js";
3
3
  let e = { distribution: [], dataset: {}, meta: {} };
4
- function pt(t) {
4
+ function gt(t) {
5
5
  return t.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
6
6
  }
7
- async function ht(t, g, s, b) {
8
- var h, f, v, k, D, O, j, R, w, S, I, x, L, B, C, P, U, T, M, G, q, F, X, $, N, z, E, H, W, Y, _, J, K, Q, Z, m, V, tt, it, dt, et, at, nt, ot;
7
+ async function vt(t, g, l, b) {
8
+ var h, f, v, k, O, D, j, R, w, S, I, x, L, B, P, C, U, T, G, M, q, z, F, X, $, N, E, H, W, Y, _, J, K, Q, Z, m, V, tt, it, dt, et, at, nt, ot, ct, st;
9
9
  const u = g.specification.prefixes;
10
- let r = [];
11
- const c = Object.keys(t);
10
+ let p = [];
11
+ const s = Object.keys(t);
12
12
  e.dataset["dcat:distribution"] = [];
13
- for (let o = 0; o < t.DistributionSimple["dcat:distribution"].length; o++)
14
- r.push(crypto.randomUUID()), e.dataset["dcat:distribution"].push({
15
- "@id": `https://piveau.io/set/distribution/${r[o]}`
13
+ for (let c = 0; c < t.DistributionSimple["dcat:distribution"].length; c++)
14
+ p.push(crypto.randomUUID()), e.dataset["dcat:distribution"].push({
15
+ "@id": `https://piveau.io/set/distribution/${p[c]}`
16
16
  });
17
- const rt = new URLSearchParams(window.location.search).get("edit");
17
+ const bt = new URLSearchParams(window.location.search).get("edit");
18
18
  let y = "";
19
19
  try {
20
- for (let o = 0; o < c.length; o++) {
21
- if (c[o] === "Discoverability") {
20
+ for (let c = 0; c < s.length; c++) {
21
+ if (s[c] === "Discoverability") {
22
22
  let i = [];
23
23
  for (let d = 1; d < t.Discoverability.discoverabilityPage.length; d++)
24
24
  i.push({
@@ -30,16 +30,16 @@ async function ht(t, g, s, b) {
30
30
  "@id": "http://data.europa.eu/eli/reg_impl/2023/138/oj"
31
31
  });
32
32
  }
33
- if (c[o] === "BasicInfos") {
33
+ if (s[c] === "BasicInfos") {
34
34
  e.dataset["dpi:isDPIv3"] = !0;
35
35
  for (let i = 0; i < Object.keys(t.BasicInfos).length; i++)
36
- Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = pt(
36
+ Object.keys(t.BasicInfos)[i] === "dct:title" && (e.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = gt(
37
37
  t.BasicInfos["dct:title"][0]["@value"]
38
- ), rt === "true" && (y = t.BasicInfos.datasetID)), Object.keys(t.BasicInfos)[i] === "dct:description" && (e.dataset["dct:description"] = t.BasicInfos["dct:description"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:modified" && (e.dataset["dct:modified"] = t.BasicInfos["dct:modified"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:publisher" && (e.dataset["dct:publisher"] = t.BasicInfos["dct:publisher"][0] || "", e.dataset["dct:publisher"]["@type"] = "foaf:Agent"), Object.keys(t.BasicInfos)[i] === "dcat:contactPoint" && (e.dataset["dcat:contactPoint"] = t.BasicInfos["dcat:contactPoint"][0] || "", e.dataset["dcat:contactPoint"]["@type"] = "foaf:Agent"), e.dataset["@type"] = "dcat:Dataset", e.meta["dcat:catalog"] = s.permissions[0].rsname, e.meta["@type"] = "dcat:CatalogRecord";
38
+ ), bt === "true" && (y = t.BasicInfos.datasetID)), Object.keys(t.BasicInfos)[i] === "dct:description" && (e.dataset["dct:description"] = t.BasicInfos["dct:description"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:modified" && (e.dataset["dct:modified"] = t.BasicInfos["dct:modified"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:publisher" && (e.dataset["dct:publisher"] = t.BasicInfos["dct:publisher"][0] || "", e.dataset["dct:publisher"]["@type"] = "foaf:Agent"), Object.keys(t.BasicInfos)[i] === "dcat:contactPoint" && (e.dataset["dcat:contactPoint"] = t.BasicInfos["dcat:contactPoint"][0] || "", e.dataset["dcat:contactPoint"]["@type"] = "vcard:Organization"), e.dataset["@type"] = "dcat:Dataset", e.meta["dcat:catalog"] = l.permissions[0].rsname, e.meta["@type"] = "dcat:CatalogRecord";
39
39
  }
40
- if (c[o] === "Covering" && Object.keys(t.Covering).length > 1)
40
+ if (s[c] === "Covering" && Object.keys(t.Covering).length > 1)
41
41
  for (let i = 0; i < Object.keys(t.Covering).length; i++) {
42
- if (Object.keys(t.Covering)[i] === "dcat:temporalResolution" && t.Covering["dcat:temporalResolution"] !== void 0 && Object.keys((v = t.Covering) == null ? void 0 : v["dcat:temporalResolution"]).length > 0 && ((D = (k = t.Covering) == null ? void 0 : k["dcat:temporalResolution"]) == null ? void 0 : D.type) !== void 0) {
42
+ if (Object.keys(t.Covering)[i] === "dcat:temporalResolution" && t.Covering["dcat:temporalResolution"] !== void 0 && Object.keys((v = t.Covering) == null ? void 0 : v["dcat:temporalResolution"]).length > 0 && ((O = (k = t.Covering) == null ? void 0 : k["dcat:temporalResolution"]) == null ? void 0 : O.type) !== void 0) {
43
43
  e.dataset["dct:temporal"] = [];
44
44
  for (let d = 0; d < t.Covering["dcat:temporalResolution"]["dct:temporal"].length; d++)
45
45
  t.Covering["dcat:temporalResolution"].type != null && t.Covering["dcat:temporalResolution"]["dct:temporal"][d].dataType === "date" && t.Covering["dcat:temporalResolution"]["dct:temporal"][d]["dcat:startDate"] !== "" && (e.dataset["dct:temporal"][d] = {
@@ -65,14 +65,16 @@ async function ht(t, g, s, b) {
65
65
  });
66
66
  }
67
67
  Object.keys(t.Covering)[i] === "dcatde:politicalGeocodingURI" && (e.dataset["dcatde:politicalGeocodingURI"] = {
68
- "@id": ((j = (O = t.Covering["dcatde:politicalGeocodingURI"]) == null ? void 0 : O[0]) == null ? void 0 : j.uri) || ""
69
- });
68
+ "@id": ((j = (D = t.Covering["dcatde:politicalGeocodingURI"]) == null ? void 0 : D[0]) == null ? void 0 : j.uri) || ""
69
+ }, e.dataset["dct:spatial"] === void 0 && (e.dataset["dct:spatial"] = []), e.dataset["dct:spatial"].push({
70
+ "@id": (w = (R = t.Covering["dcatde:politicalGeocodingURI"]) == null ? void 0 : R[0]) == null ? void 0 : w.uri
71
+ }));
70
72
  }
71
- if (c[o] === "DistributionSimple")
73
+ if (s[c] === "DistributionSimple")
72
74
  for (let i = 0; i < t.DistributionSimple["dcat:distribution"].length; i++) {
73
- if (e.distribution[i] = {}, ((w = (R = t.Discoverability) == null ? void 0 : R.hvdPage[0]) == null ? void 0 : w.uri) != null && (e.distribution[i]["dcatap:applicableLegislation"] = {
75
+ if (e.distribution[i] = {}, ((I = (S = t.Discoverability) == null ? void 0 : S.hvdPage[0]) == null ? void 0 : I.uri) != null && (e.distribution[i]["dcatap:applicableLegislation"] = {
74
76
  "@id": "http://data.europa.eu/eli/reg_impl/2023/138/oj"
75
- }), e.distribution[i]["@type"] = "dcat:Distribution", e.distribution[i]["@id"] = `https://piveau.io/set/distribution/${r[i]}`, t.DistributionSimple["dcat:distribution"][i]["dcat:accessURL"] && (e.distribution[i]["dcat:accessURL"] = {
77
+ }), e.distribution[i]["@type"] = "dcat:Distribution", e.distribution[i]["@id"] = `https://piveau.io/set/distribution/${p[i]}`, t.DistributionSimple["dcat:distribution"][i]["dcat:accessURL"] && (e.distribution[i]["dcat:accessURL"] = {
76
78
  "@id": t.DistributionSimple["dcat:distribution"][i]["dcat:accessURL"]
77
79
  }), Object.keys(
78
80
  t.DistributionSimple["dcat:distribution"][i]["dcat:downloadURL"]
@@ -84,7 +86,7 @@ async function ht(t, g, s, b) {
84
86
  };
85
87
  }
86
88
  if (Object.keys(
87
- (S = t.DistributionSimple["dcat:distribution"][i]) == null ? void 0 : S.policyItems
89
+ (x = t.DistributionSimple["dcat:distribution"][i]) == null ? void 0 : x.policyItems
88
90
  ).length !== 0) {
89
91
  e.distribution[i]["odrl:hasPolicy"] = [];
90
92
  for (let a = 0; a < t.DistributionSimple["dcat:distribution"][i].policyItems.length; a++)
@@ -92,20 +94,20 @@ async function ht(t, g, s, b) {
92
94
  "@id": t.DistributionSimple["dcat:distribution"][i].policyItems[a]["dcat:downloadURL"]
93
95
  };
94
96
  }
95
- let d = (x = (I = t.DistributionSimple) == null ? void 0 : I["dct:license"]) == null ? void 0 : x[0];
96
- d === void 0 && (d = (P = (C = (B = (L = t.DistributionSimple) == null ? void 0 : L["dcat:distribution"]) == null ? void 0 : B[0]) == null ? void 0 : C["dct:license"]) == null ? void 0 : P[0]), e.distribution[i]["dct:license"] = {
97
+ let d = (B = (L = t.DistributionSimple) == null ? void 0 : L["dct:license"]) == null ? void 0 : B[0];
98
+ d === void 0 && (d = (T = (U = (C = (P = t.DistributionSimple) == null ? void 0 : P["dcat:distribution"]) == null ? void 0 : C[0]) == null ? void 0 : U["dct:license"]) == null ? void 0 : T[0]), e.distribution[i]["dct:license"] = {
97
99
  "@id": (d == null ? void 0 : d.uri) || ""
98
100
  }, e.distribution[i]["dcatde:licenseAttributionByText"] = {
99
101
  "@language": "de",
100
102
  "@value": (d == null ? void 0 : d.attribution) || ""
101
103
  };
102
- const p = (M = (T = (U = t.DistributionSimple) == null ? void 0 : U["dcat:distribution"]) == null ? void 0 : T[i]) == null ? void 0 : M["dct:format"];
103
- p && (e.distribution[i]["dct:format"] = {
104
- "@id": (p == null ? void 0 : p.uri) || ""
105
- }), ((F = (q = (G = t.DistributionSimple) == null ? void 0 : G["dcat:distribution"]) == null ? void 0 : q[i]) == null ? void 0 : F["dcatap:applicableLegislation"]) != null && (e.distribution[i]["dct:format"] = (N = ($ = (X = t.DistributionSimple) == null ? void 0 : X["dcat:distribution"]) == null ? void 0 : $[i]) == null ? void 0 : N["dcatap:applicableLegislation"]["@id"]);
106
- const ct = ((H = (E = (z = t.DistributionSimple) == null ? void 0 : z["dcat:distribution"]) == null ? void 0 : E[i]) == null ? void 0 : H.conformsToItems) || [];
107
- if (ct && (e.distribution[i]["dct:conformsTo"] = lt(
108
- ct
104
+ const o = (q = (M = (G = t.DistributionSimple) == null ? void 0 : G["dcat:distribution"]) == null ? void 0 : M[i]) == null ? void 0 : q["dct:format"];
105
+ o && (e.distribution[i]["dct:format"] = {
106
+ "@id": (o == null ? void 0 : o.uri) || ""
107
+ }), ((X = (F = (z = t.DistributionSimple) == null ? void 0 : z["dcat:distribution"]) == null ? void 0 : F[i]) == null ? void 0 : X["dcatap:applicableLegislation"]) != null && (e.distribution[i]["dct:format"] = (E = (N = ($ = t.DistributionSimple) == null ? void 0 : $["dcat:distribution"]) == null ? void 0 : N[i]) == null ? void 0 : E["dcatap:applicableLegislation"]["@id"]);
108
+ const lt = ((Y = (W = (H = t.DistributionSimple) == null ? void 0 : H["dcat:distribution"]) == null ? void 0 : W[i]) == null ? void 0 : Y.conformsToItems) || [];
109
+ if (lt && (e.distribution[i]["dct:conformsTo"] = pt(
110
+ lt
109
111
  ).filter(
110
112
  (a) => a && (a["dcat:downloadURL"] || a["dct:title"])
111
113
  ).map((a) => ({
@@ -137,10 +139,6 @@ async function ht(t, g, s, b) {
137
139
  }), t.DistributionSimple["dcat:distribution"][i]["dct:title"] && (e.distribution[i]["dct:title"] = {
138
140
  "@language": "de",
139
141
  "@value": t.DistributionSimple["dcat:distribution"][i]["dct:title"]
140
- }), Object.keys(
141
- t.DistributionSimple["dcat:distribution"][i]["dct:accessRights"]
142
- ).length !== 0 && (e.distribution[i]["dct:accessRights"] = {
143
- "@id": t.DistributionSimple["dcat:distribution"][i]["dct:accessRights"].uri
144
142
  }), t.DistributionSimple["dcat:distribution"][i]["dcat:compressFormat"] != null && Object.keys(
145
143
  t.DistributionSimple["dcat:distribution"][i]["dcat:compressFormat"]
146
144
  ).length !== 0 && (console.log(
@@ -172,8 +170,8 @@ async function ht(t, g, s, b) {
172
170
  t.DistributionSimple["dcat:distribution"][i]["adms:status"].uri !== "" && (e.distribution[i]["adms:status"] = {
173
171
  "@id": t.DistributionSimple["dcat:distribution"][i]["adms:status"].uri || ""
174
172
  });
175
- const st = ((_ = (Y = (W = t.DistributionSimple) == null ? void 0 : W["dcat:distribution"]) == null ? void 0 : Y[i]) == null ? void 0 : _.accessServices) || [];
176
- st && (e.distribution[i]["dcat:accessService"] = (J = lt(st)) == null ? void 0 : J.filter(
173
+ const rt = ((K = (J = (_ = t.DistributionSimple) == null ? void 0 : _["dcat:distribution"]) == null ? void 0 : J[i]) == null ? void 0 : K.accessServices) || [];
174
+ rt && (e.distribution[i]["dcat:accessService"] = (Q = pt(rt)) == null ? void 0 : Q.filter(
177
175
  (a) => a && (a["dct:title"] || a["dct:description"] || a["dcat:downloadURL"] || a["dcat:endpointURL"])
178
176
  ).map((a) => {
179
177
  const n = {
@@ -187,39 +185,39 @@ async function ht(t, g, s, b) {
187
185
  "@language": "de",
188
186
  "@value": a["dct:description"]
189
187
  });
190
- const l = a["dcat:downloadURL"] || a["dcat:endpointURL"];
191
- return l !== void 0 && (n["dcat:endpointURL"] = {
192
- "@id": l
188
+ const r = a["dcat:downloadURL"] || a["dcat:endpointURL"];
189
+ return r !== void 0 && (n["dcat:endpointURL"] = {
190
+ "@id": r
193
191
  }), n;
194
192
  })), e.distribution[i]["foaf:page"] || (e.distribution[i]["foaf:page"] = []);
195
- for (let a = 0; a < ((Z = (Q = (K = t.DistributionSimple) == null ? void 0 : K["dcat:distribution"]) == null ? void 0 : Q[i]) == null ? void 0 : Z.documentations.length); a++) {
193
+ for (let a = 0; a < ((V = (m = (Z = t.DistributionSimple) == null ? void 0 : Z["dcat:distribution"]) == null ? void 0 : m[i]) == null ? void 0 : V.documentations.length); a++) {
196
194
  const n = t.DistributionSimple["dcat:distribution"][i].documentations[a];
197
195
  if ((n == null ? void 0 : n["dct:title"]) !== void 0) {
198
- const l = {
196
+ const r = {
199
197
  "@type": "foaf:Document",
200
198
  "dct:title": {
201
199
  "@language": "de",
202
200
  "@value": n["dct:title"]
203
201
  }
204
202
  };
205
- (n == null ? void 0 : n["dct:description"]) !== void 0 && (l["dct:description"] = {
203
+ (n == null ? void 0 : n["dct:description"]) !== void 0 && (r["dct:description"] = {
206
204
  "@language": "de",
207
205
  "@value": n["dct:description"]
208
- }), (n == null ? void 0 : n["dcat:accessURL"]) !== void 0 && (l["dcat:accessURL"] = {
206
+ }), (n == null ? void 0 : n["dcat:accessURL"]) !== void 0 && (r["dcat:accessURL"] = {
209
207
  "@id": n["dcat:accessURL"]
210
- }), (n == null ? void 0 : n["dct:format"]) !== void 0 && (l["dct:format"] = {
208
+ }), (n == null ? void 0 : n["dct:format"]) !== void 0 && (r["dct:format"] = {
211
209
  "@id": n.formatUri
212
- }), e.distribution[i]["foaf:page"][a] = l;
210
+ }), e.distribution[i]["foaf:page"][a] = r;
213
211
  }
214
212
  }
215
213
  }
216
- if (c[o], c[o] === "Additionals")
214
+ if (s[c], s[c] === "Additionals")
217
215
  try {
218
216
  for (let i = 0; i < Object.keys(t.Additionals).length; i++) {
219
217
  if (Object.keys(t.Additionals)[i] === "dcat:landingPage" && (e.dataset["dcat:landingPage"] = [
220
218
  ...t.Additionals["dcat:landingPage"]
221
219
  ]), Object.keys(t.Additionals)[i] === "dct:issued" && (e.dataset["dct:issued"] === void 0 && (e.dataset["dct:issued"] = []), e.dataset["dct:issued"].push({
222
- "@value": t.Additionals["dct:issued"][0]["@value"].split(".").reverse().map((d, p) => p < 2 ? d.padStart(2, "0") : d).join("-") || "",
220
+ "@value": t.Additionals["dct:issued"][0]["@value"].split(".").reverse().map((d, o) => o < 2 ? d.padStart(2, "0") : d).join("-") || "",
223
221
  "@type": "http://www.w3.org/2001/XMLSchema#date"
224
222
  })), Object.keys(t.Additionals)[i] === "dcatap:availability") {
225
223
  console.log(
@@ -239,7 +237,7 @@ async function ht(t, g, s, b) {
239
237
  for (let d = 0; d < t.Additionals["dcat:keyword"].length; d++)
240
238
  e.dataset["dcat:keyword"] === void 0 && (e.dataset["dcat:keyword"] = []), e.dataset["dcat:keyword"].push({
241
239
  "@value": t.Additionals["dcat:keyword"][d]["@value"],
242
- "@language": ((V = (m = t.Additionals["dcat:keyword"]) == null ? void 0 : m[d]) == null ? void 0 : V["@language"]) || "de"
240
+ "@language": ((it = (tt = t.Additionals["dcat:keyword"]) == null ? void 0 : tt[d]) == null ? void 0 : it["@language"]) || "de"
243
241
  });
244
242
  }
245
243
  if (Object.keys(t.Additionals)[i] === "dct:references") {
@@ -321,7 +319,7 @@ async function ht(t, g, s, b) {
321
319
  for (let d = 0; d < t.Additionals["dcatde:legalBasis"].length; d++)
322
320
  e.dataset["dcatde:legalBasis"] === void 0 && (e.dataset["dcatde:legalBasis"] = []), e.dataset["dcatde:legalBasis"].push({
323
321
  "@value": t.Additionals["dcatde:legalBasis"][d]["@value"],
324
- "@language": ((dt = (it = (tt = t.Additionals) == null ? void 0 : tt["dcatde:legalBasis"]) == null ? void 0 : it[d]) == null ? void 0 : dt["@language"]) || "de"
322
+ "@language": ((at = (et = (dt = t.Additionals) == null ? void 0 : dt["dcatde:legalBasis"]) == null ? void 0 : et[d]) == null ? void 0 : at["@language"]) || "de"
325
323
  });
326
324
  }
327
325
  if (Object.keys(t.Additionals)[i] === "dct:relation") {
@@ -440,13 +438,16 @@ async function ht(t, g, s, b) {
440
438
  "#####################",
441
439
  Object.keys(t.Additionals)[i]
442
440
  );
443
- for (let d = 0; d < t.Additionals["dct:creator"].length; d++)
444
- e.dataset["dct:creator"] === void 0 && (e.dataset["dct:creator"] = []), e.dataset["dct:creator"].push({
445
- "rdf:type": t.Additionals["dct:creator"][d]["rdf:type"],
441
+ for (let d = 0; d < t.Additionals["dct:creator"].length; d++) {
442
+ e.dataset["dct:creator"] === void 0 && (e.dataset["dct:creator"] = []);
443
+ let o;
444
+ t.Additionals["dct:creator"][d]["rdf:type"] === "Person" && (o = "foaf:agent"), t.Additionals["dct:creator"][d]["rdf:type"] === "Organisation" && (o = "foaf:organization"), e.dataset["dct:creator"].push({
445
+ "@type": o,
446
446
  "foaf:name": t.Additionals["dct:creator"][d]["foaf:name"],
447
447
  "foaf:mbox": t.Additionals["dct:creator"][d]["foaf:mbox"],
448
448
  "foaf:homepage": t.Additionals["dct:creator"][d]["foaf:homepage"]
449
449
  });
450
+ }
450
451
  }
451
452
  if (Object.keys(t.Additionals)[i] === "foaf:page") {
452
453
  console.log(
@@ -456,7 +457,7 @@ async function ht(t, g, s, b) {
456
457
  for (let d = 0; d < t.Additionals["foaf:page"].length; d++)
457
458
  e.dataset["foaf:page"] === void 0 && (e.dataset["foaf:page"] = []), e.dataset["foaf:page"].push({
458
459
  "dct:format": {
459
- "@id": (at = (et = t.Additionals["foaf:page"]) == null ? void 0 : et[d]) == null ? void 0 : at.uri
460
+ "@id": (ot = (nt = t.Additionals["foaf:page"]) == null ? void 0 : nt[d]) == null ? void 0 : ot.uri
460
461
  },
461
462
  "dct:title": t.Additionals["foaf:page"][d]["dct:title"],
462
463
  "dct:description": t.Additionals["foaf:page"][d]["dct:description"],
@@ -468,13 +469,16 @@ async function ht(t, g, s, b) {
468
469
  "#####################",
469
470
  Object.keys(t.Additionals)[i]
470
471
  );
471
- for (let d = 0; d < t.Additionals["dct:contributor"].length; d++)
472
- e.dataset["dct:contributor"] === void 0 && (e.dataset["dct:contributor"] = []), e.dataset["dct:contributor"].push({
473
- "rdf:type": t.Additionals["dct:contributor"][d]["rdf:type"],
472
+ for (let d = 0; d < t.Additionals["dct:contributor"].length; d++) {
473
+ e.dataset["dct:contributor"] === void 0 && (e.dataset["dct:contributor"] = []);
474
+ let o;
475
+ t.Additionals["dct:contributor"][d]["rdf:type"] === "Person" && (o = "foaf:agent"), t.Additionals["dct:contributor"][d]["rdf:type"] === "Organisation" && (o = "foaf:organization"), console.log(o), e.dataset["dct:contributor"].push({
476
+ "@type": o,
474
477
  "foaf:name": t.Additionals["dct:contributor"][d]["foaf:name"],
475
478
  "foaf:mbox": t.Additionals["dct:contributor"][d]["foaf:mbox"],
476
479
  "foaf:homepage": t.Additionals["dct:contributor"][d]["foaf:homepage"]
477
- }), e.dataset["dct:contributor"][d]["@type"] = "foaf:Agent";
480
+ });
481
+ }
478
482
  }
479
483
  if (Object.keys(t.Additionals)[i] === "owl:versionInfo" && (e.dataset["owl:versionInfo"] = {
480
484
  "@value": t.Additionals["owl:versionInfo"][0]["@value"]
@@ -495,44 +499,44 @@ async function ht(t, g, s, b) {
495
499
  }), Object.keys(t.Additionals)[i] === "dcatde:politicalGeocodingLevelURI")
496
500
  for (let d = 0; d < t.Additionals["dcatde:politicalGeocodingLevelURI"].length; d++)
497
501
  e.dataset["dcatde:politicalGeocodingLevelURI"] === void 0 && (e.dataset["dcatde:politicalGeocodingLevelURI"] = []), e.dataset["dcatde:politicalGeocodingLevelURI"].push({
498
- "@id": ((ot = (nt = t.Additionals["dcatde:politicalGeocodingLevelURI"]) == null ? void 0 : nt[d]) == null ? void 0 : ot.uri) || ""
502
+ "@id": ((st = (ct = t.Additionals["dcatde:politicalGeocodingLevelURI"]) == null ? void 0 : ct[d]) == null ? void 0 : st.uri) || ""
499
503
  });
500
504
  }
501
505
  } catch (i) {
502
506
  throw console.error("Validation Error:", i.message), i;
503
507
  }
504
508
  }
505
- } catch (o) {
506
- console.log(o);
509
+ } catch (c) {
510
+ console.log(c);
507
511
  }
508
- let A = bt(e, u);
512
+ let A = yt(e, u);
509
513
  return { actionParams: {
510
514
  id: y,
511
- catalog: s.permissions[0].rsname,
515
+ catalog: l.permissions[0].rsname,
512
516
  body: A,
513
517
  title: e.dataset["dct:title"]["@value"],
514
518
  description: e.dataset["dct:description"]["@value"]
515
519
  }, body: A };
516
520
  }
517
- function bt(t, g) {
518
- const s = {}, b = Object.keys(t);
519
- for (let c = 0; c < b.length; c++)
520
- b[c], s[b[c]] = t[b[c]];
521
- let r = {
521
+ function yt(t, g) {
522
+ const l = {}, b = Object.keys(t);
523
+ for (let s = 0; s < b.length; s++)
524
+ b[s], l[b[s]] = t[b[s]];
525
+ let p = {
522
526
  "@graph": [
523
527
  {
524
- ...s.dataset
528
+ ...l.dataset
525
529
  },
526
- s.distribution,
530
+ l.distribution,
527
531
  {
528
- ...s.meta
532
+ ...l.meta
529
533
  }
530
534
  ],
531
535
  "@context": g
532
536
  // Füge die Prefixes hinzu
533
537
  };
534
- return console.log(r), r;
538
+ return console.log(p), p;
535
539
  }
536
540
  export {
537
- ht as default
541
+ vt as default
538
542
  };