@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.
- package/dist/assets/dpi.css +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/services/dpiV3_apis.js +39 -37
- package/dist/data-provider-interface/HappyFlowComponents/ui/InputField.vue.js +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/CoverageModal.vue.js +42 -42
- package/dist/data-provider-interface/HappyFlowComponents/ui/TableRowV3.vue.js +3 -3
- package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +92 -92
- package/dist/data-provider-interface/components/PolGeoUriPage.vue.js +39 -39
- package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +16 -16
- package/dist/data-provider-interface/config/dcatapdeHappyFlow/converter.js +78 -74
- package/dist/data-provider-interface/store/modules/authStore.js +14 -12
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as
|
|
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
|
|
4
|
-
import { PhMagnifyingGlass as
|
|
5
|
-
import { useFormValues as
|
|
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
|
|
8
|
-
import { useEditModeInfo as
|
|
9
|
-
const
|
|
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 } =
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
y.value || (
|
|
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),
|
|
28
|
+
clearTimeout(m), c.value = e, r.value = !1, m = setTimeout(async () => {
|
|
29
29
|
if (e !== "")
|
|
30
30
|
try {
|
|
31
|
-
|
|
32
|
-
} catch (
|
|
33
|
-
console.log("Error fetching geocoding data:",
|
|
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
|
-
|
|
35
|
+
l.value = !1;
|
|
36
36
|
}
|
|
37
37
|
else
|
|
38
|
-
|
|
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
|
-
|
|
43
|
+
u.value, t.value.Covering["dcatde:politicalGeocodingURI"] = [
|
|
44
44
|
{ isValid: !0 }
|
|
45
45
|
];
|
|
46
|
-
}, V = (e,
|
|
47
|
-
|
|
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:
|
|
53
|
+
inVoc: a
|
|
54
54
|
}
|
|
55
|
-
]
|
|
56
|
-
const
|
|
55
|
+
];
|
|
56
|
+
const p = e.resource.split("/").slice(-2, -1)[0];
|
|
57
57
|
let i = "";
|
|
58
|
-
switch (
|
|
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
|
-
|
|
75
|
+
t.value.Additionals["dcatapde:politicalGeocodingLevelURI"] === void 0 ? (t.value.Additionals["dcatapde:politicalGeocodingLevelURI"] = [], t.value.Additionals["dcatapde:politicalGeocodingLevelURI"].push({
|
|
76
76
|
"@id": i
|
|
77
|
-
})) :
|
|
77
|
+
})) : t.value.Additionals["dcatapde:politicalGeocodingLevelURI"] = [
|
|
78
78
|
{ "@id": i }
|
|
79
79
|
];
|
|
80
80
|
};
|
|
81
|
-
return (e,
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
86
|
+
s("div", K, [
|
|
87
87
|
G(R, {
|
|
88
88
|
dropdownWidth: "large",
|
|
89
89
|
type: "inputField",
|
|
90
|
-
onInput:
|
|
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:
|
|
103
|
+
error: u.value
|
|
104
104
|
},
|
|
105
105
|
onValueSent: V,
|
|
106
|
-
data: f(
|
|
106
|
+
data: f(o),
|
|
107
107
|
multi: "true",
|
|
108
108
|
autocomplete: !0,
|
|
109
109
|
buttonText: "Dropdown",
|
|
110
110
|
text: "Dropdown",
|
|
111
|
-
loading:
|
|
111
|
+
loading: l.value
|
|
112
112
|
}, null, 8, ["inputFieldProps", "data", "loading"]),
|
|
113
|
-
|
|
114
|
-
G(f(
|
|
115
|
-
|
|
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
|
-
|
|
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__ */
|
|
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
|
|
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 =
|
|
53
|
+
), R = _(
|
|
54
54
|
() => n.value && !y.value && !!g.value
|
|
55
|
-
), L =
|
|
55
|
+
), L = _(
|
|
56
56
|
() => n.value && !!R.value
|
|
57
|
-
), v =
|
|
57
|
+
), v = _(() => L.value), w = _(() => {
|
|
58
58
|
var l;
|
|
59
59
|
return (l = p.value) == null ? void 0 : l.dpiData;
|
|
60
|
-
}), P =
|
|
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,
|
|
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: ((
|
|
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,
|
|
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
|
|
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,
|
|
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:
|
|
423
|
-
{ Second:
|
|
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": (
|
|
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,
|
|
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: ((
|
|
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
|
|
2
|
+
import { asSomeArray as pt } from "../../composables/useDpiSimpleLoader.js";
|
|
3
3
|
let e = { distribution: [], dataset: {}, meta: {} };
|
|
4
|
-
function
|
|
4
|
+
function gt(t) {
|
|
5
5
|
return t.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
|
|
6
6
|
}
|
|
7
|
-
async function
|
|
8
|
-
var h, f, v, k,
|
|
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
|
|
11
|
-
const
|
|
10
|
+
let p = [];
|
|
11
|
+
const s = Object.keys(t);
|
|
12
12
|
e.dataset["dcat:distribution"] = [];
|
|
13
|
-
for (let
|
|
14
|
-
|
|
15
|
-
"@id": `https://piveau.io/set/distribution/${
|
|
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
|
|
17
|
+
const bt = new URLSearchParams(window.location.search).get("edit");
|
|
18
18
|
let y = "";
|
|
19
19
|
try {
|
|
20
|
-
for (let
|
|
21
|
-
if (c
|
|
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
|
|
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 =
|
|
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
|
-
),
|
|
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
|
|
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 && ((
|
|
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 = (
|
|
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
|
|
73
|
+
if (s[c] === "DistributionSimple")
|
|
72
74
|
for (let i = 0; i < t.DistributionSimple["dcat:distribution"].length; i++) {
|
|
73
|
-
if (e.distribution[i] = {}, ((
|
|
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/${
|
|
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
|
-
(
|
|
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 = (
|
|
96
|
-
d === void 0 && (d = (
|
|
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
|
|
103
|
-
|
|
104
|
-
"@id": (
|
|
105
|
-
}), ((
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
|
|
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
|
|
176
|
-
|
|
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
|
|
191
|
-
return
|
|
192
|
-
"@id":
|
|
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 < ((
|
|
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
|
|
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 && (
|
|
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 && (
|
|
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 && (
|
|
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] =
|
|
210
|
+
}), e.distribution[i]["foaf:page"][a] = r;
|
|
213
211
|
}
|
|
214
212
|
}
|
|
215
213
|
}
|
|
216
|
-
if (c
|
|
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,
|
|
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": ((
|
|
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": ((
|
|
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"] = [])
|
|
445
|
-
|
|
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": (
|
|
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"] = [])
|
|
473
|
-
|
|
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
|
-
})
|
|
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": ((
|
|
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 (
|
|
506
|
-
console.log(
|
|
509
|
+
} catch (c) {
|
|
510
|
+
console.log(c);
|
|
507
511
|
}
|
|
508
|
-
let A =
|
|
512
|
+
let A = yt(e, u);
|
|
509
513
|
return { actionParams: {
|
|
510
514
|
id: y,
|
|
511
|
-
catalog:
|
|
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
|
|
518
|
-
const
|
|
519
|
-
for (let
|
|
520
|
-
b[
|
|
521
|
-
let
|
|
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
|
-
...
|
|
528
|
+
...l.dataset
|
|
525
529
|
},
|
|
526
|
-
|
|
530
|
+
l.distribution,
|
|
527
531
|
{
|
|
528
|
-
...
|
|
532
|
+
...l.meta
|
|
529
533
|
}
|
|
530
534
|
],
|
|
531
535
|
"@context": g
|
|
532
536
|
// Füge die Prefixes hinzu
|
|
533
537
|
};
|
|
534
|
-
return console.log(
|
|
538
|
+
return console.log(p), p;
|
|
535
539
|
}
|
|
536
540
|
export {
|
|
537
|
-
|
|
541
|
+
vt as default
|
|
538
542
|
};
|