@nfdi4plants/arctrl 2.0.0-alpha.6 → 2.0.0-alpha.8

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.
Files changed (48) hide show
  1. package/Core/Data.js +53 -4
  2. package/Core/DataContext.js +92 -0
  3. package/Core/Helper/Regex.js +26 -10
  4. package/Core/Helper/Url.js +38 -0
  5. package/Core/OntologyAnnotation.js +2 -1
  6. package/Core/Table/ArcTableAux.js +2 -2
  7. package/Core/Table/CompositeCell.js +4 -0
  8. package/Core/Table/DataMap.js +95 -82
  9. package/Json/Assay.js +51 -22
  10. package/Json/Comment.js +35 -6
  11. package/Json/IDTable.js +19 -0
  12. package/Json/Investigation.js +22 -5
  13. package/Json/OntologyAnnotation.js +61 -6
  14. package/Json/OntologySourceReference.js +29 -7
  15. package/Json/Person.js +38 -16
  16. package/Json/Process/AssayMaterials.js +2 -2
  17. package/Json/Process/Component.js +19 -5
  18. package/Json/Process/Data.js +23 -7
  19. package/Json/Process/DataFile.js +9 -0
  20. package/Json/Process/Factor.js +33 -6
  21. package/Json/Process/FactorValue.js +23 -6
  22. package/Json/Process/Material.js +22 -5
  23. package/Json/Process/MaterialAttribute.js +30 -7
  24. package/Json/Process/MaterialAttributeValue.js +27 -6
  25. package/Json/Process/MaterialType.js +5 -0
  26. package/Json/Process/Process.js +22 -5
  27. package/Json/Process/ProcessInput.js +13 -7
  28. package/Json/Process/ProcessOutput.js +16 -6
  29. package/Json/Process/ProcessParameterValue.js +18 -4
  30. package/Json/Process/ProcessSequence.js +4 -2
  31. package/Json/Process/PropertyValue.js +29 -4
  32. package/Json/Process/Protocol.js +88 -52
  33. package/Json/Process/ProtocolParameter.js +28 -6
  34. package/Json/Process/Sample.js +23 -7
  35. package/Json/Process/Source.js +23 -6
  36. package/Json/Process/StudyMaterials.js +2 -2
  37. package/Json/Process/Value.js +3 -3
  38. package/Json/Publication.js +21 -8
  39. package/Json/Study.js +86 -56
  40. package/Json/Table/CellTable.js +4 -1
  41. package/Json/Table/Templates.js +10 -2
  42. package/Json.js +9 -9
  43. package/Spreadsheet/DataMapTable/DataMapColumn.js +36 -30
  44. package/Spreadsheet/DataMapTable/DataMapHeader.js +146 -122
  45. package/Spreadsheet/DataMapTable/DataMapTable.js +17 -12
  46. package/Template.Web.js +1 -1
  47. package/fable_modules/project_cracked.json +1 -1
  48. package/package.json +1 -1
package/Json/Assay.js CHANGED
@@ -13,17 +13,18 @@ import { Decode_objectNoAdditionalProperties, Decode_resizeArray } from "./Decod
13
13
  import { toFail, printf, toText, replace } from "../fable_modules/fable-library-js.4.16.0/String.js";
14
14
  import { Assay_tryIdentifierFromFileName, createMissingIdentifier, Assay_fileNameFromIdentifier } from "../Core/Helper/Identifier.js";
15
15
  import { JsonTypes_decomposeTechnologyPlatform, JsonTypes_composeTechnologyPlatform, ARCtrl_ArcTables__ArcTables_fromProcesses_Static_62A3309D, ARCtrl_ArcTables__ArcTables_GetProcesses } from "../Core/Conversion.js";
16
- import { getUnits, getCharacteristics, getData } from "../Core/Process/ProcessSequence.js";
16
+ import { getCharacteristics, getUnits, getData } from "../Core/Process/ProcessSequence.js";
17
17
  import { list as list_1 } from "../fable_modules/Thoth.Json.Core.0.2.1/Encode.fs.js";
18
18
  import { Data_ISAJson_encoder, Data_ROCrate_encoder } from "./Process/Data.js";
19
19
  import { Process_ISAJson_decoder, Process_ISAJson_encoder, Process_ROCrate_decoder, Process_ROCrate_encoder } from "./Process/Process.js";
20
20
  import { context_jsonvalue } from "./context/rocrate/isa_assay_context.js";
21
- import { encoder } from "./Process/AssayMaterials.js";
22
- import { Option_fromValueWithDefault } from "../Core/Helper/Collections.js";
23
21
  import { MaterialAttribute_ISAJson_encoder } from "./Process/MaterialAttribute.js";
