@piveau/dpi 0.1.0-beta.8 → 0.1.0-twinby.0
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/DPIMenu.vue.js +7 -7
- package/dist/data-provider-interface/DataProviderInterface.vue2.js +18 -17
- package/dist/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue.js +7 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Autocomplete/Autocomplete.vue2.js +122 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteInputDefinition.js +14 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocabFormKit.vue.js +75 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Autocomplete/AutocompleteVocabFormKit.vue2.js +4 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectNameStep.vue.js +29 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectOrganisationStep.vue.js +7 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/BasicInfosStep/ProjectOrganisationStep.vue2.js +70 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Chip.vue.js +19 -20
- package/dist/data-provider-interface/HappyFlowComponents/ui/DpiModalBase.vue.js +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/DpiModalBase.vue2.js +32 -28
- package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.js +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldDefinition.js +21 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldFormKit.vue.js +60 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/InputField/InputFieldFormKit.vue2.js +4 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/ListBox/Listbox.vue.js +7 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/ListBox/Listbox.vue2.js +98 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/OptionalInformation/AvailabilityV3.vue.js +16 -21
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/DistributionModal.vue.js +83 -81
- package/dist/data-provider-interface/HappyFlowComponents/ui/SectionItems/EssentialsModal.vue.js +2 -4
- package/dist/data-provider-interface/components/DistLicense.vue.js +61 -63
- package/dist/data-provider-interface/components/DistributionSimplePage.vue.js +791 -779
- package/dist/data-provider-interface/components/HVDPage.vue.js +45 -43
- package/dist/data-provider-interface/components/InputPageStep.vue.js +9 -11
- package/dist/data-provider-interface/components/ProgressSteps.vue.js +7 -0
- package/dist/data-provider-interface/components/ProgressSteps.vue2.js +106 -0
- package/dist/data-provider-interface/components/ReviewAndPublishPage.vue.js +204 -204
- package/dist/data-provider-interface/composables/useDpiSimpleLoader.js +211 -212
- package/dist/data-provider-interface/composables/useDpiStepper.js +80 -39
- package/dist/data-provider-interface/config/dcatapdeHappyFlow/converter.js +145 -105
- package/dist/data-provider-interface/store/modules/conversionStore.js +130 -0
- package/dist/data-provider-interface/store/modules/dpiStore.js +18 -16
- package/dist/data-provider-interface/utils/RDFconverter.js +226 -0
- package/dist/data-provider-interface/utils/inputConverter.js +255 -0
- package/dist/data-provider-interface/utils/useSteps.js +39 -30
- package/dist/data-provider-interface/views/InputPage.vue.js +80 -92
- package/dist/data-provider-interface/views/InputPageProject.vue.js +528 -0
- package/dist/index.js +31 -27
- package/dist/stories/components/DemoStep.vue.js +331 -0
- package/dist/stories/components/DemoStepper.vue.js +7 -0
- package/dist/stories/components/DemoStepper.vue2.js +160 -0
- package/dist/stories/components/PartnerCard.vue.js +7 -0
- package/dist/stories/components/PartnerCard.vue2.js +32 -0
- package/dist/stories/components/ReviewStepDemo.vue.js +7 -0
- package/dist/stories/components/ReviewStepDemo.vue2.js +98 -0
- package/package.json +11 -4
|
@@ -1,47 +1,88 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return e < t.value.length ? t.value[e] : "";
|
|
11
|
-
}), s = (e) => {
|
|
12
|
-
t.value.includes(e) || t.value.push(e);
|
|
13
|
-
}, c = () => {
|
|
14
|
-
const e = o.value + 1;
|
|
15
|
-
e < t.value.length && (u.value = t.value[e]);
|
|
1
|
+
import { ref as G, computed as i, provide as H } from "vue";
|
|
2
|
+
import { useStepper as J } from "@vueuse/core";
|
|
3
|
+
import { dpiStepperKey as M } from "../utils/injectionKeys.js";
|
|
4
|
+
import O from "../utils/useSteps.js";
|
|
5
|
+
function X() {
|
|
6
|
+
const { steps: p, activeStep: o, stepPlugin: c, visitedSteps: v, subSteps: a, triggerValidation: g, triggerValidationCurrentStep: l } = O(), s = G([]), e = J(s, o.value), r = () => {
|
|
7
|
+
e.current.value && e.current.value !== o.value && (o.value = e.current.value);
|
|
8
|
+
}, u = (t) => {
|
|
9
|
+
s.value.includes(t) || (s.value.push(t), s.value.length === 1 && !o.value && (o.value = t, e.goTo(t)));
|
|
16
10
|
}, S = () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
e.goToNext(), r();
|
|
12
|
+
}, T = () => {
|
|
13
|
+
e.goToPrevious(), r();
|
|
14
|
+
}, f = (t) => {
|
|
15
|
+
e.goTo(t), r();
|
|
16
|
+
}, x = (t) => {
|
|
17
|
+
const n = e.at(t);
|
|
18
|
+
n && (e.goTo(n), r());
|
|
19
|
+
}, d = i(() => e.index.value), m = i(() => e.previous.value || ""), P = i(() => e.next.value || "");
|
|
20
|
+
H(M, {
|
|
25
21
|
steps: p,
|
|
26
|
-
activeStep:
|
|
27
|
-
registerStep:
|
|
28
|
-
})
|
|
22
|
+
activeStep: o,
|
|
23
|
+
registerStep: u
|
|
24
|
+
});
|
|
25
|
+
const {
|
|
26
|
+
steps: y,
|
|
27
|
+
stepNames: B,
|
|
28
|
+
index: h,
|
|
29
|
+
current: A,
|
|
30
|
+
next: C,
|
|
31
|
+
previous: I,
|
|
32
|
+
isFirst: L,
|
|
33
|
+
isLast: N,
|
|
34
|
+
at: V,
|
|
35
|
+
get: b,
|
|
36
|
+
goTo: k,
|
|
37
|
+
goToNext: D,
|
|
38
|
+
goToPrevious: F,
|
|
39
|
+
goBackTo: K,
|
|
40
|
+
isNext: j,
|
|
41
|
+
isPrevious: q,
|
|
42
|
+
isCurrent: w,
|
|
43
|
+
isBefore: z,
|
|
44
|
+
isAfter: E
|
|
45
|
+
} = e;
|
|
46
|
+
return {
|
|
47
|
+
// Original API for backward compatibility (form validation steps)
|
|
29
48
|
steps: p,
|
|
30
|
-
subSteps:
|
|
31
|
-
activeStep:
|
|
32
|
-
activeStepIndex:
|
|
33
|
-
previousStep:
|
|
34
|
-
nextStep:
|
|
35
|
-
visitedSteps:
|
|
36
|
-
stepPlugin:
|
|
37
|
-
stepList:
|
|
38
|
-
registerStep:
|
|
39
|
-
goToNextStep:
|
|
40
|
-
goToPreviousStep:
|
|
49
|
+
subSteps: a,
|
|
50
|
+
activeStep: o,
|
|
51
|
+
activeStepIndex: d,
|
|
52
|
+
previousStep: m,
|
|
53
|
+
nextStep: P,
|
|
54
|
+
visitedSteps: v,
|
|
55
|
+
stepPlugin: c,
|
|
56
|
+
stepList: s,
|
|
57
|
+
registerStep: u,
|
|
58
|
+
goToNextStep: S,
|
|
59
|
+
goToPreviousStep: T,
|
|
41
60
|
goToStep: f,
|
|
42
|
-
goToStepByIndex:
|
|
61
|
+
goToStepByIndex: x,
|
|
62
|
+
triggerValidation: g,
|
|
63
|
+
triggerValidationCurrentStep: l,
|
|
64
|
+
// Extended useStepper utilities
|
|
65
|
+
stepperSteps: y,
|
|
66
|
+
stepNames: B,
|
|
67
|
+
index: h,
|
|
68
|
+
current: A,
|
|
69
|
+
next: C,
|
|
70
|
+
previous: I,
|
|
71
|
+
isFirst: L,
|
|
72
|
+
isLast: N,
|
|
73
|
+
at: V,
|
|
74
|
+
get: b,
|
|
75
|
+
goTo: k,
|
|
76
|
+
goToNext: D,
|
|
77
|
+
goToPrevious: F,
|
|
78
|
+
goBackTo: K,
|
|
79
|
+
isNext: j,
|
|
80
|
+
isPrevious: q,
|
|
81
|
+
isCurrent: w,
|
|
82
|
+
isBefore: z,
|
|
83
|
+
isAfter: E
|
|
43
84
|
};
|
|
44
85
|
}
|
|
45
86
|
export {
|
|
46
|
-
|
|
87
|
+
X as useDpiStepper
|
|
47
88
|
};
|
|
@@ -1,147 +1,187 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
let d = { distribution: [], dataset: {}, meta: {} };
|
|
3
|
-
function
|
|
4
|
-
return console.log(
|
|
3
|
+
function f(i) {
|
|
4
|
+
return console.log(i), i.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
let
|
|
10
|
-
const
|
|
6
|
+
async function E(i, b, a, o) {
|
|
7
|
+
var y, A, D, v, h, S, k, O, j, R, I, B, w, P, x, T, U, L, M, $, F;
|
|
8
|
+
const p = b.specification.prefixes;
|
|
9
|
+
let n = [];
|
|
10
|
+
const s = Object.keys(i);
|
|
11
11
|
d.dataset["dcat:distribution"] = [];
|
|
12
|
-
for (let e = 0; e <
|
|
13
|
-
|
|
14
|
-
"@id":
|
|
12
|
+
for (let e = 0; e < i.DistributionSimple["dcat:distribution"].length; e++)
|
|
13
|
+
n.push(crypto.randomUUID()), d.dataset["dcat:distribution"].push({
|
|
14
|
+
"@id": `https://piveau.io/set/distribution/${n[e]}`
|
|
15
15
|
});
|
|
16
|
-
const
|
|
17
|
-
let
|
|
16
|
+
const u = new URLSearchParams(window.location.search).get("edit");
|
|
17
|
+
let l = "";
|
|
18
18
|
try {
|
|
19
|
-
for (let e = 0; e <
|
|
20
|
-
if (
|
|
21
|
-
let
|
|
22
|
-
for (let
|
|
23
|
-
|
|
24
|
-
"@id":
|
|
19
|
+
for (let e = 0; e < s.length; e++) {
|
|
20
|
+
if (s[e] === "Discoverability") {
|
|
21
|
+
let t = [];
|
|
22
|
+
for (let c = 1; c < i.Discoverability.discoverabilityPage.length; c++)
|
|
23
|
+
t.push({
|
|
24
|
+
"@id": i.Discoverability.discoverabilityPage[c].uri
|
|
25
25
|
});
|
|
26
|
-
d.dataset["dcat:theme"] =
|
|
27
|
-
"@id": (
|
|
26
|
+
d.dataset["dcat:theme"] = t, i.Discoverability.hvdPage && Object.keys(i.Discoverability.hvdPage).length !== 0 && i.Discoverability.hvdPage[0].label !== void 0 && (d.dataset["dcatap:hvdCategory"] = {
|
|
27
|
+
"@id": (A = (y = i.Discoverability) == null ? void 0 : y.hvdPage) == null ? void 0 : A[0].uri
|
|
28
28
|
}, d.dataset["dcatap:applicableLegislation"] = {
|
|
29
29
|
"@id": "http://data.europa.eu/eli/reg_impl/2023/138/oj"
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
if (
|
|
32
|
+
if (s[e] === "BasicInfos") {
|
|
33
33
|
d.dataset["dpi:isDPIv3"] = !0;
|
|
34
|
-
for (let
|
|
35
|
-
Object.keys(
|
|
36
|
-
|
|
37
|
-
),
|
|
34
|
+
for (let t = 0; t < Object.keys(i.BasicInfos).length; t++)
|
|
35
|
+
Object.keys(i.BasicInfos)[t] === "dct:title" && (d.dataset["dct:title"] = i.BasicInfos["dct:title"][0] || "", l = f(
|
|
36
|
+
i.BasicInfos["dct:title"][0]["@value"]
|
|
37
|
+
), u === "true" && (l = i.BasicInfos.datasetID, console.log("Editmode", u))), Object.keys(i.BasicInfos)[t] === "dct:description" && (d.dataset["dct:description"] = i.BasicInfos["dct:description"][0] || ""), Object.keys(i.BasicInfos)[t] === "dct:modified" && (d.dataset["dct:modified"] = i.BasicInfos["dct:modified"][0] || ""), Object.keys(i.BasicInfos)[t] === "dct:publisher" && (d.dataset["dct:publisher"] = i.BasicInfos["dct:publisher"][0] || ""), Object.keys(i.BasicInfos)[t] === "dcat:contactPoint" && (d.dataset["dcat:contactPoint"] = i.BasicInfos["dcat:contactPoint"][0] || ""), d.dataset["@type"] = "dcat:Dataset", d.meta["dcat:catalog"] = a.permissions[0].rsname, d.meta["@type"] = "dcat:CatalogRecord";
|
|
38
38
|
}
|
|
39
|
-
if (
|
|
40
|
-
for (let
|
|
41
|
-
d.distribution[
|
|
42
|
-
"@id":
|
|
39
|
+
if (s[e], s[e] === "DistributionSimple")
|
|
40
|
+
for (let t = 0; t < i.DistributionSimple["dcat:distribution"].length; t++) {
|
|
41
|
+
d.distribution[t] = {}, d.distribution[t]["@type"] = "dcat:Distribution", d.distribution[t]["@id"] = `https://piveau.io/set/distribution/${n[t]}`, i.DistributionSimple["dcat:distribution"][t]["dcat:accessURL"] && (d.distribution[t]["dcat:accessURL"] = {
|
|
42
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dcat:accessURL"].startsWith("https://www.") || i.DistributionSimple["dcat:distribution"][t]["dcat:accessURL"].startsWith("http://www.") ? i.DistributionSimple["dcat:distribution"][t]["dcat:accessURL"] : `https://www.${i.DistributionSimple["dcat:distribution"][t]["dcat:accessURL"]}`
|
|
43
43
|
// Standardwert wenn beide false
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
44
|
+
});
|
|
45
|
+
let c = (v = (D = i.DistributionSimple) == null ? void 0 : D["dct:license"]) == null ? void 0 : v[0];
|
|
46
|
+
c === void 0 && (c = (O = (k = (S = (h = i.DistributionSimple) == null ? void 0 : h["dcat:distribution"]) == null ? void 0 : S[0]) == null ? void 0 : k["dct:license"]) == null ? void 0 : O[0]), d.distribution[t]["dct:license"] = {
|
|
47
|
+
"@id": (c == null ? void 0 : c.uri) || "",
|
|
48
|
+
"dct:title": (c == null ? void 0 : c.title) || ""
|
|
49
|
+
};
|
|
50
|
+
const r = (I = (R = (j = i.DistributionSimple) == null ? void 0 : j["dcat:distribution"]) == null ? void 0 : R[t]) == null ? void 0 : I["dct:format"];
|
|
51
|
+
r && (d.distribution[t]["dct:format"] = {
|
|
52
|
+
"@id": (r == null ? void 0 : r.uri) || ""
|
|
49
53
|
}), Object.keys(
|
|
50
|
-
|
|
51
|
-
).length !== 0 && (d.distribution[
|
|
52
|
-
"@id":
|
|
53
|
-
}),
|
|
54
|
-
"@value":
|
|
54
|
+
i.DistributionSimple["dcat:distribution"][t]["dcat:mediaType"]
|
|
55
|
+
).length !== 0 && (d.distribution[t]["dcat:mediaType"] = {
|
|
56
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dcat:mediaType"].uri || ""
|
|
57
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dcat:byteSize"] && (d.distribution[t]["dcat:byteSize"] = {
|
|
58
|
+
"@value": i.DistributionSimple["dcat:distribution"][t]["dcat:byteSize"] || ""
|
|
55
59
|
// "@type": "http://www.w3.org/2001/XMLSchema#decimal",
|
|
56
|
-
}),
|
|
57
|
-
"@value":
|
|
60
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dcatde:licenseAttributionByText"] && (d.distribution[t]["dcatde:licenseAttributionByText"] = {
|
|
61
|
+
"@value": i.DistributionSimple["dcat:distribution"][t]["dcatde:licenseAttributionByText"] || ""
|
|
62
|
+
}), Object.keys(
|
|
63
|
+
i.DistributionSimple["dcat:distribution"][t]["dcatap:availability"]
|
|
64
|
+
).length !== 0 && (d.distribution[t]["dcatap:availability"] = {
|
|
65
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dcatap:availability"].uri || ""
|
|
66
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dct:issued"] && (d.distribution[t]["dct:issued"] = {
|
|
67
|
+
"@value": i.DistributionSimple["dcat:distribution"][t]["dct:issued"] || ""
|
|
58
68
|
// "@type": "http://www.w3.org/2001/XMLSchema#date",
|
|
59
|
-
}),
|
|
60
|
-
"@value":
|
|
69
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dct:modified"] && (d.distribution[t]["dct:modified"] = {
|
|
70
|
+
"@value": i.DistributionSimple["dcat:distribution"][t]["dct:modified"] || ""
|
|
61
71
|
// "@type": "http://www.w3.org/2001/XMLSchema#date",
|
|
62
|
-
}),
|
|
72
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dct:description"] && (d.distribution[t]["dct:description"] = {
|
|
63
73
|
"@language": "de",
|
|
64
|
-
"@value":
|
|
65
|
-
}),
|
|
74
|
+
"@value": i.DistributionSimple["dcat:distribution"][t]["dct:description"]
|
|
75
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dct:title"] && (d.distribution[t]["dct:title"] = {
|
|
66
76
|
"@language": "de",
|
|
67
|
-
"@value":
|
|
77
|
+
"@value": i.DistributionSimple["dcat:distribution"][t]["dct:title"]
|
|
78
|
+
}), Object.keys(
|
|
79
|
+
i.DistributionSimple["dcat:distribution"][t]["dct:accessRights"]
|
|
80
|
+
).length !== 0 && (d.distribution[t]["dct:accessRights"] = {
|
|
81
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dct:accessRights"].uri
|
|
82
|
+
}), i.DistributionSimple["dcat:distribution"][t]["dcat:compressFormat"] != null && Object.keys(
|
|
83
|
+
i.DistributionSimple["dcat:distribution"][t]["dcat:compressFormat"]
|
|
84
|
+
).length !== 0 && (console.log(
|
|
85
|
+
"CFORMAT: ",
|
|
86
|
+
Object.keys(
|
|
87
|
+
i.DistributionSimple["dcat:distribution"][t]["dcat:compressFormat"]
|
|
88
|
+
).length
|
|
89
|
+
), d.distribution[t]["dcat:compressFormat"] = {
|
|
90
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dcat:compressFormat"].uri || ""
|
|
68
91
|
}), Object.keys(
|
|
69
|
-
|
|
70
|
-
).length !== 0 && (d.distribution[
|
|
71
|
-
"@id":
|
|
72
|
-
}),
|
|
92
|
+
i.DistributionSimple["dcat:distribution"][t]["dcat:packageFormat"]
|
|
93
|
+
).length !== 0 && (d.distribution[t]["dcat:packageFormat"] = {
|
|
94
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dcat:packageFormat"].uri || ""
|
|
95
|
+
}), i.DistributionSimple["dcat:distribution"][t].checksum.uri !== "" && (d.distribution[t]["spdx:checksum"] = {
|
|
73
96
|
"@type": "spdx:checksum",
|
|
74
|
-
"spdx:checksumValue":
|
|
97
|
+
"spdx:checksumValue": i.DistributionSimple["dcat:distribution"][t].checksum.title || "",
|
|
75
98
|
"spdx:algorithm": {
|
|
76
|
-
"@id":
|
|
99
|
+
"@id": i.DistributionSimple["dcat:distribution"][t].checksum.uri || ""
|
|
77
100
|
}
|
|
78
101
|
}), Object.keys(
|
|
79
|
-
|
|
80
|
-
).length !== 0 && (d.distribution[
|
|
81
|
-
"@id":
|
|
82
|
-
}), ((
|
|
102
|
+
i.DistributionSimple["dcat:distribution"][t]["dct:language"]
|
|
103
|
+
).length !== 0 && (d.distribution[t]["dct:language"] = {
|
|
104
|
+
"@id": i.DistributionSimple["dcat:distribution"][t]["dct:language"].uri
|
|
105
|
+
}), ((T = (x = (P = (w = (B = i.DistributionSimple) == null ? void 0 : B["dcat:distribution"]) == null ? void 0 : w[0]) == null ? void 0 : P.accessServices) == null ? void 0 : x[0]) == null ? void 0 : T["dct:title"]) !== void 0 && (d.distribution[t]["dcat:accessService"] = {
|
|
83
106
|
"@type": "dcat:DataService",
|
|
84
107
|
"dct:title": {
|
|
85
108
|
"@language": "de",
|
|
86
109
|
"@value": "Data Service Title",
|
|
87
|
-
"@value":
|
|
110
|
+
"@value": i.DistributionSimple["dcat:distribution"][t].accessServices[0]["dct:title"]
|
|
88
111
|
}
|
|
89
|
-
}, ((
|
|
112
|
+
}, ((F = ($ = (M = (L = (U = i.DistributionSimple) == null ? void 0 : U["dcat:distribution"]) == null ? void 0 : L[0]) == null ? void 0 : M.accessServices) == null ? void 0 : $[0]) == null ? void 0 : F["dct:description"]) !== void 0 && (d.distribution[t]["dcat:accessService"]["dct:description"] = {
|
|
90
113
|
"@language": "de",
|
|
91
|
-
"@value":
|
|
114
|
+
"@value": i.DistributionSimple["dcat:distribution"][t].accessServices[0]["dct:description"]
|
|
92
115
|
}));
|
|
93
|
-
|
|
116
|
+
}
|
|
117
|
+
if (s[e], s[e] === "Additionals")
|
|
94
118
|
try {
|
|
95
|
-
for (let
|
|
96
|
-
Object.keys(
|
|
97
|
-
"@
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"@
|
|
102
|
-
}), Object.keys(
|
|
119
|
+
for (let t = 0; t < Object.keys(i.Additionals).length; t++)
|
|
120
|
+
Object.keys(i.Additionals)[t] === "dcat:landingPage" && (d.dataset["dcat:landingPage"] = {
|
|
121
|
+
"@id": i.Additionals["dcat:landingPage"][0]["@id"]
|
|
122
|
+
}), Object.keys(i.Additionals)[t] === "owl:versionInfo" && (d.dataset["owl:versionInfo"] = {
|
|
123
|
+
"@value": i.Additionals["owl:versionInfo"][0]["@value"]
|
|
124
|
+
}), Object.keys(i.Additionals)[t] === "dcatde:contributorID" && (d.dataset["dcatde:contributorID"] = {
|
|
125
|
+
"@id": i.Additionals["dcatde:contributorID"][0].uri
|
|
126
|
+
}), Object.keys(i.Additionals)[t] === "dcatde:geocodingDescription" && (d.dataset["dcatde:geocodingDescription"] = {
|
|
103
127
|
"@language": "de",
|
|
104
|
-
"@value":
|
|
105
|
-
}), Object.keys(
|
|
106
|
-
"@
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"@value":
|
|
111
|
-
}), Object.keys(
|
|
112
|
-
"@id":
|
|
113
|
-
}), Object.keys(
|
|
114
|
-
"@id":
|
|
115
|
-
}), Object.keys(
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
"@value": i.Additionals["dcatde:geocodingDescription"][0]["@value"]
|
|
129
|
+
}), Object.keys(i.Additionals)[t] === "dct:identifier" && (d.dataset["dct:identifier"] = i.Additionals["dct:identifier"][0]["@value"]), Object.keys(i.Additionals)[t] === "adms:identifier" && (d.dataset["adms:identifier"] = {
|
|
130
|
+
"@id": i.Additionals["adms:identifier"][0]["@id"]
|
|
131
|
+
}), Object.keys(i.Additionals)[t] === "adms:versionNotes" && (d.dataset["adms:versionNotes"] = {
|
|
132
|
+
"@value": i.Additionals["adms:versionNotes"][0]["@value"]
|
|
133
|
+
}), Object.keys(i.Additionals)[t] === "dcatde:legalBasis" && (d.dataset["dcatde:legalBasis"] = {
|
|
134
|
+
"@value": i.Additionals["dcatde:legalBasis"][0]["@value"]
|
|
135
|
+
}), Object.keys(i.Additionals)[t] === "dct:relation" && (d.dataset["dct:relation"] = {
|
|
136
|
+
"@id": i.Additionals["dct:relation"][0]["@id"]
|
|
137
|
+
}), Object.keys(i.Additionals)[t] === "dct:language" && (d.dataset["dct:language"] = {
|
|
138
|
+
"@id": i.Additionals["dct:language"][0].uri
|
|
139
|
+
}), Object.keys(i.Additionals)[t] === "dct:conformsTo" && (d.dataset["dct:conformsTo"] = {
|
|
140
|
+
"rdfs:label": i.Additionals["dct:conformsTo"][0]["rdfs:label"],
|
|
141
|
+
"@id": i.Additionals["dct:conformsTo"][0]["@id"]
|
|
142
|
+
}), Object.keys(i.Additionals)[t] === "dct:accessRights" && (d.dataset["dct:accessRights"] = {
|
|
143
|
+
"@id": i.Additionals["dct:accessRights"].uri
|
|
144
|
+
}), Object.keys(i.Additionals)[t] === "dct:provenance" && (d.dataset["dct:provenance"] = i.Additionals["dct:provenance"][0]), Object.keys(i.Additionals)[t] === "dct:accrualPeriodicity" && (d.dataset["dct:accrualPeriodicity"] = {
|
|
145
|
+
"@id": i.Additionals["dct:accrualPeriodicity"][0].uri
|
|
146
|
+
}), Object.keys(i.Additionals)[t] === "dct:type" && (d.dataset["dct:type"] = {
|
|
147
|
+
"@id": i.Additionals["dct:type"][0].uri
|
|
148
|
+
}), Object.keys(i.Additionals)[t] === "prov:wasGeneratedBy" && (d.dataset["prov:wasGeneratedBy"] = {
|
|
149
|
+
"@id": i.Additionals["prov:wasGeneratedBy"][0]["@id"]
|
|
150
|
+
}), Object.keys(i.Additionals)[t] === "dcat:spatialResolutionInMeters" && (d.dataset["dcat:spatialResolutionInMeters"] = i.Additionals["dcat:spatialResolutionInMeters"][0]["@value"]), Object.keys(i.Additionals)[t] === "dcat:temporalResolution" && (d.dataset["dcat:temporalResolution"] = {
|
|
120
151
|
"@type": "http://www.w3.org/2001/XMLSchema#duration",
|
|
121
|
-
"@value":
|
|
122
|
-
}), Object.keys(
|
|
123
|
-
|
|
124
|
-
))
|
|
125
|
-
|
|
126
|
-
|
|
152
|
+
"@value": `P${i.Additionals["dcat:temporalResolution"][0].Year}Y${i.Additionals["dcat:temporalResolution"][0].Month}M${i.Additionals["dcat:temporalResolution"][0].Day}D${i.Additionals["dcat:temporalResolution"][0].Hour}H${i.Additionals["dcat:temporalResolution"][0].Minute}M${i.Additionals["dcat:temporalResolution"][0].Second}S`
|
|
153
|
+
}), Object.keys(i.Additionals)[t] === "prov:qualifiedAttribution" && (d.dataset["prov:qualifiedAttribution"] = {
|
|
154
|
+
"@id": i.Additionals["prov:qualifiedAttribution"][0]["@id"]
|
|
155
|
+
}), Object.keys(i.Additionals)[t] === "dct:isReferencedBy" && (d.dataset["dct:isReferencedBy"] = {
|
|
156
|
+
"@id": i.Additionals["dct:isReferencedBy"][0]["@id"]
|
|
157
|
+
}), Object.keys(i.Additionals)[t] === "dct:source" && (d.dataset["dct:source"] = {
|
|
158
|
+
"@id": i.Additionals["dct:source"][0]["@id"]
|
|
159
|
+
}), Object.keys(i.Additionals)[t] === "dct:hasVersion" && (d.dataset["dct:hasVersion"] = {
|
|
160
|
+
"@id": i.Additionals["dct:hasVersion"][0]["@id"]
|
|
161
|
+
}), Object.keys(i.Additionals)[t] === "dct:isVersionOf" && (d.dataset["dct:isVersionOf"] = {
|
|
162
|
+
"@id": i.Additionals["dct:isVersionOf"][0]["@id"]
|
|
163
|
+
}), Object.keys(i.Additionals)[t] === "dct:creator" && (d.dataset["dct:creator"] = i.Additionals["dct:creator"]), Object.keys(i.Additionals)[t] === "dct:contributor" && (d.dataset["dct:contributor"] = i.Additionals["dct:contributor"].filter((c) => c !== null));
|
|
164
|
+
} catch (t) {
|
|
165
|
+
throw console.error("Validation Error:", t.message), t;
|
|
127
166
|
}
|
|
128
167
|
}
|
|
129
168
|
} catch (e) {
|
|
130
169
|
console.log(e);
|
|
131
170
|
}
|
|
132
|
-
let
|
|
133
|
-
return
|
|
134
|
-
id:
|
|
171
|
+
let g = z(d, p);
|
|
172
|
+
return { actionParams: {
|
|
173
|
+
id: l,
|
|
135
174
|
catalog: a.permissions[0].rsname,
|
|
136
|
-
body:
|
|
175
|
+
body: g,
|
|
137
176
|
title: d.dataset["dct:title"]["@value"],
|
|
138
177
|
description: d.dataset["dct:description"]["@value"]
|
|
139
|
-
}, body:
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
178
|
+
}, body: g };
|
|
179
|
+
}
|
|
180
|
+
function z(i, b) {
|
|
181
|
+
const a = {}, o = Object.keys(i);
|
|
182
|
+
for (let s = 0; s < o.length; s++)
|
|
183
|
+
o[s], a[o[s]] = i[o[s]];
|
|
184
|
+
let n = {
|
|
145
185
|
"@graph": [
|
|
146
186
|
{
|
|
147
187
|
...a.dataset
|
|
@@ -151,11 +191,11 @@ const U = async (t, r, a, n) => {
|
|
|
151
191
|
...a.meta
|
|
152
192
|
}
|
|
153
193
|
],
|
|
154
|
-
"@context":
|
|
194
|
+
"@context": b
|
|
155
195
|
// Füge die Prefixes hinzu
|
|
156
196
|
};
|
|
157
|
-
return console.log(
|
|
158
|
-
}
|
|
197
|
+
return console.log(n), n;
|
|
198
|
+
}
|
|
159
199
|
export {
|
|
160
|
-
|
|
200
|
+
E as default
|
|
161
201
|
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { has as u, isEmpty as m } from "lodash-es";
|
|
2
|
+
import f from "n3";
|
|
3
|
+
import i from "../../utils/general-helper.js";
|
|
4
|
+
import S from "../../utils/inputConverter.js";
|
|
5
|
+
import b from "../../utils/RDFconverter.js";
|
|
6
|
+
const D = {
|
|
7
|
+
datasets: {},
|
|
8
|
+
distributions: [],
|
|
9
|
+
catalogues: {},
|
|
10
|
+
deleteDistributionInline: !1
|
|
11
|
+
}, v = {
|
|
12
|
+
/**
|
|
13
|
+
* Returns raw values for given property, page and distribution
|
|
14
|
+
* @param state
|
|
15
|
+
* @param0 Object containing property, page and distribution id
|
|
16
|
+
* @returns Object conatining form values for given property, distribution and page
|
|
17
|
+
*/
|
|
18
|
+
getRawValues: (t) => ({ property: e }) => t[e],
|
|
19
|
+
/**
|
|
20
|
+
* Provides property data
|
|
21
|
+
* @param state
|
|
22
|
+
* @param property Property of wanted data
|
|
23
|
+
* @returns Object containing all values of given property
|
|
24
|
+
*/
|
|
25
|
+
getData: (t) => (e) => {
|
|
26
|
+
let s;
|
|
27
|
+
if (e === "distributions") {
|
|
28
|
+
s = [];
|
|
29
|
+
for (let a = 0; a < t[e].length; a += 1) {
|
|
30
|
+
const o = i.mergeNestedObjects(t[e][a]);
|
|
31
|
+
s.push(o);
|
|
32
|
+
}
|
|
33
|
+
} else
|
|
34
|
+
s = i.mergeNestedObjects(t[e]);
|
|
35
|
+
return s;
|
|
36
|
+
}
|
|
37
|
+
}, p = {
|
|
38
|
+
/**
|
|
39
|
+
* Saves values from input form to vuex store
|
|
40
|
+
* @param param0
|
|
41
|
+
* @param param1 Object containing property, page, distrbution id and form values
|
|
42
|
+
*/
|
|
43
|
+
saveFormValues({ commit: t }, { property: e, values: s }) {
|
|
44
|
+
console.log("###change"), t("saveFormValuesToStore", { property: e, values: s });
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Saving existing values from localStorage to vuex store
|
|
48
|
+
* @param {*} param0
|
|
49
|
+
* @param {*} param1 Object containing property (datasets/catalogues) and subpage (when curren tprofile is distributions)
|
|
50
|
+
*/
|
|
51
|
+
saveLocalstorageValues({ commit: t }, e) {
|
|
52
|
+
t("saveFromLocalstorage", e);
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Fetches data, writes it to a dataset and calls method for actual conversion to input format
|
|
56
|
+
* @param param0
|
|
57
|
+
* @param param1 Object containing endpoint and token for data fetching as well as property
|
|
58
|
+
*/
|
|
59
|
+
async convertToInput({ commit: t, rootGetters: e }, { endpoint: s, token: a, property: o }) {
|
|
60
|
+
const n = e["dpiStore/getSpecification"], r = await i.fetchLinkedData(s, a).then((l) => l), g = new f.Parser(), c = datasetFactory.dataset();
|
|
61
|
+
await g.parse(r, (l, d, I) => {
|
|
62
|
+
d && c.add(d);
|
|
63
|
+
}), t("saveLinkedDataToStore", { property: o, data: c, specification: n });
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Merges store data and converts the given input values into RDF format
|
|
67
|
+
* @param state
|
|
68
|
+
* @param property Object containing all values within nested objects for each page of the frontend
|
|
69
|
+
* @returns Data values in RDF format
|
|
70
|
+
*/
|
|
71
|
+
convertToRDF({ state: t, rootGetters: e }, { property: s }) {
|
|
72
|
+
const a = e["dpiStore/getSpecification"], o = {
|
|
73
|
+
datasets: i.mergeNestedObjects(t.datasets),
|
|
74
|
+
distributions: [],
|
|
75
|
+
catalogues: i.mergeNestedObjects(t.catalogues)
|
|
76
|
+
};
|
|
77
|
+
if (u(t.datasets, "Distributions") && u(t.datasets.Distributions, "distributionList") && !m(t.datasets.Distributions.distributionList))
|
|
78
|
+
for (let r = 0; r < t.datasets.Distributions.distributionList.length; r++)
|
|
79
|
+
o.distributions.push(i.mergeNestedObjects(t.datasets.Distributions.distributionList[r]));
|
|
80
|
+
return b.convertToRDF(o, s, a);
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Calls mutation to clear values and store
|
|
84
|
+
* @param param0
|
|
85
|
+
*/
|
|
86
|
+
clearAll({ commit: t }) {
|
|
87
|
+
t("resetStore");
|
|
88
|
+
}
|
|
89
|
+
}, F = {
|
|
90
|
+
/**
|
|
91
|
+
* Saves input values from form into vuex as well as into localStorage of browser
|
|
92
|
+
* @param state
|
|
93
|
+
* @param param1 Object containing the property, page and values of input form
|
|
94
|
+
*/
|
|
95
|
+
saveFormValuesToStore(t, { property: e, values: s }) {
|
|
96
|
+
t[e] = s, localStorage.setItem(`dpi_${e}`, JSON.stringify(t[e]));
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Save input form values from localStorage into vuex store
|
|
100
|
+
* @param {*} state
|
|
101
|
+
* @param {string} property Property name the data should be saved to (datasets/distributions/catalogues)
|
|
102
|
+
*/
|
|
103
|
+
saveFromLocalstorage(t, e) {
|
|
104
|
+
let s;
|
|
105
|
+
if (e === "catalogues" ? s = "dpi_catalogues" : s = "dpi_datasets", Object.keys(localStorage).includes(s)) {
|
|
106
|
+
const a = JSON.parse(localStorage.getItem(s));
|
|
107
|
+
e === "catalogues" ? t[e] = a : t.datasets = a;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Converts RDF data into input form data
|
|
112
|
+
* @param state
|
|
113
|
+
* @param param1 Object containing data and property and state
|
|
114
|
+
*/
|
|
115
|
+
saveLinkedDataToStore(t, { property: e, data: s, specification: a }) {
|
|
116
|
+
const o = a;
|
|
117
|
+
S.convertToInput(t, e, s, o), localStorage.setItem(`dpi_${e}`, JSON.stringify(t[e]));
|
|
118
|
+
},
|
|
119
|
+
resetStore(t) {
|
|
120
|
+
localStorage.removeItem("dpi_datasets"), localStorage.removeItem("dpi_catalogues"), t.datasets = {}, t.catalogues = {}, localStorage.setItem("dpi_editmode", !1), localStorage.setItem("dpi_draftmode", !1);
|
|
121
|
+
}
|
|
122
|
+
}, _ = {
|
|
123
|
+
state: D,
|
|
124
|
+
getters: v,
|
|
125
|
+
actions: p,
|
|
126
|
+
mutations: F
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
_ as default
|
|
130
|
+
};
|