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