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