@piveau/dpi 0.1.0-beta.73 → 0.1.0-beta.74
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "axios";
|
|
2
|
-
import { asSomeArray as
|
|
2
|
+
import { asSomeArray as Rt } from "../../composables/useDpiSimpleLoader.js";
|
|
3
3
|
let d = { distribution: [], dataset: {}, meta: {} };
|
|
4
|
-
function
|
|
4
|
+
function St(t) {
|
|
5
5
|
return t.replace(/[^a-z0-9\s]/gi, "").replace(/\s+/g, "-").toLowerCase();
|
|
6
6
|
}
|
|
7
|
-
async function
|
|
8
|
-
var A,
|
|
7
|
+
async function Ut(t, g, l, b) {
|
|
8
|
+
var A, f, v, D, k, O, R, j, S, w, I, x, L, B, U, P, C, T, G, M, q, X, z, F, $, N, E, H, W, Y, _, J, K, Q, Z, m, V, tt, it, dt, et, at, nt, ct, ot, st, lt, rt, pt, bt, gt, yt, ut, ht, At, ft, vt, Dt, kt;
|
|
9
9
|
const u = g.specification.prefixes;
|
|
10
10
|
let p = [];
|
|
11
11
|
const o = Object.keys(t);
|
|
@@ -14,7 +14,7 @@ async function ft(t, g, l, b) {
|
|
|
14
14
|
p.push(crypto.randomUUID()), d.dataset["dcat:distribution"].push({
|
|
15
15
|
"@id": `https://piveau.io/set/distribution/${p[c]}`
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const jt = new URLSearchParams(window.location.search).get("edit");
|
|
18
18
|
let y = "";
|
|
19
19
|
try {
|
|
20
20
|
for (let c = 0; c < o.length; c++) {
|
|
@@ -25,7 +25,7 @@ async function ft(t, g, l, b) {
|
|
|
25
25
|
"@id": t.Discoverability.discoverabilityPage[e].uri
|
|
26
26
|
});
|
|
27
27
|
d.dataset["dcat:theme"] = i, t.Discoverability.hvdPage && Object.keys(t.Discoverability.hvdPage).length !== 0 && t.Discoverability.hvdPage[0].label !== void 0 && (d.dataset["dcatap:hvdCategory"] = {
|
|
28
|
-
"@id": (
|
|
28
|
+
"@id": (f = (A = t.Discoverability) == null ? void 0 : A.hvdPage) == null ? void 0 : f[0].uri
|
|
29
29
|
}, d.dataset["dcatap:applicableLegislation"] = {
|
|
30
30
|
"@id": "http://data.europa.eu/eli/reg_impl/2023/138/oj"
|
|
31
31
|
});
|
|
@@ -33,13 +33,13 @@ async function ft(t, g, l, b) {
|
|
|
33
33
|
if (o[c] === "BasicInfos") {
|
|
34
34
|
d.dataset["dpi:isDPIv3"] = !0;
|
|
35
35
|
for (let i = 0; i < Object.keys(t.BasicInfos).length; i++)
|
|
36
|
-
Object.keys(t.BasicInfos)[i] === "dct:title" && (d.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y =
|
|
36
|
+
Object.keys(t.BasicInfos)[i] === "dct:title" && (d.dataset["dct:title"] = t.BasicInfos["dct:title"][0] || "", y = St(
|
|
37
37
|
t.BasicInfos["dct:title"][0]["@value"]
|
|
38
|
-
),
|
|
38
|
+
), jt === "true" && (y = t.BasicInfos.datasetID)), Object.keys(t.BasicInfos)[i] === "dct:description" && (d.dataset["dct:description"] = t.BasicInfos["dct:description"][0] || ""), Object.keys(t.BasicInfos)[i] === "dct:modified" && ((v = t.BasicInfos["dct:modified"]) != null && v[0] ? d.dataset["dct:modified"] = { ...(D = t.BasicInfos["dct:modified"]) == null ? void 0 : D[0], "@type": ((O = (k = t.BasicInfos["dct:modified"]) == null ? void 0 : k[0]) == null ? void 0 : O["@type"]) || "http://www.w3.org/2001/XMLSchema#date" } : d.dataset["dct:modified"] = void 0), Object.keys(t.BasicInfos)[i] === "dct:publisher" && ((R = t.BasicInfos["dct:publisher"]) != null && R[0] ? d.dataset["dct:publisher"] = { ...(j = t.BasicInfos["dct:publisher"]) == null ? void 0 : j[0], "@type": ((w = (S = t.BasicInfos["dct:publisher"]) == null ? void 0 : S[0]) == null ? void 0 : w["@type"]) || "foaf:Agent" } : d.dataset["dct:publisher"] = void 0), Object.keys(t.BasicInfos)[i] === "dcat:contactPoint" && ((I = t.BasicInfos["dcat:contactPoint"]) != null && I[0] ? d.dataset["dcat:contactPoint"] = { ...(x = t.BasicInfos["dcat:contactPoint"]) == null ? void 0 : x[0], "@type": ((B = (L = t.BasicInfos["dcat:contactPoint"]) == null ? void 0 : L[0]) == null ? void 0 : B["@type"]) || "vcard:Organization" } : d.dataset["dcat:contactPoint"] = void 0), d.dataset["@type"] = "dcat:Dataset", d.meta["dcat:catalog"] = l.permissions[0].rsname, d.meta["@type"] = "dcat:CatalogRecord";
|
|
39
39
|
}
|
|
40
40
|
if (o[c] === "Covering" && Object.keys(t.Covering).length > 1)
|
|
41
41
|
for (let i = 0; i < Object.keys(t.Covering).length; i++) {
|
|
42
|
-
if (Object.keys(t.Covering)[i] === "dcat:temporalResolution" && t.Covering["dcat:temporalResolution"] !== void 0 && Object.keys((
|
|
42
|
+
if (Object.keys(t.Covering)[i] === "dcat:temporalResolution" && t.Covering["dcat:temporalResolution"] !== void 0 && Object.keys((U = t.Covering) == null ? void 0 : U["dcat:temporalResolution"]).length > 0 && ((C = (P = t.Covering) == null ? void 0 : P["dcat:temporalResolution"]) == null ? void 0 : C.type) !== void 0) {
|
|
43
43
|
d.dataset["dct:temporal"] = [];
|
|
44
44
|
for (let e = 0; e < t.Covering["dcat:temporalResolution"]["dct:temporal"].length; e++)
|
|
45
45
|
t.Covering["dcat:temporalResolution"].type != null && t.Covering["dcat:temporalResolution"]["dct:temporal"][e].dataType === "date" && t.Covering["dcat:temporalResolution"]["dct:temporal"][e]["dcat:startDate"] !== "" && (d.dataset["dct:temporal"][e] = {
|
|
@@ -64,15 +64,15 @@ async function ft(t, g, l, b) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
Object.keys(t.Covering)[i] === "dcatde:politicalGeocodingURI" && ((
|
|
68
|
-
"@id": ((
|
|
67
|
+
Object.keys(t.Covering)[i] === "dcatde:politicalGeocodingURI" && ((M = (G = (T = t.Covering) == null ? void 0 : T["dcatde:politicalGeocodingURI"]) == null ? void 0 : G[0]) == null ? void 0 : M.uri) != null && (d.dataset["dcatde:politicalGeocodingURI"] = {
|
|
68
|
+
"@id": ((X = (q = t.Covering["dcatde:politicalGeocodingURI"]) == null ? void 0 : q[0]) == null ? void 0 : X.uri) || ""
|
|
69
69
|
}, d.dataset["dct:spatial"] === void 0 && (d.dataset["dct:spatial"] = []), d.dataset["dct:spatial"].push({
|
|
70
|
-
"@id": ((
|
|
70
|
+
"@id": ((F = (z = t.Covering["dcatde:politicalGeocodingURI"]) == null ? void 0 : z[0]) == null ? void 0 : F.uri) || ""
|
|
71
71
|
}));
|
|
72
72
|
}
|
|
73
73
|
if (o[c] === "DistributionSimple")
|
|
74
74
|
for (let i = 0; i < t.DistributionSimple["dcat:distribution"].length; i++) {
|
|
75
|
-
if (d.distribution[i] = {}, ((
|
|
75
|
+
if (d.distribution[i] = {}, ((N = ($ = t.Discoverability) == null ? void 0 : $.hvdPage[0]) == null ? void 0 : N.uri) != null && (d.distribution[i]["dcatap:applicableLegislation"] = {
|
|
76
76
|
"@id": "http://data.europa.eu/eli/reg_impl/2023/138/oj"
|
|
77
77
|
}), d.distribution[i]["@type"] = "dcat:Distribution", d.distribution[i]["@id"] = `https://piveau.io/set/distribution/${p[i]}`, t.DistributionSimple["dcat:distribution"][i]["dcat:accessURL"] && (d.distribution[i]["dcat:accessURL"] = {
|
|
78
78
|
"@id": t.DistributionSimple["dcat:distribution"][i]["dcat:accessURL"]
|
|
@@ -86,8 +86,8 @@ async function ft(t, g, l, b) {
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
if (Object.keys(
|
|
89
|
-
(
|
|
90
|
-
).length !== 0 && ((
|
|
89
|
+
(E = t.DistributionSimple["dcat:distribution"][i]) == null ? void 0 : E.policyItems
|
|
90
|
+
).length !== 0 && ((H = t.DistributionSimple["dcat:distribution"][i]) == null ? void 0 : H.policyItems[0]["dcat:downloadURL"]) !== "") {
|
|
91
91
|
d.distribution[i]["odrl:hasPolicy"] = [];
|
|
92
92
|
for (let a = 0; a < t.DistributionSimple["dcat:distribution"][i].policyItems.length; a++)
|
|
93
93
|
d.distribution[i]["odrl:hasPolicy"][a] = {
|
|
@@ -95,7 +95,7 @@ async function ft(t, g, l, b) {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
Object.keys(
|
|
98
|
-
(
|
|
98
|
+
(W = t.DistributionSimple["dcat:distribution"][i]) == null ? void 0 : W["dct:license"]
|
|
99
99
|
).length !== 0 && (d.distribution[i]["dct:license"] = {
|
|
100
100
|
"@id": t.DistributionSimple["dcat:distribution"][i]["dct:license"].uri || t.DistributionSimple["dct:license"][0].uri
|
|
101
101
|
}, t.DistributionSimple["dcat:distribution"][i]["dct:license"]["dcterms:license"] === "" && t.DistributionSimple["dct:license"][0].title !== "" && (d.distribution[i]["dcatde:licenseAttributionByText"] = {
|
|
@@ -105,12 +105,12 @@ async function ft(t, g, l, b) {
|
|
|
105
105
|
"@language": "de",
|
|
106
106
|
"@value": t.DistributionSimple["dcat:distribution"][i]["dct:license"].title
|
|
107
107
|
}));
|
|
108
|
-
const e = (
|
|
108
|
+
const e = (J = (_ = (Y = t.DistributionSimple) == null ? void 0 : Y["dcat:distribution"]) == null ? void 0 : _[i]) == null ? void 0 : J["dct:format"];
|
|
109
109
|
e && (d.distribution[i]["dct:format"] = {
|
|
110
110
|
"@id": (e == null ? void 0 : e.uri) || ""
|
|
111
|
-
}), ((
|
|
112
|
-
const s = ((
|
|
113
|
-
if (s.length !== 0 && (d.distribution[i]["dct:conformsTo"] =
|
|
111
|
+
}), ((Z = (Q = (K = t.DistributionSimple) == null ? void 0 : K["dcat:distribution"]) == null ? void 0 : Q[i]) == null ? void 0 : Z["dcatap:applicableLegislation"]) != null && (d.distribution[i]["dct:format"] = (tt = (V = (m = t.DistributionSimple) == null ? void 0 : m["dcat:distribution"]) == null ? void 0 : V[i]) == null ? void 0 : tt["dcatap:applicableLegislation"]["@id"]);
|
|
112
|
+
const s = ((et = (dt = (it = t.DistributionSimple) == null ? void 0 : it["dcat:distribution"]) == null ? void 0 : dt[i]) == null ? void 0 : et.conformsToItems) || [];
|
|
113
|
+
if (s.length !== 0 && (d.distribution[i]["dct:conformsTo"] = Rt(
|
|
114
114
|
s
|
|
115
115
|
).filter(
|
|
116
116
|
(a) => a && (a["dcat:downloadURL"] || a["dct:title"])
|
|
@@ -126,6 +126,7 @@ async function ft(t, g, l, b) {
|
|
|
126
126
|
"@value": t.DistributionSimple["dcat:distribution"][i]["dcat:byteSize"] || "",
|
|
127
127
|
"@type": "http://www.w3.org/2001/XMLSchema#decimal"
|
|
128
128
|
}), t.DistributionSimple["dcat:distribution"][i]["dcatde:licenseAttributionByText"] && (d.distribution[i]["dcatde:licenseAttributionByText"] = {
|
|
129
|
+
"@language": "de",
|
|
129
130
|
"@value": t.DistributionSimple["dcat:distribution"][i]["dcatde:licenseAttributionByText"] || ""
|
|
130
131
|
}), Object.keys(
|
|
131
132
|
t.DistributionSimple["dcat:distribution"][i]["dcatap:availability"]
|
|
@@ -175,8 +176,8 @@ async function ft(t, g, l, b) {
|
|
|
175
176
|
).length !== 0 && (d.distribution[i]["adms:status"] = {
|
|
176
177
|
"@id": t.DistributionSimple["dcat:distribution"][i]["adms:status"].uri || ""
|
|
177
178
|
});
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
179
|
+
const Ot = ((ct = (nt = (at = t.DistributionSimple) == null ? void 0 : at["dcat:distribution"]) == null ? void 0 : nt[i]) == null ? void 0 : ct.accessServices) || [];
|
|
180
|
+
if (Ot.length !== 0 && (d.distribution[i]["dcat:accessService"] = (ot = Rt(Ot)) == null ? void 0 : ot.filter(
|
|
180
181
|
(a) => a && (a["dct:title"] || a["dct:description"] || a["dcat:downloadURL"] || a["dcat:endpointURL"])
|
|
181
182
|
).map((a) => {
|
|
182
183
|
const n = {
|
|
@@ -195,7 +196,7 @@ async function ft(t, g, l, b) {
|
|
|
195
196
|
"@id": r
|
|
196
197
|
}), n;
|
|
197
198
|
})), d.distribution[i]["foaf:page"] || (d.distribution[i]["foaf:page"] = []), d.distribution[i]["foaf:page"].length !== 0)
|
|
198
|
-
for (let a = 0; a < ((
|
|
199
|
+
for (let a = 0; a < ((rt = (lt = (st = t.DistributionSimple) == null ? void 0 : st["dcat:distribution"]) == null ? void 0 : lt[i]) == null ? void 0 : rt.documentations.length); a++) {
|
|
199
200
|
const n = t.DistributionSimple["dcat:distribution"][i].documentations[a];
|
|
200
201
|
if ((n == null ? void 0 : n["dct:title"]) !== void 0) {
|
|
201
202
|
const r = {
|
|
@@ -237,7 +238,7 @@ async function ft(t, g, l, b) {
|
|
|
237
238
|
for (let e = 0; e < t.Additionals["dcat:keyword"].length; e++)
|
|
238
239
|
d.dataset["dcat:keyword"] === void 0 && (d.dataset["dcat:keyword"] = []), d.dataset["dcat:keyword"].push({
|
|
239
240
|
"@value": t.Additionals["dcat:keyword"][e]["@value"],
|
|
240
|
-
"@language": ((
|
|
241
|
+
"@language": ((bt = (pt = t.Additionals["dcat:keyword"]) == null ? void 0 : pt[e]) == null ? void 0 : bt["@language"]) || "de"
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
if (Object.keys(t.Additionals)[i] === "dct:references") {
|
|
@@ -319,7 +320,7 @@ async function ft(t, g, l, b) {
|
|
|
319
320
|
for (let e = 0; e < t.Additionals["dcatde:legalBasis"].length; e++)
|
|
320
321
|
d.dataset["dcatde:legalBasis"] === void 0 && (d.dataset["dcatde:legalBasis"] = []), d.dataset["dcatde:legalBasis"].push({
|
|
321
322
|
"@value": t.Additionals["dcatde:legalBasis"][e]["@value"],
|
|
322
|
-
"@language": ((
|
|
323
|
+
"@language": ((ut = (yt = (gt = t.Additionals) == null ? void 0 : gt["dcatde:legalBasis"]) == null ? void 0 : yt[e]) == null ? void 0 : ut["@language"]) || "de"
|
|
323
324
|
});
|
|
324
325
|
}
|
|
325
326
|
if (Object.keys(t.Additionals)[i] === "dct:relation") {
|
|
@@ -457,7 +458,7 @@ async function ft(t, g, l, b) {
|
|
|
457
458
|
for (let e = 0; e < t.Additionals["foaf:page"].length; e++)
|
|
458
459
|
d.dataset["foaf:page"] === void 0 && (d.dataset["foaf:page"] = []), d.dataset["foaf:page"].push({
|
|
459
460
|
"dct:format": {
|
|
460
|
-
"@id": (
|
|
461
|
+
"@id": (At = (ht = t.Additionals["foaf:page"]) == null ? void 0 : ht[e]) == null ? void 0 : At.uri
|
|
461
462
|
},
|
|
462
463
|
"dct:title": t.Additionals["foaf:page"][e]["dct:title"],
|
|
463
464
|
"dct:description": t.Additionals["foaf:page"][e]["dct:description"],
|
|
@@ -499,7 +500,7 @@ async function ft(t, g, l, b) {
|
|
|
499
500
|
}), Object.keys(t.Additionals)[i] === "dcatde:politicalGeocodingLevelURI")
|
|
500
501
|
for (let e = 0; e < t.Additionals["dcatde:politicalGeocodingLevelURI"].length; e++)
|
|
501
502
|
d.dataset["dcatde:politicalGeocodingLevelURI"] === void 0 && (d.dataset["dcatde:politicalGeocodingLevelURI"] = []), d.dataset["dcatde:politicalGeocodingLevelURI"].push({
|
|
502
|
-
"@id": ((
|
|
503
|
+
"@id": ((vt = (ft = t.Additionals["dcatde:politicalGeocodingLevelURI"]) == null ? void 0 : ft[e]) == null ? void 0 : vt.uri) || ((kt = (Dt = t.Additionals["dcatde:politicalGeocodingLevelURI"]) == null ? void 0 : Dt[e]) == null ? void 0 : kt["@id"]) || ""
|
|
503
504
|
});
|
|
504
505
|
}
|
|
505
506
|
} catch (i) {
|
|
@@ -507,9 +508,10 @@ async function ft(t, g, l, b) {
|
|
|
507
508
|
}
|
|
508
509
|
}
|
|
509
510
|
} catch (c) {
|
|
511
|
+
debugger;
|
|
510
512
|
console.log(c);
|
|
511
513
|
}
|
|
512
|
-
let h =
|
|
514
|
+
let h = wt(d, u);
|
|
513
515
|
return { actionParams: {
|
|
514
516
|
id: y,
|
|
515
517
|
catalog: l.permissions[0].rsname,
|
|
@@ -518,7 +520,7 @@ async function ft(t, g, l, b) {
|
|
|
518
520
|
description: d.dataset["dct:description"]["@value"]
|
|
519
521
|
}, body: h };
|
|
520
522
|
}
|
|
521
|
-
function
|
|
523
|
+
function wt(t, g) {
|
|
522
524
|
const l = {}, b = Object.keys(t);
|
|
523
525
|
for (let o = 0; o < b.length; o++)
|
|
524
526
|
b[o], l[b[o]] = t[b[o]];
|
|
@@ -538,5 +540,5 @@ function yt(t, g) {
|
|
|
538
540
|
return console.log(p), p;
|
|
539
541
|
}
|
|
540
542
|
export {
|
|
541
|
-
|
|
543
|
+
Ut as default
|
|
542
544
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piveau/dpi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.74",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.css",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@headlessui/vue": "^1.7.23",
|
|
56
56
|
"@histoire/plugin-vue": "1.0.0-alpha.2",
|
|
57
57
|
"@phosphor-icons/vue": "^2.2.1",
|
|
58
|
-
"@piveau/jsonld": "file:../../bin/piveau-jsonld-1.0.0-beta.
|
|
58
|
+
"@piveau/jsonld": "file:../../bin/piveau-jsonld-1.0.0-beta.24.tgz",
|
|
59
59
|
"@popperjs/core": "^2.11.8",
|
|
60
60
|
"@types/jsonld": "^1.5.15",
|
|
61
61
|
"@types/node": "^24.1.0",
|