@nfdi4plants/arctrl 2.0.0-alpha.7 → 2.0.0-beta.1
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/ARC.js +12 -14
- package/Contract/ArcAssay.js +1 -1
- package/Contract/ArcInvestigation.js +9 -12
- package/Contract/ArcStudy.js +1 -1
- package/Core/ArcTypes.js +53 -53
- package/Core/Conversion.js +28 -42
- package/Json/Assay.js +37 -24
- package/Json/Comment.js +19 -2
- package/Json/IDTable.js +19 -0
- package/Json/Investigation.js +7 -6
- package/Json/OntologyAnnotation.js +45 -2
- package/Json/OntologySourceReference.js +13 -3
- package/Json/Person.js +25 -15
- package/Json/Process/AssayMaterials.js +2 -2
- package/Json/Process/Component.js +12 -7
- package/Json/Process/Data.js +17 -9
- package/Json/Process/Factor.js +28 -5
- package/Json/Process/FactorValue.js +21 -9
- package/Json/Process/Material.js +16 -8
- package/Json/Process/MaterialAttribute.js +28 -10
- package/Json/Process/MaterialAttributeValue.js +21 -9
- package/Json/Process/Process.js +16 -8
- package/Json/Process/ProcessInput.js +11 -10
- package/Json/Process/ProcessOutput.js +10 -9
- package/Json/Process/ProcessParameterValue.js +12 -7
- package/Json/Process/ProcessSequence.js +4 -2
- package/Json/Process/PropertyValue.js +29 -4
- package/Json/Process/Protocol.js +79 -51
- package/Json/Process/ProtocolParameter.js +23 -6
- package/Json/Process/Sample.js +16 -8
- package/Json/Process/Source.js +17 -9
- package/Json/Process/StudyMaterials.js +2 -2
- package/Json/Process/Value.js +3 -3
- package/Json/Publication.js +8 -7
- package/Json/Study.js +64 -50
- package/Json.js +9 -9
- package/Spreadsheet/AnnotationTable/ArcTable.js +33 -23
- package/Spreadsheet/AnnotationTable/CompositeCell.js +22 -27
- package/Spreadsheet/AnnotationTable/CompositeColumn.js +38 -25
- package/Spreadsheet/AnnotationTable/CompositeHeader.js +181 -339
- package/Spreadsheet/ArcInvestigation.js +5 -21
- package/Xlsx.js +1 -4
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OntologyAnnotation_ISAJson_decoder, OntologyAnnotation_ISAJson_encoder, OntologyAnnotation_ROCrate_genID } from "../OntologyAnnotation.js";
|
|
2
|
+
import { ofArray, choose } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
2
3
|
import { equals } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
3
4
|
import { Json } from "../../fable_modules/Thoth.Json.Core.0.2.1/Types.fs.js";
|
|
4
5
|
import { defaultSpaces, tryInclude } from "../Encode.js";
|
|
5
|
-
import {
|
|
6
|
+
import { encode } from "../IDTable.js";
|
|
6
7
|
import { object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
7
8
|
import { MaterialAttribute } from "../../Core/Process/MaterialAttribute.js";
|
|
8
9
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
9
10
|
import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
11
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
10
12
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
11
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
12
13
|
|
|
13
|
-
export function
|
|
14
|
-
|
|
14
|
+
export function MaterialAttribute_ISAJson_genID(m) {
|
|
15
|
+
const matchValue = m.CharacteristicType;
|
|
16
|
+
if (matchValue == null) {
|
|
17
|
+
return "#EmptyFactor";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return `#MaterialAttribute/${OntologyAnnotation_ROCrate_genID(matchValue)}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function MaterialAttribute_ISAJson_encoder(idMap, value) {
|
|
25
|
+
const f = (value_1) => (new Json(5, [choose((tupledArg) => {
|
|
15
26
|
const v = tupledArg[1];
|
|
16
27
|
if (equals(v, new Json(3, []))) {
|
|
17
28
|
return void 0;
|
|
@@ -19,7 +30,13 @@ export function MaterialAttribute_ISAJson_encoder(value) {
|
|
|
19
30
|
else {
|
|
20
31
|
return [tupledArg[0], v];
|
|
21
32
|
}
|
|
22
|
-
},
|
|
33
|
+
}, ofArray([tryInclude("@id", (value_2) => (new Json(0, [value_2])), MaterialAttribute_ISAJson_genID(value_1)), tryInclude("characteristicType", (oa) => OntologyAnnotation_ISAJson_encoder(idMap, oa), value_1.CharacteristicType)]))]));
|
|
34
|
+
if (idMap != null) {
|
|
35
|
+
return encode(MaterialAttribute_ISAJson_genID, f, value, idMap);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return f(value);
|
|
39
|
+
}
|
|
23
40
|
}
|
|
24
41
|
|
|
25
42
|
export const MaterialAttribute_ISAJson_decoder = object((get$) => {
|
|
@@ -37,14 +54,15 @@ export function ARCtrl_Process_MaterialAttribute__MaterialAttribute_fromISAJsonS
|
|
|
37
54
|
}
|
|
38
55
|
}
|
|
39
56
|
|
|
40
|
-
export function
|
|
57
|
+
export function ARCtrl_Process_MaterialAttribute__MaterialAttribute_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
58
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
41
59
|
return (v) => {
|
|
42
|
-
const value = MaterialAttribute_ISAJson_encoder(v);
|
|
60
|
+
const value = MaterialAttribute_ISAJson_encoder(idMap, v);
|
|
43
61
|
return toString(defaultSpaces(spaces), value);
|
|
44
62
|
};
|
|
45
63
|
}
|
|
46
64
|
|
|
47
|
-
export function
|
|
48
|
-
return
|
|
65
|
+
export function ARCtrl_Process_MaterialAttribute__MaterialAttribute_ToJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
66
|
+
return ARCtrl_Process_MaterialAttribute__MaterialAttribute_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
49
67
|
}
|
|
50
68
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decoder as decoder_1, encoder } from "./PropertyValue.js";
|
|
1
|
+
import { genID, decoder as decoder_1, encoder } from "./PropertyValue.js";
|
|
2
2
|
import { MaterialAttributeValue, MaterialAttributeValue_createAsPV } from "../../Core/Process/MaterialAttributeValue.js";
|
|
3
3
|
import { ofArray, choose } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
4
4
|
import { equals } from "../../fable_modules/fable-library-js.4.16.0/Util.js";
|
|
@@ -7,19 +7,24 @@ import { defaultSpaces, tryInclude } from "../Encode.js";
|
|
|
7
7
|
import { MaterialAttribute_ISAJson_decoder, MaterialAttribute_ISAJson_encoder } from "./MaterialAttribute.js";
|
|
8
8
|
import { Value_ISAJson_decoder, Value_ISAJson_encoder } from "./Value.js";
|
|
9
9
|
import { OntologyAnnotation_ISAJson_decoder, OntologyAnnotation_ISAJson_encoder } from "../OntologyAnnotation.js";
|
|
10
|
+
import { encode } from "../IDTable.js";
|
|
10
11
|
import { object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
11
12
|
import { Decode_uri } from "../Decode.js";
|
|
12
13
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
13
14
|
import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
15
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
14
16
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
15
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
16
17
|
|
|
17
18
|
export const MaterialAttributeValue_ROCrate_encoder = encoder;
|
|
18
19
|
|
|
19
20
|
export const MaterialAttributeValue_ROCrate_decoder = decoder_1(MaterialAttributeValue_createAsPV);
|
|
20
21
|
|
|
21
|
-
export function
|
|
22
|
-
return
|
|
22
|
+
export function MaterialAttributeValue_ISAJson_genID(oa) {
|
|
23
|
+
return genID(oa);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function MaterialAttributeValue_ISAJson_encoder(idMap, oa) {
|
|
27
|
+
const f = (oa_1) => (new Json(5, [choose((tupledArg) => {
|
|
23
28
|
const v = tupledArg[1];
|
|
24
29
|
if (equals(v, new Json(3, []))) {
|
|
25
30
|
return void 0;
|
|
@@ -27,7 +32,13 @@ export function MaterialAttributeValue_ISAJson_encoder(oa) {
|
|
|
27
32
|
else {
|
|
28
33
|
return [tupledArg[0], v];
|
|
29
34
|
}
|
|
30
|
-
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])),
|
|
35
|
+
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), MaterialAttributeValue_ISAJson_genID(oa_1)), tryInclude("category", (value_2) => MaterialAttribute_ISAJson_encoder(idMap, value_2), oa_1.Category), tryInclude("value", (value_3) => Value_ISAJson_encoder(idMap, value_3), oa_1.Value), tryInclude("unit", (oa_3) => OntologyAnnotation_ISAJson_encoder(idMap, oa_3), oa_1.Unit)]))]));
|
|
36
|
+
if (idMap != null) {
|
|
37
|
+
return encode(MaterialAttributeValue_ISAJson_genID, f, oa, idMap);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return f(oa);
|
|
41
|
+
}
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
export const MaterialAttributeValue_ISAJson_decoder = object((get$) => {
|
|
@@ -45,15 +56,16 @@ export function ARCtrl_Process_MaterialAttributeValue__MaterialAttributeValue_fr
|
|
|
45
56
|
}
|
|
46
57
|
}
|
|
47
58
|
|
|
48
|
-
export function
|
|
59
|
+
export function ARCtrl_Process_MaterialAttributeValue__MaterialAttributeValue_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
60
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
49
61
|
return (f) => {
|
|
50
|
-
const value = MaterialAttributeValue_ISAJson_encoder(f);
|
|
62
|
+
const value = MaterialAttributeValue_ISAJson_encoder(idMap, f);
|
|
51
63
|
return toString(defaultSpaces(spaces), value);
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
66
|
|
|
55
|
-
export function
|
|
56
|
-
return
|
|
67
|
+
export function ARCtrl_Process_MaterialAttributeValue__MaterialAttributeValue_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
68
|
+
return ARCtrl_Process_MaterialAttributeValue__MaterialAttributeValue_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
export function ARCtrl_Process_MaterialAttributeValue__MaterialAttributeValue_fromROCrateJsonString_Static_Z721C83C5(s) {
|
package/Json/Process/Process.js
CHANGED
|
@@ -15,9 +15,10 @@ import { context_jsonvalue } from "../context/rocrate/isa_process_context.js";
|
|
|
15
15
|
import { list as list_2, string, object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
16
16
|
import { Decode_uri } from "../Decode.js";
|
|
17
17
|
import { Process } from "../../Core/Process/Process.js";
|
|
18
|
+
import { encode } from "../IDTable.js";
|
|
18
19
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
20
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
19
21
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
20
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
21
22
|
|
|
22
23
|
export function Process_ROCrate_genID(p) {
|
|
23
24
|
const matchValue = p.ID;
|
|
@@ -52,8 +53,8 @@ export const Process_ROCrate_decoder = object((get$) => {
|
|
|
52
53
|
return new Process((objectArg = get$.Optional, objectArg.Field("@id", Decode_uri)), (objectArg_1 = get$.Optional, objectArg_1.Field("name", string)), (objectArg_2 = get$.Optional, objectArg_2.Field("executesProtocol", Protocol_ROCrate_decoder)), (arg_7 = list_2(ProcessParameterValue_ROCrate_decoder), (objectArg_3 = get$.Optional, objectArg_3.Field("parameterValues", arg_7))), (objectArg_4 = get$.Optional, objectArg_4.Field("performer", Person_ROCrate_decodeAuthorListString)), (objectArg_5 = get$.Optional, objectArg_5.Field("date", string)), void 0, void 0, (arg_13 = list_2(ProcessInput_ROCrate_decoder), (objectArg_6 = get$.Optional, objectArg_6.Field("inputs", arg_13))), (arg_15 = list_2(ProcessOutput_ROCrate_decoder), (objectArg_7 = get$.Optional, objectArg_7.Field("outputs", arg_15))), (arg_17 = list_2(Comment_ROCrate_decoder), (objectArg_8 = get$.Optional, objectArg_8.Field("comments", arg_17))));
|
|
53
54
|
});
|
|
54
55
|
|
|
55
|
-
export function Process_ISAJson_encoder(oa) {
|
|
56
|
-
|
|
56
|
+
export function Process_ISAJson_encoder(studyName, assayName, idMap, oa) {
|
|
57
|
+
const f = (oa_1) => (new Json(5, [choose((tupledArg) => {
|
|
57
58
|
const v = tupledArg[1];
|
|
58
59
|
if (equals(v, new Json(3, []))) {
|
|
59
60
|
return void 0;
|
|
@@ -61,7 +62,13 @@ export function Process_ISAJson_encoder(oa) {
|
|
|
61
62
|
else {
|
|
62
63
|
return [tupledArg[0], v];
|
|
63
64
|
}
|
|
64
|
-
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])),
|
|
65
|
+
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), Process_ROCrate_genID(oa_1)), tryInclude("name", (value_2) => (new Json(0, [value_2])), oa_1.Name), tryInclude("executesProtocol", (oa_2) => Protocol_ISAJson_encoder(studyName, assayName, oa_1.Name, idMap, oa_2), oa_1.ExecutesProtocol), tryIncludeListOpt("parameterValues", (oa_3) => ProcessParameterValue_ISAJson_encoder(idMap, oa_3), oa_1.ParameterValues), tryInclude("performer", (value_4) => (new Json(0, [value_4])), oa_1.Performer), tryInclude("date", (value_6) => (new Json(0, [value_6])), oa_1.Date), tryInclude("previousProcess", (oa_4) => Process_ISAJson_encoder(studyName, assayName, idMap, oa_4), oa_1.PreviousProcess), tryInclude("nextProcess", (oa_5) => Process_ISAJson_encoder(studyName, assayName, idMap, oa_5), oa_1.NextProcess), tryIncludeListOpt("inputs", (value_8) => ProcessInput_ISAJson_encoder(idMap, value_8), oa_1.Inputs), tryIncludeListOpt("outputs", (value_9) => ProcessOutput_ISAJson_encoder(idMap, value_9), oa_1.Outputs), tryIncludeListOpt("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), oa_1.Comments)]))]));
|
|
66
|
+
if (idMap != null) {
|
|
67
|
+
return encode(Process_ROCrate_genID, f, oa, idMap);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return f(oa);
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
export const Process_ISAJson_decoder = (() => {
|
|
@@ -82,15 +89,16 @@ export function ARCtrl_Process_Process__Process_fromISAJsonString_Static_Z721C83
|
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
|
|
85
|
-
export function
|
|
92
|
+
export function ARCtrl_Process_Process__Process_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
93
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
86
94
|
return (f) => {
|
|
87
|
-
const value = Process_ISAJson_encoder(f);
|
|
95
|
+
const value = Process_ISAJson_encoder(void 0, void 0, idMap, f);
|
|
88
96
|
return toString(defaultSpaces(spaces), value);
|
|
89
97
|
};
|
|
90
98
|
}
|
|
91
99
|
|
|
92
|
-
export function
|
|
93
|
-
return
|
|
100
|
+
export function ARCtrl_Process_Process__Process_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
101
|
+
return ARCtrl_Process_Process__Process_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
export function ARCtrl_Process_Process__Process_fromROCrateString_Static_Z721C83C5(s) {
|
|
@@ -7,9 +7,9 @@ import { ProcessInput } from "../../Core/Process/ProcessInput.js";
|
|
|
7
7
|
import { ofArray } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
8
8
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
9
9
|
import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
10
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
10
11
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
11
12
|
import { defaultSpaces } from "../Encode.js";
|
|
12
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
13
13
|
|
|
14
14
|
export function ProcessInput_ROCrate_encoder(value) {
|
|
15
15
|
switch (value.tag) {
|
|
@@ -26,16 +26,16 @@ export function ProcessInput_ROCrate_encoder(value) {
|
|
|
26
26
|
|
|
27
27
|
export const ProcessInput_ROCrate_decoder = oneOf(ofArray([map((Item) => (new ProcessInput(0, [Item])), Source_ROCrate_decoder), map((Item_1) => (new ProcessInput(1, [Item_1])), Sample_ROCrate_decoder), map((Item_2) => (new ProcessInput(2, [Item_2])), Data_ROCrate_decoder), map((Item_3) => (new ProcessInput(3, [Item_3])), Material_ROCrate_decoder)]));
|
|
28
28
|
|
|
29
|
-
export function ProcessInput_ISAJson_encoder(value) {
|
|
29
|
+
export function ProcessInput_ISAJson_encoder(idMap, value) {
|
|
30
30
|
switch (value.tag) {
|
|
31
31
|
case 1:
|
|
32
|
-
return Sample_ISAJson_encoder(value.fields[0]);
|
|
32
|
+
return Sample_ISAJson_encoder(idMap, value.fields[0]);
|
|
33
33
|
case 2:
|
|
34
|
-
return Data_ISAJson_encoder(value.fields[0]);
|
|
34
|
+
return Data_ISAJson_encoder(idMap, value.fields[0]);
|
|
35
35
|
case 3:
|
|
36
|
-
return Material_ISAJson_encoder(value.fields[0]);
|
|
36
|
+
return Material_ISAJson_encoder(idMap, value.fields[0]);
|
|
37
37
|
default:
|
|
38
|
-
return Source_ISAJson_encoder(value.fields[0]);
|
|
38
|
+
return Source_ISAJson_encoder(idMap, value.fields[0]);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -51,14 +51,15 @@ export function ARCtrl_Process_ProcessInput__ProcessInput_fromISAJsonString_Stat
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function
|
|
54
|
+
export function ARCtrl_Process_ProcessInput__ProcessInput_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
55
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
55
56
|
return (f) => {
|
|
56
|
-
const value = ProcessInput_ISAJson_encoder(f);
|
|
57
|
+
const value = ProcessInput_ISAJson_encoder(idMap, f);
|
|
57
58
|
return toString(defaultSpaces(spaces), value);
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
export function
|
|
62
|
-
return
|
|
62
|
+
export function ARCtrl_Process_ProcessInput__ProcessInput_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
63
|
+
return ARCtrl_Process_ProcessInput__ProcessInput_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
63
64
|
}
|
|
64
65
|
|
|
@@ -6,9 +6,9 @@ import { ProcessOutput } from "../../Core/Process/ProcessOutput.js";
|
|
|
6
6
|
import { ofArray } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
7
7
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
8
8
|
import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
9
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
9
10
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
10
11
|
import { defaultSpaces } from "../Encode.js";
|
|
11
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
12
12
|
|
|
13
13
|
export function ProcessOutput_ROCrate_encoder(value) {
|
|
14
14
|
switch (value.tag) {
|
|
@@ -23,14 +23,14 @@ export function ProcessOutput_ROCrate_encoder(value) {
|
|
|
23
23
|
|
|
24
24
|
export const ProcessOutput_ROCrate_decoder = oneOf(ofArray([map((Item) => (new ProcessOutput(0, [Item])), Sample_ROCrate_decoder), map((Item_1) => (new ProcessOutput(1, [Item_1])), Data_ROCrate_decoder), map((Item_2) => (new ProcessOutput(2, [Item_2])), Material_ROCrate_decoder)]));
|
|
25
25
|
|
|
26
|
-
export function ProcessOutput_ISAJson_encoder(value) {
|
|
26
|
+
export function ProcessOutput_ISAJson_encoder(idMap, value) {
|
|
27
27
|
switch (value.tag) {
|
|
28
28
|
case 1:
|
|
29
|
-
return Data_ISAJson_encoder(value.fields[0]);
|
|
29
|
+
return Data_ISAJson_encoder(idMap, value.fields[0]);
|
|
30
30
|
case 2:
|
|
31
|
-
return Material_ISAJson_encoder(value.fields[0]);
|
|
31
|
+
return Material_ISAJson_encoder(idMap, value.fields[0]);
|
|
32
32
|
default:
|
|
33
|
-
return Sample_ISAJson_encoder(value.fields[0]);
|
|
33
|
+
return Sample_ISAJson_encoder(idMap, value.fields[0]);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -46,15 +46,16 @@ export function ARCtrl_Process_ProcessOutput__ProcessOutput_fromISAJsonString_St
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export function
|
|
49
|
+
export function ARCtrl_Process_ProcessOutput__ProcessOutput_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
50
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
50
51
|
return (f) => {
|
|
51
|
-
const value = ProcessOutput_ISAJson_encoder(f);
|
|
52
|
+
const value = ProcessOutput_ISAJson_encoder(idMap, f);
|
|
52
53
|
return toString(defaultSpaces(spaces), value);
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
export function
|
|
57
|
-
return
|
|
57
|
+
export function ARCtrl_Process_ProcessOutput__ProcessOutput_toISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
58
|
+
return ARCtrl_Process_ProcessOutput__ProcessOutput_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export function ARCtrl_Process_ProcessOutput__ProcessOutput_fromROCrateJsonString_Static_Z721C83C5(s) {
|
|
@@ -10,14 +10,18 @@ import { OntologyAnnotation_ISAJson_decoder, OntologyAnnotation_ISAJson_encoder
|
|
|
10
10
|
import { object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
11
11
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
12
12
|
import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
13
|
+
import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
13
14
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
14
|
-
import { unwrap } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
15
15
|
|
|
16
16
|
export const ProcessParameterValue_ROCrate_encoder = encoder;
|
|
17
17
|
|
|
18
18
|
export const ProcessParameterValue_ROCrate_decoder = decoder_1((category, value, unit) => ProcessParameterValue.createAsPV(category, value, unit));
|
|
19
19
|
|
|
20
|
-
export function
|
|
20
|
+
export function ProcessParameterValue_ISAJson_genID(oa) {
|
|
21
|
+
throw new Error("Not implemented");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function ProcessParameterValue_ISAJson_encoder(idMap, oa) {
|
|
21
25
|
return new Json(5, [choose((tupledArg) => {
|
|
22
26
|
const v = tupledArg[1];
|
|
23
27
|
if (equals(v, new Json(3, []))) {
|
|
@@ -26,7 +30,7 @@ export function ProcessParameterValue_ISAJson_encoder(oa) {
|
|
|
26
30
|
else {
|
|
27
31
|
return [tupledArg[0], v];
|
|
28
32
|
}
|
|
29
|
-
}, ofArray([tryInclude("category", ProtocolParameter_ISAJson_encoder, oa.Category), tryInclude("value", Value_ISAJson_encoder, oa.Value), tryInclude("unit", OntologyAnnotation_ISAJson_encoder, oa.Unit)]))]);
|
|
33
|
+
}, ofArray([tryInclude("category", (value) => ProtocolParameter_ISAJson_encoder(idMap, value), oa.Category), tryInclude("value", (value_1) => Value_ISAJson_encoder(idMap, value_1), oa.Value), tryInclude("unit", (oa_1) => OntologyAnnotation_ISAJson_encoder(idMap, oa_1), oa.Unit)]))]);
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
export const ProcessParameterValue_ISAJson_decoder = object((get$) => {
|
|
@@ -44,15 +48,16 @@ export function ARCtrl_Process_ProcessParameterValue__ProcessParameterValue_from
|
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
export function
|
|
51
|
+
export function ARCtrl_Process_ProcessParameterValue__ProcessParameterValue_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
52
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
48
53
|
return (f) => {
|
|
49
|
-
const value = ProcessParameterValue_ISAJson_encoder(f);
|
|
54
|
+
const value = ProcessParameterValue_ISAJson_encoder(idMap, f);
|
|
50
55
|
return toString(defaultSpaces(spaces), value);
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
export function
|
|
55
|
-
return
|
|
59
|
+
export function ARCtrl_Process_ProcessParameterValue__ProcessParameterValue_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
|
|
60
|
+
return ARCtrl_Process_ProcessParameterValue__ProcessParameterValue_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
export function ARCtrl_Process_ProcessParameterValue__ProcessParameterValue_fromROCrateJsonString_Static_Z721C83C5(s) {
|
|
@@ -3,6 +3,7 @@ import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Deco
|
|
|
3
3
|
import { list as list_1 } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
|
|
4
4
|
import { Process_ROCrate_encoder, Process_ROCrate_decoder, Process_ISAJson_encoder, Process_ISAJson_decoder } from "./Process.js";
|
|
5
5
|
import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
|
|
6
|
+
import { defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
|
|
6
7
|
import { list as list_2 } from "../../fable_modules/Thoth.Json.Core.0.2.1/Encode.fs.js";
|
|
7
8
|
import { map } from "../../fable_modules/fable-library-js.4.16.0/List.js";
|
|
8
9
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
@@ -27,9 +28,10 @@ export function ProcessSequence_fromISAJsonString_Z721C83C5(s) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
export function
|
|
31
|
+
export function ProcessSequence_toISAJsonString_Z3B036AA(spaces, useIDReferencing) {
|
|
32
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
31
33
|
return (f) => {
|
|
32
|
-
const value = list_2(map(Process_ISAJson_encoder, f));
|
|
34
|
+
const value = list_2(map((oa) => Process_ISAJson_encoder(void 0, void 0, idMap, oa), f));
|
|
33
35
|
return toString(defaultSpaces(spaces), value);
|
|
34
36
|
};
|
|
35
37
|
}
|
|
@@ -11,12 +11,37 @@ import { Value } from "../../Core/Process/Value.js";
|
|
|
11
11
|
|
|
12
12
|
export function genID(p) {
|
|
13
13
|
const matchValue = p.GetCategory();
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const matchValue_1 = p.GetValue();
|
|
15
|
+
const matchValue_2 = p.GetUnit();
|
|
16
|
+
let matchResult, t, u, v, t_1, v_1;
|
|
17
|
+
if (matchValue != null) {
|
|
18
|
+
if (matchValue_1 != null) {
|
|
19
|
+
if (matchValue_2 == null) {
|
|
20
|
+
matchResult = 1;
|
|
21
|
+
t_1 = matchValue;
|
|
22
|
+
v_1 = matchValue_1;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
matchResult = 0;
|
|
26
|
+
t = matchValue;
|
|
27
|
+
u = matchValue_2;
|
|
28
|
+
v = matchValue_1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
matchResult = 2;
|
|
33
|
+
}
|
|
16
34
|
}
|
|
17
35
|
else {
|
|
18
|
-
|
|
19
|
-
|
|
36
|
+
matchResult = 2;
|
|
37
|
+
}
|
|
38
|
+
switch (matchResult) {
|
|
39
|
+
case 0:
|
|
40
|
+
return `#${p.GetAdditionalType()}/${t.NameText}=${v.Text}${u.NameText}`;
|
|
41
|
+
case 1:
|
|
42
|
+
return `#${p.GetAdditionalType()}/${t_1.NameText}=${v_1.Text}`;
|
|
43
|
+
default:
|
|
44
|
+
return `#Empty${p.GetAdditionalType()}`;
|
|
20
45
|
}
|
|
21
46
|
}
|
|
22
47
|
|
package/Json/Process/Protocol.js
CHANGED
|
@@ -14,65 +14,86 @@ import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/
|
|
|
14
14
|
import { Decode_uri } from "../Decode.js";
|
|
15
15
|
import { Protocol } from "../../Core/Process/Protocol.js";
|
|
16
16
|
import { ProtocolParameter_ISAJson_decoder, ProtocolParameter_ISAJson_encoder } from "./ProtocolParameter.js";
|
|
17
|
+
import { encode } from "../IDTable.js";
|
|
17
18
|
import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
|
|
18
19
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
|
|
19
20
|
|
|
20
21
|
export function Protocol_ROCrate_genID(studyName, assayName, processName, p) {
|
|
21
|
-
const matchValue = p.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const matchValue = p.ID;
|
|
23
|
+
let matchResult, id_1;
|
|
24
|
+
if (matchValue != null) {
|
|
25
|
+
if (matchValue !== "") {
|
|
26
|
+
matchResult = 0;
|
|
27
|
+
id_1 = matchValue;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
matchResult = 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
matchResult = 1;
|
|
35
|
+
}
|
|
36
|
+
switch (matchResult) {
|
|
37
|
+
case 0:
|
|
38
|
+
return id_1;
|
|
39
|
+
default: {
|
|
40
|
+
const matchValue_1 = p.Uri;
|
|
41
|
+
if (matchValue_1 == null) {
|
|
42
|
+
const matchValue_2 = p.Name;
|
|
43
|
+
if (matchValue_2 == null) {
|
|
44
|
+
let matchResult_1, an, pn, sn, pn_1, sn_1, pn_2;
|
|
45
|
+
if (studyName == null) {
|
|
46
|
+
if (assayName == null) {
|
|
47
|
+
if (processName != null) {
|
|
48
|
+
matchResult_1 = 2;
|
|
49
|
+
pn_2 = processName;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
matchResult_1 = 3;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
matchResult_1 = 3;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (assayName == null) {
|
|
60
|
+
if (processName != null) {
|
|
61
|
+
matchResult_1 = 1;
|
|
62
|
+
pn_1 = processName;
|
|
63
|
+
sn_1 = studyName;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
matchResult_1 = 3;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (processName != null) {
|
|
70
|
+
matchResult_1 = 0;
|
|
71
|
+
an = assayName;
|
|
72
|
+
pn = processName;
|
|
73
|
+
sn = studyName;
|
|
31
74
|
}
|
|
32
75
|
else {
|
|
33
|
-
|
|
76
|
+
matchResult_1 = 3;
|
|
77
|
+
}
|
|
78
|
+
switch (matchResult_1) {
|
|
79
|
+
case 0:
|
|
80
|
+
return (((("#Protocol_" + replace(sn, " ", "_")) + "_") + replace(an, " ", "_")) + "_") + replace(pn, " ", "_");
|
|
81
|
+
case 1:
|
|
82
|
+
return (("#Protocol_" + replace(sn_1, " ", "_")) + "_") + replace(pn_1, " ", "_");
|
|
83
|
+
case 2:
|
|
84
|
+
return "#Protocol_" + replace(pn_2, " ", "_");
|
|
85
|
+
default:
|
|
86
|
+
return "#EmptyProtocol";
|
|
34
87
|
}
|
|
35
88
|
}
|
|
36
89
|
else {
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else if (assayName == null) {
|
|
41
|
-
if (processName != null) {
|
|
42
|
-
matchResult = 1;
|
|
43
|
-
pn_1 = processName;
|
|
44
|
-
sn_1 = studyName;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
matchResult = 3;
|
|
90
|
+
return "#Protocol_" + replace(matchValue_2, " ", "_");
|
|
48
91
|
}
|
|
49
92
|
}
|
|
50
|
-
else if (processName != null) {
|
|
51
|
-
matchResult = 0;
|
|
52
|
-
an = assayName;
|
|
53
|
-
pn = processName;
|
|
54
|
-
sn = studyName;
|
|
55
|
-
}
|
|
56
93
|
else {
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
switch (matchResult) {
|
|
60
|
-
case 0:
|
|
61
|
-
return (((("#Protocol_" + replace(sn, " ", "_")) + "_") + replace(an, " ", "_")) + "_") + replace(pn, " ", "_");
|
|
62
|
-
case 1:
|
|
63
|
-
return (("#Protocol_" + replace(sn_1, " ", "_")) + "_") + replace(pn_1, " ", "_");
|
|
64
|
-
case 2:
|
|
65
|
-
return "#Protocol_" + replace(pn_2, " ", "_");
|
|
66
|
-
default:
|
|
67
|
-
return "#EmptyProtocol";
|
|
94
|
+
return matchValue_1;
|
|
68
95
|
}
|
|
69
96
|
}
|
|
70
|
-
else {
|
|
71
|
-
return "#Protocol_" + replace(matchValue_1, " ", "_");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
return matchValue;
|
|
76
97
|
}
|
|
77
98
|
}
|
|
78
99
|
|
|
@@ -94,8 +115,8 @@ export const Protocol_ROCrate_decoder = object((get$) => {
|
|
|
94
115
|
return new Protocol((objectArg_3 = get$.Optional, objectArg_3.Field("@id", Decode_uri)), (objectArg_4 = get$.Optional, objectArg_4.Field("name", string)), (objectArg_5 = get$.Optional, objectArg_5.Field("protocolType", OntologyAnnotation_ROCrate_decoderDefinedTerm)), (objectArg_6 = get$.Optional, objectArg_6.Field("description", string)), (objectArg_7 = get$.Optional, objectArg_7.Field("uri", Decode_uri)), (objectArg_8 = get$.Optional, objectArg_8.Field("version", string)), void 0, components, (arg_19 = list_5(Comment_ROCrate_decoder), (objectArg_9 = get$.Optional, objectArg_9.Field("comments", arg_19))));
|
|
95
116
|
});
|
|
96
117
|
|
|
97
|
-
export function Protocol_ISAJson_encoder(oa) {
|
|
98
|
-
|
|
118
|
+
export function Protocol_ISAJson_encoder(studyName, assayName, processName, idMap, oa) {
|
|
119
|
+
const f = (oa_1) => (new Json(5, [choose((tupledArg) => {
|
|
99
120
|
const v = tupledArg[1];
|
|
100
121
|
if (equals(v, new Json(3, []))) {
|
|
101
122
|
return void 0;
|
|
@@ -103,7 +124,13 @@ export function Protocol_ISAJson_encoder(oa) {
|
|
|
103
124
|
else {
|
|
104
125
|
return [tupledArg[0], v];
|
|
105
126
|
}
|
|
106
|
-
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])),
|
|
127
|
+
}, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), Protocol_ROCrate_genID(studyName, assayName, processName, oa_1)), tryInclude("name", (value_2) => (new Json(0, [value_2])), oa_1.Name), tryInclude("protocolType", (oa_2) => OntologyAnnotation_ISAJson_encoder(idMap, oa_2), oa_1.ProtocolType), tryInclude("description", (value_4) => (new Json(0, [value_4])), oa_1.Description), tryInclude("uri", (value_6) => (new Json(0, [value_6])), oa_1.Uri), tryInclude("version", (value_8) => (new Json(0, [value_8])), oa_1.Version), tryIncludeListOpt("parameters", (value_10) => ProtocolParameter_ISAJson_encoder(idMap, value_10), oa_1.Parameters), tryIncludeListOpt("components", (c) => Component_ISAJson_encoder(idMap, c), oa_1.Components), tryIncludeListOpt("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), oa_1.Comments)]))]));
|
|
128
|
+
if (idMap != null) {
|
|
129
|
+
return encode((p_1) => Protocol_ROCrate_genID(studyName, assayName, processName, p_1), f, oa, idMap);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return f(oa);
|
|
133
|
+
}
|
|
107
134
|
}
|
|
108
135
|
|
|
109
136
|
export const Protocol_ISAJson_decoder = object((get$) => {
|
|
@@ -121,15 +148,16 @@ export function ARCtrl_Process_Protocol__Protocol_fromISAJsonString_Static_Z721C
|
|
|
121
148
|
}
|
|
122
149
|
}
|
|
123
150
|
|
|
124
|
-
export function
|
|
151
|
+
export function ARCtrl_Process_Protocol__Protocol_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
|
|
152
|
+
const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
|
|
125
153
|
return (f) => {
|
|
126
|
-
const value = Protocol_ISAJson_encoder(f);
|
|
154
|
+
const value = Protocol_ISAJson_encoder(void 0, void 0, void 0, idMap, f);
|
|
127
155
|
return toString(defaultSpaces(spaces), value);
|
|
128
156
|
};
|
|
129
157
|
}
|
|
130
158
|
|
|
131
159
|
export function ARCtrl_Process_Protocol__Protocol_ToISAJsonString_71136F3F(this$, spaces) {
|
|
132
|
-
return
|
|
160
|
+
return ARCtrl_Process_Protocol__Protocol_toISAJsonString_Static_Z3B036AA(spaces)(this$);
|
|
133
161
|
}
|
|
134
162
|
|
|
135
163
|
export function ARCtrl_Process_Protocol__Protocol_fromROCrateString_Static_Z721C83C5(s) {
|