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