@nfdi4plants/arctrl 2.2.1 → 2.2.2
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/Json/Process/Sample.js +52 -21
- package/Json/Process/Source.js +35 -4
- package/package.json +1 -1
package/Json/Process/Sample.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { replace } from "../../fable_modules/fable-library-js.4.22.0/String.js";
|
|
2
|
-
import { ofArray, singleton, choose, append, empty, map } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
2
|
+
import { tail, head, isEmpty, ofArray, singleton, choose, append, empty, map } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
3
3
|
import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_1 } from "./MaterialAttributeValue.js";
|
|
4
4
|
import { map as map_1, defaultArg } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
|
|
5
5
|
import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_2, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_2 } from "./FactorValue.js";
|
|
@@ -7,10 +7,10 @@ import { list as list_5 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode
|
|
|
7
7
|
import { tryIncludeListOpt, tryIncludeList, tryInclude } from "../Encode.js";
|
|
8
8
|
import { context_jsonvalue } from "../context/rocrate/isa_sample_context.js";
|
|
9
9
|
import { map as map_2 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
|
|
10
|
-
import {
|
|
10
|
+
import { list as list_6, unit, object, string } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
11
11
|
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.22.0/Result.js";
|
|
12
|
-
import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
13
12
|
import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
|
|
13
|
+
import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
14
14
|
import { ISAJson_decoder as ISAJson_decoder_3, ISAJson_encoder as ISAJson_encoder_3, ROCrate_decoder as ROCrate_decoder_3 } from "./Source.js";
|
|
15
15
|
import { Sample } from "../../Core/Process/Sample.js";
|
|
16
16
|
import { encode } from "../IDTable.js";
|
|
@@ -76,22 +76,10 @@ export const ROCrate_additionalPropertyDecoder = {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
export const ROCrate_decoder = object((get$) => {
|
|
79
|
-
let
|
|
80
|
-
let additionalProperties;
|
|
81
|
-
const arg_1 = list_6(ROCrate_additionalPropertyDecoder);
|
|
82
|
-
const objectArg = get$.Optional;
|
|
83
|
-
additionalProperties = objectArg.Field("additionalProperties", arg_1);
|
|
84
|
-
let patternInput;
|
|
85
|
-
if (additionalProperties != null) {
|
|
86
|
-
const additionalProperties_1 = additionalProperties;
|
|
87
|
-
patternInput = [Option_fromValueWithDefault(empty(), choose((tuple) => tuple[0], additionalProperties_1)), Option_fromValueWithDefault(empty(), choose((tuple_1) => tuple_1[1], additionalProperties_1))];
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
patternInput = [undefined, undefined];
|
|
91
|
-
}
|
|
79
|
+
let objectArg_5, objectArg_6, arg_15, objectArg_7;
|
|
92
80
|
let matchValue;
|
|
93
|
-
const
|
|
94
|
-
matchValue =
|
|
81
|
+
const objectArg = get$.Optional;
|
|
82
|
+
matchValue = objectArg.Field("additionalType", Decode_uri);
|
|
95
83
|
let matchResult;
|
|
96
84
|
if (matchValue == null) {
|
|
97
85
|
matchResult = 0;
|
|
@@ -104,12 +92,55 @@ export const ROCrate_decoder = object((get$) => {
|
|
|
104
92
|
}
|
|
105
93
|
switch (matchResult) {
|
|
106
94
|
case 1: {
|
|
107
|
-
const
|
|
108
|
-
|
|
95
|
+
const objectArg_1 = get$.Required;
|
|
96
|
+
objectArg_1.Field("FailBecauseNotSample", unit);
|
|
109
97
|
break;
|
|
110
98
|
}
|
|
111
99
|
}
|
|
112
|
-
|
|
100
|
+
let matchValue_1;
|
|
101
|
+
const arg_5 = list_6(string);
|
|
102
|
+
const objectArg_2 = get$.Optional;
|
|
103
|
+
matchValue_1 = objectArg_2.Field("@type", arg_5);
|
|
104
|
+
let matchResult_1;
|
|
105
|
+
if (matchValue_1 == null) {
|
|
106
|
+
matchResult_1 = 0;
|
|
107
|
+
}
|
|
108
|
+
else if (!isEmpty(matchValue_1)) {
|
|
109
|
+
if (head(matchValue_1) === "Sample") {
|
|
110
|
+
if (isEmpty(tail(matchValue_1))) {
|
|
111
|
+
matchResult_1 = 0;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
matchResult_1 = 1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
matchResult_1 = 1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
matchResult_1 = 1;
|
|
123
|
+
}
|
|
124
|
+
switch (matchResult_1) {
|
|
125
|
+
case 1: {
|
|
126
|
+
const objectArg_3 = get$.Required;
|
|
127
|
+
objectArg_3.Field("FailBecauseNotSample", unit);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
let additionalProperties;
|
|
132
|
+
const arg_9 = list_6(ROCrate_additionalPropertyDecoder);
|
|
133
|
+
const objectArg_4 = get$.Optional;
|
|
134
|
+
additionalProperties = objectArg_4.Field("additionalProperties", arg_9);
|
|
135
|
+
let patternInput;
|
|
136
|
+
if (additionalProperties != null) {
|
|
137
|
+
const additionalProperties_1 = additionalProperties;
|
|
138
|
+
patternInput = [Option_fromValueWithDefault(empty(), choose((tuple) => tuple[0], additionalProperties_1)), Option_fromValueWithDefault(empty(), choose((tuple_1) => tuple_1[1], additionalProperties_1))];
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
patternInput = [undefined, undefined];
|
|
142
|
+
}
|
|
143
|
+
return new Sample((objectArg_5 = get$.Optional, objectArg_5.Field("@id", Decode_uri)), (objectArg_6 = get$.Optional, objectArg_6.Field("name", string)), patternInput[0], patternInput[1], (arg_15 = list_6(ROCrate_decoder_3), (objectArg_7 = get$.Optional, objectArg_7.Field("derivesFrom", arg_15))));
|
|
113
144
|
});
|
|
114
145
|
|
|
115
146
|
export function ISAJson_encoder(idMap, oa) {
|
package/Json/Process/Source.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { replace } from "../../fable_modules/fable-library-js.4.22.0/String.js";
|
|
2
2
|
import { URIModule_toString } from "../../Core/URI.js";
|
|
3
|
-
import { ofArray, singleton, choose } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
3
|
+
import { tail, head, isEmpty, ofArray, singleton, choose } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
4
4
|
import { map } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
|
|
5
5
|
import { list as list_1 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
|
|
6
6
|
import { tryIncludeListOpt, tryInclude } from "../Encode.js";
|
|
7
7
|
import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_1 } from "./MaterialAttributeValue.js";
|
|
8
8
|
import { context_jsonvalue } from "../context/rocrate/isa_source_context.js";
|
|
9
9
|
import { map as map_1 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
|
|
10
|
-
import { list as list_2,
|
|
10
|
+
import { string, list as list_2, unit, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
11
11
|
import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
|
|
12
12
|
import { Source } from "../../Core/Process/Source.js";
|
|
13
13
|
import { encode } from "../IDTable.js";
|
|
@@ -56,7 +56,7 @@ export function ROCrate_encoder(oa) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export const ROCrate_decoder = object((get$) => {
|
|
59
|
-
let
|
|
59
|
+
let objectArg_4, objectArg_5, arg_13, objectArg_6;
|
|
60
60
|
let matchValue;
|
|
61
61
|
const objectArg = get$.Optional;
|
|
62
62
|
matchValue = objectArg.Field("additionalType", Decode_uri);
|
|
@@ -77,7 +77,38 @@ export const ROCrate_decoder = object((get$) => {
|
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
let matchValue_1;
|
|
81
|
+
const arg_5 = list_2(string);
|
|
82
|
+
const objectArg_2 = get$.Optional;
|
|
83
|
+
matchValue_1 = objectArg_2.Field("@type", arg_5);
|
|
84
|
+
let matchResult_1;
|
|
85
|
+
if (matchValue_1 == null) {
|
|
86
|
+
matchResult_1 = 0;
|
|
87
|
+
}
|
|
88
|
+
else if (!isEmpty(matchValue_1)) {
|
|
89
|
+
if (head(matchValue_1) === "Source") {
|
|
90
|
+
if (isEmpty(tail(matchValue_1))) {
|
|
91
|
+
matchResult_1 = 0;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
matchResult_1 = 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
matchResult_1 = 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
matchResult_1 = 1;
|
|
103
|
+
}
|
|
104
|
+
switch (matchResult_1) {
|
|
105
|
+
case 1: {
|
|
106
|
+
const objectArg_3 = get$.Required;
|
|
107
|
+
objectArg_3.Field("FailBecauseNotSample", unit);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return new Source((objectArg_4 = get$.Optional, objectArg_4.Field("@id", Decode_uri)), (objectArg_5 = get$.Optional, objectArg_5.Field("name", string)), (arg_13 = list_2(ROCrate_decoder_1), (objectArg_6 = get$.Optional, objectArg_6.Field("characteristics", arg_13))));
|
|
81
112
|
});
|
|
82
113
|
|
|
83
114
|
export function ISAJson_encoder(idMap, oa) {
|