22
+ import { encoder as encoder_3 } from "./Process/AssayMaterials.js";
23
+ import { Option_fromValueWithDefault } from "../Core/Helper/Collections.js";
24
+ import { encode } from "./IDTable.js";
24
25
  import { fromString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
25
26
  import { toString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
26
- import { encode, decode } from "./Table/Compression.js";
27
+ import { encode as encode_1, decode } from "./Table/Compression.js";
27
28
 
28
29
  export function Assay_encoder(assay) {
29
30
  return new Json(5, [choose((tupledArg) => {
@@ -97,21 +98,32 @@ export const Assay_ROCrate_decoder = object((get$) => {
97
98
  return new ArcAssay(identifier, unwrap((objectArg_2 = get$.Optional, objectArg_2.Field("measurementType", OntologyAnnotation_ROCrate_decoderPropertyValue))), unwrap((objectArg_3 = get$.Optional, objectArg_3.Field("technologyType", OntologyAnnotation_ROCrate_decoderDefinedTerm))), unwrap((objectArg_4 = get$.Optional, objectArg_4.Field("technologyPlatform", OntologyAnnotation_ROCrate_decoderDefinedTerm))), unwrap(tables), void 0, unwrap((arg_12 = Decode_resizeArray(Person_ROCrate_decoder), (objectArg_5 = get$.Optional, objectArg_5.Field("performers", arg_12)))), unwrap((arg_14 = Decode_resizeArray(Comment_ROCrate_decoder), (objectArg_6 = get$.Optional, objectArg_6.Field("comments", arg_14)))));
98
99
  });
99
100
 
100
- export function Assay_ISAJson_encoder(a) {
101
- const fileName = Assay_fileNameFromIdentifier(a.Identifier);
102
- const processes = ARCtrl_ArcTables__ArcTables_GetProcesses(a);
103
- const dataFiles = getData(processes);
104
- const characteristics = getCharacteristics(processes);
105
- const units = getUnits(processes);
106
- return new Json(5, [choose((tupledArg) => {
107
- const v = tupledArg[1];
108
- if (equals(v, new Json(3, []))) {
109
- return void 0;
110
- }
111
- else {
112
- return [tupledArg[0], v];
113
- }
114
- }, ofArray([["filename", new Json(0, [fileName])], tryInclude("measurementType", OntologyAnnotation_ISAJson_encoder, a.MeasurementType), tryInclude("technologyType", OntologyAnnotation_ISAJson_encoder, a.TechnologyType), tryInclude("technologyPlatform", (value_1) => (new Json(0, [value_1])), map(JsonTypes_composeTechnologyPlatform, a.TechnologyPlatform)), tryIncludeList("dataFiles", Data_ISAJson_encoder, dataFiles), tryInclude("materials", encoder, Option_fromValueWithDefault(empty(), processes)), tryIncludeList("characteristicCategories", MaterialAttribute_ISAJson_encoder, characteristics), tryIncludeList("unitCategories", OntologyAnnotation_ISAJson_encoder, units), tryIncludeList("processSequence", Process_ISAJson_encoder, processes), tryIncludeSeq("comments", Comment_ISAJson_encoder, a.Comments)]))]);
101
+ export function Assay_ISAJson_encoder(studyName, idMap, a) {
102
+ const f = (a_1) => {
103
+ let assayName;
104
+ const fileName = Assay_fileNameFromIdentifier(a_1.Identifier);
105
+ const processes = ARCtrl_ArcTables__ArcTables_GetProcesses(a_1);
106
+ const encodedUnits = tryIncludeList("unitCategories", (oa) => OntologyAnnotation_ISAJson_encoder(idMap, oa), getUnits(processes));
107
+ const encodedCharacteristics = tryIncludeList("characteristicCategories", (value_1) => MaterialAttribute_ISAJson_encoder(idMap, value_1), getCharacteristics(processes));
108
+ const encodedMaterials = tryInclude("materials", (ps) => encoder_3(idMap, ps), Option_fromValueWithDefault(empty(), processes));
109
+ const encocedDataFiles = tryIncludeList("dataFiles", (oa_1) => Data_ISAJson_encoder(idMap, oa_1), getData(processes));
110
+ const units = getUnits(processes);
111
+ return new Json(5, [choose((tupledArg) => {
112
+ const v = tupledArg[1];
113
+ if (equals(v, new Json(3, []))) {
114
+ return void 0;
115
+ }
116
+ else {
117
+ return [tupledArg[0], v];
118
+ }
119
+ }, ofArray([["filename", new Json(0, [fileName])], tryInclude("@id", (value_5) => (new Json(0, [value_5])), Assay_ROCrate_genID(a_1)), tryInclude("measurementType", (oa_2) => OntologyAnnotation_ISAJson_encoder(idMap, oa_2), a_1.MeasurementType), tryInclude("technologyType", (oa_3) => OntologyAnnotation_ISAJson_encoder(idMap, oa_3), a_1.TechnologyType), tryInclude("technologyPlatform", (value_7) => (new Json(0, [value_7])), map(JsonTypes_composeTechnologyPlatform, a_1.TechnologyPlatform)), encocedDataFiles, encodedMaterials, encodedCharacteristics, encodedUnits, tryIncludeList("processSequence", (assayName = a_1.Identifier, (oa_4) => Process_ISAJson_encoder(studyName, assayName, idMap, oa_4)), processes), tryIncludeSeq("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), a_1.Comments)]))]);
120
+ };
121
+ if (idMap != null) {
122
+ return encode(Assay_ROCrate_genID, f, a, idMap);
123
+ }
124
+ else {
125
+ return f(a);
126
+ }
115
127
  }
116
128
 
117
129
  export const Assay_ISAJson_allowedFields = ofArray(["@id", "filename", "measurementType", "technologyType", "technologyPlatform", "dataFiles", "materials", "characteristicCategories", "unitCategories", "processSequence", "comments", "@type", "@context"]);
@@ -143,6 +155,10 @@ export function ARCtrl_ArcAssay__ArcAssay_toJsonString_Static_71136F3F(spaces) {
143
155
  };
144
156
  }
145
157
 
158
+ export function ARCtrl_ArcAssay__ArcAssay_ToJsonString_71136F3F(this$, spaces) {
159
+ return ARCtrl_ArcAssay__ArcAssay_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
160
+ }
161
+
146
162
  export function ARCtrl_ArcAssay__ArcAssay_fromCompressedJsonString_Static_Z721C83C5(s) {
147
163
  try {
148
164
  const matchValue = fromString(decode(Assay_decoderCompressed), s);
@@ -160,7 +176,11 @@ export function ARCtrl_ArcAssay__ArcAssay_fromCompressedJsonString_Static_Z721C8
160
176
  }
161
177
 
162
178
  export function ARCtrl_ArcAssay__ArcAssay_toCompressedJsonString_Static_71136F3F(spaces) {
163
- return (obj) => toString(defaultArg(spaces, 0), encode(Assay_encoderCompressed, obj));
179
+ return (obj) => toString(defaultArg(spaces, 0), encode_1(Assay_encoderCompressed, obj));
180
+ }
181
+
182
+ export function ARCtrl_ArcAssay__ArcAssay_ToCompressedJsonString_71136F3F(this$, spaces) {
183
+ return ARCtrl_ArcAssay__ArcAssay_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(this$);
164
184
  }
165
185
 
166
186
  export function ARCtrl_ArcAssay__ArcAssay_fromROCrateJsonString_Static_Z721C83C5(s) {
@@ -183,9 +203,14 @@ export function ARCtrl_ArcAssay__ArcAssay_toROCrateJsonString_Static_5CABCA47(st
183
203
  };
184
204
  }
185
205
 
186
- export function ARCtrl_ArcAssay__ArcAssay_toISAJsonString_Static_71136F3F(spaces) {
206
+ export function ARCtrl_ArcAssay__ArcAssay_ToROCrateJsonString_5CABCA47(this$, studyName, spaces) {
207
+ return ARCtrl_ArcAssay__ArcAssay_toROCrateJsonString_Static_5CABCA47(unwrap(studyName), unwrap(spaces))(this$);
208
+ }
209
+
210
+ export function ARCtrl_ArcAssay__ArcAssay_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
211
+ const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
187
212
  return (obj) => {
188
- const value = Assay_ISAJson_encoder(obj);
213
+ const value = Assay_ISAJson_encoder(void 0, idMap, obj);
189
214
  return toString(defaultSpaces(spaces), value);
190
215
  };
191
216
  }
@@ -200,3 +225,7 @@ export function ARCtrl_ArcAssay__ArcAssay_fromISAJsonString_Static_Z721C83C5(s)
200
225
  }
201
226
  }
202
227
 
228
+ export function ARCtrl_ArcAssay__ArcAssay_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
229
+ return ARCtrl_ArcAssay__ArcAssay_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
230
+ }
231
+
package/Json/Comment.js CHANGED
@@ -9,6 +9,7 @@ import { printf, toText, replace } from "../fable_modules/fable-library-js.4.16.
9
9
  import { context_jsonvalue } from "./context/rocrate/isa_comment_context.js";
10
10
  import { toString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
11
11
  import { fromString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
12
+ import { encode } from "./IDTable.js";
12
13
 
13
14
  export function Comment_encoder(comment) {
14
15
  return new Json(5, [choose((tupledArg) => {
@@ -70,7 +71,23 @@ export const Comment_ROCrate_decoderDisambiguatingDescription = map((s) => {
70
71
  }
71
72
  }, string);
72
73
 
73
- export const Comment_ISAJson_encoder = Comment_encoder;
74
+ export function Comment_ISAJson_encoder(idMap, comment) {
75
+ const f = (comment_1) => (new Json(5, [choose((tupledArg) => {
76
+ const v = tupledArg[1];
77
+ if (equals(v, new Json(3, []))) {
78
+ return void 0;
79
+ }
80
+ else {
81
+ return [tupledArg[0], v];
82
+ }
83
+ }, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), Comment_ROCrate_genID(comment_1)), tryInclude("name", (value_2) => (new Json(0, [value_2])), comment_1.Name), tryInclude("value", (value_4) => (new Json(0, [value_4])), comment_1.Value)]))]));
84
+ if (idMap == null) {
85
+ return f(comment);
86
+ }
87
+ else {
88
+ return encode(Comment_ROCrate_genID, f, comment, idMap);
89
+ }
90
+ }
74
91
 
75
92
  export const Comment_ISAJson_decoder = Comment_decoder;
76
93
 
@@ -91,6 +108,10 @@ export function ARCtrl_Comment__Comment_toJsonString_Static_71136F3F(spaces) {
91
108
  };
92
109
  }
93
110
 
111
+ export function ARCtrl_Comment__Comment_toJsonString_71136F3F(this$, spaces) {
112
+ return ARCtrl_Comment__Comment_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
113
+ }
114
+
94
115
  export function ARCtrl_Comment__Comment_fromROCrateJsonString_Static_Z721C83C5(s) {
95
116
  const matchValue = fromString(Comment_ROCrate_decoder, s);
96
117
  if (matchValue.tag === 1) {
@@ -111,11 +132,8 @@ export function ARCtrl_Comment__Comment_toROCrateJsonString_Static_71136F3F(spac
111
132
  };
112
133
  }
113
134
 
114
- export function ARCtrl_Comment__Comment_toISAJsonString_Static_71136F3F(spaces) {
115
- return (c) => {
116
- const value = Comment_ISAJson_encoder(c);
117
- return toString(defaultSpaces(spaces), value);
118
- };
135
+ export function ARCtrl_Comment__Comment_toROCrateJsonString_71136F3F(this$, spaces) {
136
+ return ARCtrl_Comment__Comment_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
119
137
  }
120
138
 
121
139
  export function ARCtrl_Comment__Comment_fromISAJsonString_Static_Z721C83C5(s) {
@@ -128,3 +146,14 @@ export function ARCtrl_Comment__Comment_fromISAJsonString_Static_Z721C83C5(s) {
128
146
  }
129
147
  }
130
148
 
149
+ export function ARCtrl_Comment__Comment_toISAJsonString_Static_71136F3F(spaces) {
150
+ return (c) => {
151
+ const value = Comment_ISAJson_encoder(void 0, c);
152
+ return toString(defaultSpaces(spaces), value);
153
+ };
154
+ }
155
+
156
+ export function ARCtrl_Comment__Comment_toISAJsonString_71136F3F(this$, spaces) {
157
+ return ARCtrl_Comment__Comment_toISAJsonString_Static_71136F3F(unwrap(spaces))(this$);
158
+ }
159
+
@@ -0,0 +1,19 @@
1
+ import { Json } from "../fable_modules/Thoth.Json.Core.0.2.1/Types.fs.js";
2
+ import { addToDict } from "../fable_modules/fable-library-js.4.16.0/MapUtil.js";
3
+
4
+ export function encodeID(id) {
5
+ return new Json(5, [[["@id", new Json(0, [id])]]]);
6
+ }
7
+
8
+ export function encode(genID, encoder, value, table) {
9
+ const id = genID(value);
10
+ if (table.has(id)) {
11
+ return encodeID(id);
12
+ }
13
+ else {
14
+ const v = encoder(value);
15
+ addToDict(table, genID(value), v);
16
+ return v;
17
+ }
18
+ }
19
+
@@ -13,7 +13,7 @@ import { ArcInvestigation } from "../Core/ArcTypes.js";
13
13
  import { Decode_objectNoAdditionalProperties, Decode_resizeArray } from "./Decode.js";
14
14
  import { context_jsonvalue } from "./context/rocrate/isa_investigation_context.js";
15
15
  import { createMissingIdentifier } from "../Core/Helper/Identifier.js";
16
- import { defaultArg } from "../fable_modules/fable-library-js.4.16.0/Option.js";
16
+ import { unwrap, defaultArg } from "../fable_modules/fable-library-js.4.16.0/Option.js";
17
17
  import { distinctBy } from "../fable_modules/fable-library-js.4.16.0/Seq2.js";
18
18
  import { map, concat } from "../fable_modules/fable-library-js.4.16.0/Seq.js";
19
19
  import { context_jsonvalue as context_jsonvalue_1, conformsTo_jsonvalue } from "./context/rocrate/rocrate_context.js";
@@ -110,7 +110,7 @@ export function Investigation_ROCrate_encodeRoCrate(oa) {
110
110
 
111
111
  export const Investigation_ISAJson_allowedFields = ofArray(["@id", "filename", "identifier", "title", "description", "submissionDate", "publicReleaseDate", "ontologySourceReferences", "publications", "people", "studies", "comments", "@type", "@context"]);
112
112
 
113
- export function Investigation_ISAJson_encoder(inv) {
113
+ export function Investigation_ISAJson_encoder(idMap, inv) {
114
114
  return new Json(5, [choose((tupledArg) => {
115
115
  const v = tupledArg[1];
116
116
  if (equals(v, new Json(3, []))) {
@@ -119,7 +119,7 @@ export function Investigation_ISAJson_encoder(inv) {
119
119
  else {
120
120
  return [tupledArg[0], v];
121
121
  }
122
- }, ofArray([["filename", new Json(0, [ArcInvestigation.FileName])], ["identifier", new Json(0, [inv.Identifier])], tryInclude("title", (value_2) => (new Json(0, [value_2])), inv.Title), tryInclude("description", (value_4) => (new Json(0, [value_4])), inv.Description), tryInclude("submissionDate", (value_6) => (new Json(0, [value_6])), inv.SubmissionDate), tryInclude("publicReleaseDate", (value_8) => (new Json(0, [value_8])), inv.PublicReleaseDate), tryIncludeSeq("ontologySourceReferences", OntologySourceReference_ISAJson_encoder, inv.OntologySourceReferences), tryIncludeSeq("publications", Publication_ISAJson_encoder, inv.Publications), tryIncludeSeq("people", Person_ISAJson_encoder, inv.Contacts), tryIncludeSeq("studies", (s) => Study_ISAJson_encoder(void 0, s), inv.Studies), tryIncludeSeq("comments", Comment_ISAJson_encoder, inv.Comments)]))]);
122
+ }, ofArray([["@id", new Json(0, [Investigation_ROCrate_genID(inv)])], ["filename", new Json(0, [ArcInvestigation.FileName])], ["identifier", new Json(0, [inv.Identifier])], tryInclude("title", (value_3) => (new Json(0, [value_3])), inv.Title), tryInclude("description", (value_5) => (new Json(0, [value_5])), inv.Description), tryInclude("submissionDate", (value_7) => (new Json(0, [value_7])), inv.SubmissionDate), tryInclude("publicReleaseDate", (value_9) => (new Json(0, [value_9])), inv.PublicReleaseDate), tryIncludeSeq("ontologySourceReferences", (osr) => OntologySourceReference_ISAJson_encoder(idMap, osr), inv.OntologySourceReferences), tryIncludeSeq("publications", (oa) => Publication_ISAJson_encoder(idMap, oa), inv.Publications), tryIncludeSeq("people", (person) => Person_ISAJson_encoder(idMap, person), inv.Contacts), tryIncludeSeq("studies", (s) => Study_ISAJson_encoder(idMap, void 0, s), inv.Studies), tryIncludeSeq("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), inv.Comments)]))]);
123
123
  }
124
124
 
125
125
  export const Investigation_ISAJson_decoder = Decode_objectNoAdditionalProperties(Investigation_ISAJson_allowedFields, (get$) => {
@@ -161,6 +161,10 @@ export function ARCtrl_ArcInvestigation__ArcInvestigation_toJsonString_Static_71
161
161
  };
162
162
  }
163
163
 
164
+ export function ARCtrl_ArcInvestigation__ArcInvestigation_ToJsonString_71136F3F(this$, spaces) {
165
+ return ARCtrl_ArcInvestigation__ArcInvestigation_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
166
+ }
167
+
164
168
  export function ARCtrl_ArcInvestigation__ArcInvestigation_fromCompressedJsonString_Static_Z721C83C5(s) {
165
169
  try {
166
170
  const matchValue = fromString(decode(Investigation_decoderCompressed), s);
@@ -181,6 +185,10 @@ export function ARCtrl_ArcInvestigation__ArcInvestigation_toCompressedJsonString
181
185
  return (obj) => toString(defaultArg(spaces, 0), encode(Investigation_encoderCompressed, obj));
182
186
  }
183
187
 
188
+ export function ARCtrl_ArcInvestigation__ArcInvestigation_ToCompressedJsonString_71136F3F(this$, spaces) {
189
+ return ARCtrl_ArcInvestigation__ArcInvestigation_toCompressedJsonString_Static_71136F3F(unwrap(spaces))(this$);
190
+ }
191
+
184
192
  export function ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateJsonString_Static_Z721C83C5(s) {
185
193
  const matchValue = fromString(Investigation_ROCrate_decoder, s);
186
194
  if (matchValue.tag === 1) {
@@ -201,9 +209,14 @@ export function ARCtrl_ArcInvestigation__ArcInvestigation_toROCrateJsonString_St
201
209
  };
202
210
  }
203
211
 
204
- export function ARCtrl_ArcInvestigation__ArcInvestigation_toISAJsonString_Static_71136F3F(spaces) {
212
+ export function ARCtrl_ArcInvestigation__ArcInvestigation_ToROCrateJsonString_71136F3F(this$, spaces) {
213
+ return ARCtrl_ArcInvestigation__ArcInvestigation_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
214
+ }
215
+
216
+ export function ARCtrl_ArcInvestigation__ArcInvestigation_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
217
+ const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
205
218
  return (obj) => {
206
- const value = Investigation_ISAJson_encoder(obj);
219
+ const value = Investigation_ISAJson_encoder(idMap, obj);
207
220
  return toString(defaultSpaces(spaces), value);
208
221
  };
209
222
  }
@@ -218,3 +231,7 @@ export function ARCtrl_ArcInvestigation__ArcInvestigation_fromISAJsonString_Stat
218
231
  }
219
232
  }
220
233
 
234
+ export function ARCtrl_ArcInvestigation__ArcInvestigation_ToISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
235
+ return ARCtrl_ArcInvestigation__ArcInvestigation_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
236
+ }
237
+
@@ -12,6 +12,9 @@ import { printf, toText, replace } from "../fable_modules/fable-library-js.4.16.
12
12
  import { URIModule_toString } from "../Core/URI.js";
13
13
  import { context_jsonvalue } from "./context/rocrate/isa_ontology_annotation_context.js";
14
14
  import { context_jsonvalue as context_jsonvalue_1 } from "./context/rocrate/property_value_context.js";
15
+ import { filter } from "../fable_modules/fable-library-js.4.16.0/Seq.js";
16
+ import { orderName } from "../Core/Process/ColumnIndex.js";
17
+ import { encode } from "./IDTable.js";
15
18
  import { fromString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
16
19
  import { toString } from "../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
17
20
 
@@ -109,7 +112,47 @@ export const OntologyAnnotation_ROCrate_decoderPropertyValue = object((get$) =>
109
112
  return OntologyAnnotation.create(unwrap((objectArg = get$.Optional, objectArg.Field("category", string))), void 0, unwrap((objectArg_1 = get$.Optional, objectArg_1.Field("categoryCode", string))), unwrap((arg_5 = Decode_resizeArray(Comment_ROCrate_decoderDisambiguatingDescription), (objectArg_2 = get$.Optional, objectArg_2.Field("comments", arg_5)))));
110
113
  });
111
114
 
112
- export const OntologyAnnotation_ISAJson_encoder = OntologyAnnotation_encoder;
115
+ export function OntologyAnnotation_ISAJson_encoder(idMap, oa) {
116
+ const f = (oa_1) => {
117
+ const comments = filter((c) => {
118
+ const matchValue = c.Name;
119
+ let matchResult, n_1;
120
+ if (matchValue != null) {
121
+ if (matchValue === orderName) {
122
+ matchResult = 0;
123
+ n_1 = matchValue;
124
+ }
125
+ else {
126
+ matchResult = 1;
127
+ }
128
+ }
129
+ else {
130
+ matchResult = 1;
131
+ }
132
+ switch (matchResult) {
133
+ case 0:
134
+ return false;
135
+ default:
136
+ return true;
137
+ }
138
+ }, oa_1.Comments);
139
+ return new Json(5, [choose((tupledArg) => {
140
+ const v = tupledArg[1];
141
+ if (equals(v, new Json(3, []))) {
142
+ return void 0;
143
+ }
144
+ else {
145
+ return [tupledArg[0], v];
146
+ }
147
+ }, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), OntologyAnnotation_ROCrate_genID(oa_1)), tryInclude("annotationValue", (value_2) => (new Json(0, [value_2])), oa_1.Name), tryInclude("termSource", (value_4) => (new Json(0, [value_4])), oa_1.TermSourceREF), tryInclude("termAccession", (value_6) => (new Json(0, [value_6])), oa_1.TermAccessionNumber), tryIncludeSeq("comments", Comment_encoder, comments)]))]);
148
+ };
149
+ if (idMap != null) {
150
+ return encode(OntologyAnnotation_ROCrate_genID, f, oa, idMap);
151
+ }
152
+ else {
153
+ return f(oa);
154
+ }
155
+ }
113
156
 
114
157
  export const OntologyAnnotation_ISAJson_decoder = OntologyAnnotation_decoder;
115
158
 
@@ -130,6 +173,10 @@ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_toJsonString_Stati
130
173
  };
131
174
  }
132
175
 
176
+ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_ToJsonString_71136F3F(this$, spaces) {
177
+ return ARCtrl_OntologyAnnotation__OntologyAnnotation_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
178
+ }
179
+
133
180
  export function ARCtrl_OntologyAnnotation__OntologyAnnotation_fromROCrateJsonString_Static_Z721C83C5(s) {
134
181
  const matchValue = fromString(OntologyAnnotation_ROCrate_decoderDefinedTerm, s);
135
182
  if (matchValue.tag === 1) {
@@ -150,11 +197,8 @@ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_toROCrateJsonStrin
150
197
  };
151
198
  }
152
199
 
153
- export function ARCtrl_OntologyAnnotation__OntologyAnnotation_toISAJsonString_Static_71136F3F(spaces) {
154
- return (obj) => {
155
- const value = OntologyAnnotation_ISAJson_encoder(obj);
156
- return toString(defaultSpaces(spaces), value);
157
- };
200
+ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_ToROCrateJsonString_71136F3F(this$, spaces) {
201
+ return ARCtrl_OntologyAnnotation__OntologyAnnotation_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
158
202
  }
159
203
 
160
204
  export function ARCtrl_OntologyAnnotation__OntologyAnnotation_fromISAJsonString_Static_Z721C83C5(s) {
@@ -167,3 +211,14 @@ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_fromISAJsonString_
167
211
  }
168
212
  }
169
213
 
214
+ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_toISAJsonString_Static_71136F3F(spaces) {
215
+ return (obj) => {
216
+ const value = OntologyAnnotation_ISAJson_encoder(void 0, obj);
217
+ return toString(defaultSpaces(spaces), value);
218
+ };
219
+ }
220
+
221
+ export function ARCtrl_OntologyAnnotation__OntologyAnnotation_ToISAJsonString_71136F3F(this$, spaces) {
222
+ return ARCtrl_OntologyAnnotation__OntologyAnnotation_toISAJsonString_Static_71136F3F(unwrap(spaces))(this$);
223
+ }
224
+
@@ -2,7 +2,7 @@ import { ofArray, choose } from "../fable_modules/fable-library-js.4.16.0/List.j
2
2
  import { equals } from "../fable_modules/fable-library-js.4.16.0/Util.js";
3
3
  import { Json } from "../fable_modules/Thoth.Json.Core.0.2.1/Types.fs.js";
4
4
  import { defaultSpaces, tryIncludeSeq, tryInclude } from "./Encode.js";
5
- import { Comment_decoder, Comment_encoder } from "./Comment.js";
5
+ import { Comment_ISAJson_encoder, Comment_decoder, Comment_encoder } from "./Comment.js";
6
6
  import { string, object } from "../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
7
7
  import { OntologySourceReference } from "../Core/OntologySourceReference.js";
8
8
  import { unwrap } from "../fable_modules/fable-library-js.4.16.0/Option.js";
@@ -62,7 +62,17 @@ export const OntologySourceReference_ROCrate_decoder = object((get$) => {
62
62
  return new OntologySourceReference(unwrap((objectArg = get$.Optional, objectArg.Field("description", Decode_uri))), unwrap((objectArg_1 = get$.Optional, objectArg_1.Field("file", string))), unwrap((objectArg_2 = get$.Optional, objectArg_2.Field("name", string))), unwrap((objectArg_3 = get$.Optional, objectArg_3.Field("version", string))), unwrap((arg_9 = Decode_resizeArray(Comment_decoder), (objectArg_4 = get$.Optional, objectArg_4.Field("comments", arg_9)))));
63
63
  });
64
64
 
65
- export const OntologySourceReference_ISAJson_encoder = OntologySourceReference_encoder;
65
+ export function OntologySourceReference_ISAJson_encoder(idMap, osr) {
66
+ return new Json(5, [choose((tupledArg) => {
67
+ const v = tupledArg[1];
68
+ if (equals(v, new Json(3, []))) {
69
+ return void 0;
70
+ }
71
+ else {
72
+ return [tupledArg[0], v];
73
+ }
74
+ }, ofArray([tryInclude("description", (value) => (new Json(0, [value])), osr.Description), tryInclude("file", (value_2) => (new Json(0, [value_2])), osr.File), tryInclude("name", (value_4) => (new Json(0, [value_4])), osr.Name), tryInclude("version", (value_6) => (new Json(0, [value_6])), osr.Version), tryIncludeSeq("comments", (comment) => Comment_ISAJson_encoder(idMap, comment), osr.Comments)]))]);
75
+ }
66
76
 
67
77
  export const OntologySourceReference_ISAJson_decoder = OntologySourceReference_decoder;
68
78
 
@@ -83,6 +93,10 @@ export function ARCtrl_OntologySourceReference__OntologySourceReference_toJsonSt
83
93
  };
84
94
  }
85
95
 
96
+ export function ARCtrl_OntologySourceReference__OntologySourceReference_ToJsonString_71136F3F(this$, spaces) {
97
+ return ARCtrl_OntologySourceReference__OntologySourceReference_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
98
+ }
99
+
86
100
  export function ARCtrl_OntologySourceReference__OntologySourceReference_fromROCrateJsonString_Static_Z721C83C5(s) {
87
101
  const matchValue = fromString(OntologySourceReference_ROCrate_decoder, s);
88
102
  if (matchValue.tag === 1) {
@@ -103,11 +117,8 @@ export function ARCtrl_OntologySourceReference__OntologySourceReference_toROCrat
103
117
  };
104
118
  }
105
119
 
106
- export function ARCtrl_OntologySourceReference__OntologySourceReference_toISAJsonString_Static_71136F3F(spaces) {
107
- return (obj) => {
108
- const value = OntologySourceReference_ISAJson_encoder(obj);
109
- return toString(defaultSpaces(spaces), value);
110
- };
120
+ export function ARCtrl_OntologySourceReference__OntologySourceReference_ToROCrateJsonString_71136F3F(this$, spaces) {
121
+ return ARCtrl_OntologySourceReference__OntologySourceReference_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
111
122
  }
112
123
 
113
124
  export function ARCtrl_OntologySourceReference__OntologySourceReference_fromISAJsonString_Static_Z721C83C5(s) {
@@ -120,3 +131,14 @@ export function ARCtrl_OntologySourceReference__OntologySourceReference_fromISAJ
120
131
  }
121
132
  }
122
133
 
134
+ export function ARCtrl_OntologySourceReference__OntologySourceReference_toISAJsonString_Static_71136F3F(spaces) {
135
+ return (obj) => {
136
+ const value = OntologySourceReference_ISAJson_encoder(void 0, obj);
137
+ return toString(defaultSpaces(spaces), value);
138
+ };
139
+ }
140
+
141
+ export function ARCtrl_OntologySourceReference__OntologySourceReference_ToISAJsonString_71136F3F(this$, spaces) {
142
+ return ARCtrl_OntologySourceReference__OntologySourceReference_toISAJsonString_Static_71136F3F(unwrap(spaces))(this$);
143
+ }
144
+
package/Json/Person.js CHANGED
@@ -14,6 +14,7 @@ import { context_jsonvalue } from "./context/rocrate/isa_organization_context.js
14
14
  import { contextMinimal_jsonValue, context_jsonvalue as context_jsonvalue_1 } from "./context/rocrate/isa_person_context.js";
15
15
  import { map } from "../fable_modules/fable-library-js.4.16.0/Array.js";
16
16
  import { Person_setOrcidFromComments, Person_setCommentFromORCID } from "../Core/Conversion.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
 
@@ -176,17 +177,25 @@ export const Person_ROCrate_decodeAuthorListString = map_1((v) => join(", ", v),
176
177
 
177
178
  export const Person_ISAJson_allowedFields = ofArray(["@id", "firstName", "lastName", "midInitials", "email", "phone", "fax", "address", "affiliation", "roles", "comments", "@type", "@context"]);
178
179
 
179
- export function Person_ISAJson_encoder(person) {
180
- const person_1 = Person_setCommentFromORCID(person);
181
- return new Json(5, [choose((tupledArg) => {
182
- const v = tupledArg[1];
183
- if (equals(v, new Json(3, []))) {
184
- return void 0;
185
- }
186
- else {
187
- return [tupledArg[0], v];
188
- }
189
- }, ofArray([tryInclude("firstName", (value) => (new Json(0, [value])), person_1.FirstName), tryInclude("lastName", (value_2) => (new Json(0, [value_2])), person_1.LastName), tryInclude("midInitials", (value_4) => (new Json(0, [value_4])), person_1.MidInitials), tryInclude("email", (value_6) => (new Json(0, [value_6])), person_1.EMail), tryInclude("phone", (value_8) => (new Json(0, [value_8])), person_1.Phone), tryInclude("fax", (value_10) => (new Json(0, [value_10])), person_1.Fax), tryInclude("address", (value_12) => (new Json(0, [value_12])), person_1.Address), tryInclude("affiliation", (value_14) => (new Json(0, [value_14])), person_1.Affiliation), tryIncludeSeq("roles", OntologyAnnotation_encoder, person_1.Roles), tryIncludeSeq("comments", Comment_encoder, person_1.Comments)]))]);
180
+ export function Person_ISAJson_encoder(idMap, person) {
181
+ const f = (person_1) => {
182
+ const person_2 = Person_setCommentFromORCID(person_1);
183
+ return new Json(5, [choose((tupledArg) => {
184
+ const v = tupledArg[1];
185
+ if (equals(v, new Json(3, []))) {
186
+ return void 0;
187
+ }
188
+ else {
189
+ return [tupledArg[0], v];
190
+ }
191
+ }, ofArray([tryInclude("@id", (value) => (new Json(0, [value])), Person_ROCrate_genID(person_2)), tryInclude("firstName", (value_2) => (new Json(0, [value_2])), person_2.FirstName), tryInclude("lastName", (value_4) => (new Json(0, [value_4])), person_2.LastName), tryInclude("midInitials", (value_6) => (new Json(0, [value_6])), person_2.MidInitials), tryInclude("email", (value_8) => (new Json(0, [value_8])), person_2.EMail), tryInclude("phone", (value_10) => (new Json(0, [value_10])), person_2.Phone), tryInclude("fax", (value_12) => (new Json(0, [value_12])), person_2.Fax), tryInclude("address", (value_14) => (new Json(0, [value_14])), person_2.Address), tryInclude("affiliation", (value_16) => (new Json(0, [value_16])), person_2.Affiliation), tryIncludeSeq("roles", OntologyAnnotation_encoder, person_2.Roles), tryIncludeSeq("comments", Comment_encoder, person_2.Comments)]))]);
192
+ };
193
+ if (idMap != null) {
194
+ return encode(Person_ROCrate_genID, f, person, idMap);
195
+ }
196
+ else {
197
+ return f(person);
198
+ }
190
199
  }
191
200
 
192
201
  export const Person_ISAJson_decoder = Decode_objectNoAdditionalProperties(Person_ISAJson_allowedFields, (get$) => {
@@ -211,6 +220,10 @@ export function ARCtrl_Person__Person_toJsonString_Static_71136F3F(spaces) {
211
220
  };
212
221
  }
213
222
 
223
+ export function ARCtrl_Person__Person_toJsonString_71136F3F(this$, spaces) {
224
+ return ARCtrl_Person__Person_toJsonString_Static_71136F3F(unwrap(spaces))(this$);
225
+ }
226
+
214
227
  export function ARCtrl_Person__Person_fromROCrateJsonString_Static_Z721C83C5(s) {
215
228
  const matchValue = fromString(Person_ROCrate_decoder, s);
216
229
  if (matchValue.tag === 1) {
@@ -231,11 +244,8 @@ export function ARCtrl_Person__Person_toROCrateJsonString_Static_71136F3F(spaces
231
244
  };
232
245
  }
233
246
 
234
- export function ARCtrl_Person__Person_toISAJsonString_Static_71136F3F(spaces) {
235
- return (obj) => {
236
- const value = Person_ISAJson_encoder(obj);
237
- return toString(defaultSpaces(spaces), value);
238
- };
247
+ export function ARCtrl_Person__Person_toROCrateJsonString_71136F3F(this$, spaces) {
248
+ return ARCtrl_Person__Person_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
239
249
  }
240
250
 
241
251
  export function ARCtrl_Person__Person_fromISAJsonString_Static_Z721C83C5(s) {
@@ -248,3 +258,15 @@ export function ARCtrl_Person__Person_fromISAJsonString_Static_Z721C83C5(s) {
248
258
  }
249
259
  }
250
260
 
261
+ export function ARCtrl_Person__Person_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
262
+ const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
263
+ return (obj) => {
264
+ const value = Person_ISAJson_encoder(idMap, obj);
265
+ return toString(defaultSpaces(spaces), value);
266
+ };
267
+ }
268
+
269
+ export function ARCtrl_Person__Person_toISAJsonString_Z3B036AA(this$, spaces, useIDReferencing) {
270
+ return ARCtrl_Person__Person_toISAJsonString_Static_Z3B036AA(unwrap(spaces), unwrap(useIDReferencing))(this$);
271
+ }
272
+
@@ -6,7 +6,7 @@ import { tryIncludeList } from "../Encode.js";
6
6
  import { Sample_ISAJson_encoder } from "./Sample.js";
7
7
  import { Material_ISAJson_encoder } from "./Material.js";
8
8
 
9
- export function encoder(ps) {
9
+ export function encoder(idMap, ps) {
10
10
  const samples = getSamples(ps);
11
11
  const materials = getMaterials(ps);
12
12
  return new Json(5, [choose((tupledArg) => {
@@ -17,6 +17,6 @@ export function encoder(ps) {
17
17
  else {
18
18
  return [tupledArg[0], v];
19
19
  }
20
- }, ofArray([tryIncludeList("samples", Sample_ISAJson_encoder, samples), tryIncludeList("otherMaterials", Material_ISAJson_encoder, materials)]))]);
20
+ }, ofArray([tryIncludeList("samples", (oa) => Sample_ISAJson_encoder(idMap, oa), samples), tryIncludeList("otherMaterials", (c) => Material_ISAJson_encoder(idMap, c), materials)]))]);
21
21
  }
22
22
 
@@ -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 { Component, Component_decomposeName_Z721C83C5, Component__get_ComponentName, Component_createAsPV } from "../../Core/Process/Component.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";
@@ -9,13 +9,18 @@ import { object } from "../../fable_modules/Thoth.Json.Core.0.2.1/Decode.fs.js";
9
9
  import { Decode_uri } from "../Decode.js";
10
10
  import { fromString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Decode.fs.js";
11
11
  import { printf, toText } from "../../fable_modules/fable-library-js.4.16.0/String.js";
12
+ import { unwrap, defaultArg } from "../../fable_modules/fable-library-js.4.16.0/Option.js";
12
13
  import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.1.0/Encode.fs.js";
13
14
 
14
15
  export const Component_ROCrate_encoder = encoder;
15
16
 
16
17
  export const Component_ROCrate_decoder = decoder_1(Component_createAsPV);
17
18
 
18
- export function Component_ISAJson_encoder(c) {
19
+ export function Component_ISAJson_genID(c) {
20
+ return genID(c);
21
+ }
22
+
23
+ export function Component_ISAJson_encoder(idMap, c) {
19
24
  return new Json(5, [choose((tupledArg) => {
20
25
  const v = tupledArg[1];
21
26
  if (equals(v, new Json(3, []))) {
@@ -24,7 +29,7 @@ export function Component_ISAJson_encoder(c) {
24
29
  else {
25
30
  return [tupledArg[0], v];
26
31
  }
27
- }, ofArray([tryInclude("componentName", (value) => (new Json(0, [value])), Component__get_ComponentName(c)), tryInclude("componentType", OntologyAnnotation_ISAJson_encoder, c.ComponentType)]))]);
32
+ }, ofArray([tryInclude("componentName", (value) => (new Json(0, [value])), Component__get_ComponentName(c)), tryInclude("componentType", (oa) => OntologyAnnotation_ISAJson_encoder(idMap, oa), c.ComponentType)]))]);
28
33
  }
29
34
 
30
35
  export const Component_ISAJson_decoder = object((get$) => {
@@ -53,13 +58,18 @@ export function ARCtrl_Process_Component__Component_fromISAJsonString_Static_Z72
53
58
  }
54
59
  }
55
60
 
56
- export function ARCtrl_Process_Component__Component_toISAJsonString_Static_71136F3F(spaces) {
61
+ export function ARCtrl_Process_Component__Component_toISAJsonString_Static_Z3B036AA(spaces, useIDReferencing) {
62
+ const idMap = defaultArg(useIDReferencing, false) ? (new Map([])) : void 0;
57
63
  return (f) => {
58
- const value = Component_ISAJson_encoder(f);
64
+ const value = Component_ISAJson_encoder(idMap, f);
59
65
  return toString(defaultSpaces(spaces), value);
60
66
  };
61
67
  }
62
68
 
69
+ export function ARCtrl_Process_Component__Component_toISAJsonString_71136F3F(this$, spaces) {
70
+ return ARCtrl_Process_Component__Component_toISAJsonString_Static_Z3B036AA(spaces)(this$);
71
+ }
72
+
63
73
  export function ARCtrl_Process_Component__Component_fromROCrateJsonString_Static_Z721C83C5(s) {
64
74
  const matchValue = fromString(Component_ROCrate_decoder, s);
65
75
  if (matchValue.tag === 1) {
@@ -77,3 +87,7 @@ export function ARCtrl_Process_Component__Component_toROCrateJsonString_Static_7
77
87
  };
78
88
  }
79
89
 
90
+ export function ARCtrl_Process_Component__Component_toROCrateJsonString_71136F3F(this$, spaces) {
91
+ return ARCtrl_Process_Component__Component_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
92
+ }
93
+