@nfdi4plants/arctrl 1.0.7 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/ARC.js +39 -3
  2. package/Contracts/Contracts.ArcTypes.js +20 -8
  3. package/ISA/ISA/ArcTypes/ArcTable.js +4 -12
  4. package/ISA/ISA/ArcTypes/ArcTableAux.js +12 -1
  5. package/ISA/ISA/ArcTypes/ArcTypes.js +108 -73
  6. package/ISA/ISA.Json/ArcTypes/ArcAssay.js +74 -3
  7. package/ISA/ISA.Json/ArcTypes/ArcStudy.js +82 -3
  8. package/ISA/ISA.Json/ArcTypes/ArcTable.js +125 -4
  9. package/ISA/ISA.Json/ArcTypes/CellTable.js +46 -0
  10. package/ISA/ISA.Json/ArcTypes/CompositeCell.js +26 -0
  11. package/ISA/ISA.Json/ArcTypes/OATable.js +48 -0
  12. package/ISA/ISA.Json/Ontology.js +30 -0
  13. package/ISA/ISA.Json/StringTable.js +43 -0
  14. package/ISA/ISA.Spreadsheet/AnnotationTable/ArcTable.js +52 -39
  15. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeCell.js +1 -1
  16. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeColumn.js +3 -3
  17. package/ISA/ISA.Spreadsheet/AnnotationTable/CompositeHeader.js +1 -1
  18. package/ISA/ISA.Spreadsheet/ArcAssay.js +96 -84
  19. package/ISA/ISA.Spreadsheet/ArcInvestigation.js +2 -2
  20. package/ISA/ISA.Spreadsheet/ArcStudy.js +32 -20
  21. package/ISA/ISA.Spreadsheet/Metadata/SparseTable.js +7 -7
  22. package/Templates/Template.Spreadsheet.js +2 -2
  23. package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsAddress.fs +22 -8
  24. package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsAddress.fs.js +20 -10
  25. package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsWorksheet.fs +12 -6
  26. package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsWorksheet.fs.js +12 -8
  27. package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/obj/Release/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +3 -3
  28. package/fable_modules/project_cracked.json +1 -1
  29. package/package.json +1 -1
  30. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Cells/FsCell.fs +0 -0
  31. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Cells/FsCell.fs.js +0 -0
  32. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Cells/FsCellsCollection.fs +0 -0
  33. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Cells/FsCellsCollection.fs.js +0 -0
  34. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/CellBuilder.fs +0 -0
  35. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/CellBuilder.fs.js +0 -0
  36. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/ColumnBuilder.fs +0 -0
  37. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/ColumnBuilder.fs.js +0 -0
  38. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/DSL.fs +0 -0
  39. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/DSL.fs.js +0 -0
  40. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Expression.fs +0 -0
  41. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Expression.fs.js +0 -0
  42. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Operators.fs +0 -0
  43. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Operators.fs.js +0 -0
  44. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/RowBuilder.fs +0 -0
  45. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/RowBuilder.fs.js +0 -0
  46. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/SheetBuilder.fs +0 -0
  47. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/SheetBuilder.fs.js +0 -0
  48. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/TableBuilder.fs +0 -0
  49. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/TableBuilder.fs.js +0 -0
  50. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Transform.fs +0 -0
  51. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Transform.fs.js +0 -0
  52. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Types.fs +0 -0
  53. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/Types.fs.js +0 -0
  54. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/WorkbookBuilder.fs +0 -0
  55. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/DSL/WorkbookBuilder.fs.js +0 -0
  56. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsColumn.fs +0 -0
  57. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsColumn.fs.js +0 -0
  58. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsRow.fs +0 -0
  59. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsRow.fs.js +0 -0
  60. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsSpreadsheet.fableproj +0 -0
  61. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsWorkbook.fs +0 -0
  62. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/FsWorkbook.fs.js +0 -0
  63. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRange.fs +0 -0
  64. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRange.fs.js +0 -0
  65. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeAddress.fs +0 -0
  66. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeAddress.fs.js +0 -0
  67. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeBase.fs +0 -0
  68. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeBase.fs.js +0 -0
  69. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeColumn.fs +0 -0
  70. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeColumn.fs.js +0 -0
  71. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeRow.fs +0 -0
  72. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Ranges/FsRangeRow.fs.js +0 -0
  73. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/SheetBuilder.fs +0 -0
  74. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/SheetBuilder.fs.js +0 -0
  75. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Tables/FsTable.fs +0 -0
  76. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Tables/FsTable.fs.js +0 -0
  77. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Tables/FsTableField.fs +0 -0
  78. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Tables/FsTableField.fs.js +0 -0
  79. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Tables/FsTableRow.fs +0 -0
  80. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/Tables/FsTableRow.fs.js +0 -0
  81. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  82. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/obj/Debug/netstandard2.0/FsSpreadsheet.AssemblyInfo.fs +0 -0
  83. /package/fable_modules/{FsSpreadsheet.5.1.2 → FsSpreadsheet.5.1.3}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
@@ -1,8 +1,8 @@
1
1
  import { OntologySourceReference_encoder, OntologyAnnotation_encoder, OntologySourceReference_decoder, OntologyAnnotation_decoder } from "../Ontology.js";
2
2
  import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor } from "../ConverterOptions.js";
3
- import { fromString, object as object_1, string, list as list_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
4
- import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
5
- import { ArcTable_encoder, ArcTable_decoder } from "./ArcTable.js";
3
+ import { fromString, array, object as object_1, string, list as list_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
4
+ import { safeHash, equals, uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
5
+ import { ArcTable_compressedDecoder, ArcTable_compressedEncoder, ArcTable_encoder, ArcTable_decoder } from "./ArcTable.js";
6
6
  import { encoder, decoder as decoder_1 } from "../Person.js";
7
7
  import { encoder as encoder_1, decoder as decoder_2 } from "../Comment.js";
8
8
  import { Factor_encoder, Factor_decoder } from "../Factor.js";
@@ -12,9 +12,13 @@ import { toArray } from "../../../fable_modules/fable-library.4.5.0/List.js";
12
12
  import { toString, object, seq } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
13
13
  import { empty, singleton, append, delay, toList, map as map_1 } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
14
14
  import { ArcAssay } from "../../ISA/ArcTypes/ArcTypes.js";
15
+ import { OATable_arrayFromMap, OATable_encoder, OATable_decoder, OATable_decodeOA, OATable_encodeOA } from "./OATable.js";
15
16
  import { Assay_decoder, Assay_encoder } from "../Assay.js";
16
17
  import { fromJsonString } from "../Decode.js";
17
18
  import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
19
+ import { StringTable_arrayFromMap, StringTable_encoder, StringTable_decoder } from "../StringTable.js";
20
+ import { CellTable_arrayFromMap, CellTable_encoder, CellTable_decoder } from "./CellTable.js";
21
+ import { Dictionary } from "../../../fable_modules/fable-library.4.5.0/MutableMap.js";
18
22
 
19
23
  export const JsonHelper_DecodeOa = OntologyAnnotation_decoder(ConverterOptions_$ctor());
20
24
 
@@ -160,6 +164,32 @@ export const ArcAssay_decoder = (path_1) => ((v) => object_1((get$) => {
160
164
  return ArcAssay.make(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments);
161
165
  }, path_1, v));
162
166
 
167
+ export function ArcAssay_compressedEncoder(stringTable, oaTable, cellTable, assay) {
168
+ return object(toList(delay(() => append(singleton(["Identifier", assay.Identifier]), delay(() => append((assay.MeasurementType != null) ? singleton(["MeasurementType", OATable_encodeOA(oaTable, value_3(assay.MeasurementType))]) : empty(), delay(() => append((assay.TechnologyType != null) ? singleton(["TechnologyType", OATable_encodeOA(oaTable, value_3(assay.TechnologyType))]) : empty(), delay(() => append((assay.TechnologyPlatform != null) ? singleton(["TechnologyPlatform", OATable_encodeOA(oaTable, value_3(assay.TechnologyPlatform))]) : empty(), delay(() => append((assay.Tables.length !== 0) ? singleton(["Tables", seq(map_1((table) => ArcTable_compressedEncoder(stringTable, oaTable, cellTable, table), assay.Tables))]) : empty(), delay(() => append((assay.Performers.length !== 0) ? singleton(["Performers", JsonHelper_EncoderPersons(assay.Performers)]) : empty(), delay(() => ((assay.Comments.length !== 0) ? singleton(["Comments", JsonHelper_EncoderComments(assay.Comments)]) : empty()))))))))))))))));
169
+ }
170
+
171
+ export function ArcAssay_compressedDecoder(stringTable, oaTable, cellTable) {
172
+ return (path_2) => ((v) => object_1((get$) => {
173
+ let arg_1, decoder, objectArg;
174
+ const tables = defaultArg(map((collection) => Array.from(collection), (arg_1 = ((decoder = ArcTable_compressedDecoder(stringTable, oaTable, cellTable), (path) => ((value) => array(uncurry2(decoder), path, value)))), (objectArg = get$.Optional, objectArg.Field("Tables", uncurry2(arg_1))))), []);
175
+ let identifier;
176
+ const objectArg_1 = get$.Required;
177
+ identifier = objectArg_1.Field("Identifier", string);
178
+ let measurementType;
179
+ const objectArg_2 = get$.Optional;
180
+ measurementType = objectArg_2.Field("MeasurementType", (s, o) => OATable_decodeOA(oaTable, s, o));
181
+ let technologyType;
182
+ const objectArg_3 = get$.Optional;
183
+ technologyType = objectArg_3.Field("TechnologyType", (s_1, o_1) => OATable_decodeOA(oaTable, s_1, o_1));
184
+ let technologyPlatform;
185
+ const objectArg_4 = get$.Optional;
186
+ technologyPlatform = objectArg_4.Field("TechnologyPlatform", (s_2, o_2) => OATable_decodeOA(oaTable, s_2, o_2));
187
+ const performers = JsonHelper_tryGetPersons(get$, "Performers");
188
+ const comments = JsonHelper_tryGetComments(get$, "Comments");
189
+ return ArcAssay.make(identifier, measurementType, technologyType, technologyPlatform, tables, performers, comments);
190
+ }, path_2, v));
191
+ }
192
+
163
193
  /**
164
194
  * exports in json-ld format
165
195
  */
@@ -209,3 +239,44 @@ export function ARCtrl_ISA_ArcAssay__ArcAssay_toArcJsonString_Static_1C75D08D(a)
209
239
  return ARCtrl_ISA_ArcAssay__ArcAssay_ToArcJsonString_71136F3F(a);
210
240
  }
211
241
 
242
+ export function ARCtrl_ISA_ArcAssay__ArcAssay_fromCompressedJsonString_Static_Z721C83C5(jsonString) {
243
+ const matchValue = fromString((path, v) => object_1((get$) => {
244
+ let arg_5, objectArg_2;
245
+ let stringTable;
246
+ const objectArg = get$.Required;
247
+ stringTable = objectArg.Field("stringTable", uncurry2(StringTable_decoder));
248
+ let oaTable;
249
+ const arg_3 = OATable_decoder(stringTable);
250
+ const objectArg_1 = get$.Required;
251
+ oaTable = objectArg_1.Field("oaTable", uncurry2(arg_3));
252
+ const arg_7 = ArcAssay_compressedDecoder(stringTable, oaTable, (arg_5 = CellTable_decoder(stringTable, oaTable), (objectArg_2 = get$.Required, objectArg_2.Field("cellTable", uncurry2(arg_5)))));
253
+ const objectArg_3 = get$.Required;
254
+ return objectArg_3.Field("assay", uncurry2(arg_7));
255
+ }, path, v), jsonString);
256
+ if (matchValue.tag === 1) {
257
+ return toFail(printf("Error. Unable to parse json string to ArcAssay: %s"))(matchValue.fields[0]);
258
+ }
259
+ else {
260
+ return matchValue.fields[0];
261
+ }
262
+ }
263
+
264
+ export function ARCtrl_ISA_ArcAssay__ArcAssay_ToCompressedJsonString_71136F3F(this$, spaces) {
265
+ const spaces_1 = defaultArg(spaces, 0) | 0;
266
+ const stringTable = new Map([]);
267
+ const oaTable = new Dictionary([], {
268
+ Equals: equals,
269
+ GetHashCode: safeHash,
270
+ });
271
+ const cellTable = new Dictionary([], {
272
+ Equals: equals,
273
+ GetHashCode: safeHash,
274
+ });
275
+ const arcAssay = ArcAssay_compressedEncoder(stringTable, oaTable, cellTable, this$);
276
+ return toString(spaces_1, object([["cellTable", CellTable_encoder(stringTable, oaTable, CellTable_arrayFromMap(cellTable))], ["oaTable", OATable_encoder(stringTable, OATable_arrayFromMap(oaTable))], ["stringTable", StringTable_encoder(StringTable_arrayFromMap(stringTable))], ["assay", arcAssay]]));
277
+ }
278
+
279
+ export function ARCtrl_ISA_ArcAssay__ArcAssay_toCompressedJsonString_Static_1C75D08D(a) {
280
+ return ARCtrl_ISA_ArcAssay__ArcAssay_ToCompressedJsonString_71136F3F(a);
281
+ }
282
+
@@ -1,14 +1,19 @@
1
1
  import { toString, seq, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
2
2
  import { map, empty, singleton, append, delay, toList } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
3
- import { defaultArg, value as value_7 } from "../../../fable_modules/fable-library.4.5.0/Option.js";
3
+ import { map as map_1, defaultArg, value as value_7 } from "../../../fable_modules/fable-library.4.5.0/Option.js";
4
4
  import { JsonHelper_tryGetComments, JsonHelper_tryGetFactors, JsonHelper_tryGetStringResizeArray, JsonHelper_tryGetTables, JsonHelper_tryGetOAs, JsonHelper_tryGetPersons, JsonHelper_tryGetPublications, JsonHelper_EncoderComments, JsonHelper_EncoderFactors, JsonHelper_EncoderTables, JsonHelper_EncoderOAs, JsonHelper_EncoderPersons, JsonHelper_EncoderPublications } from "./ArcAssay.js";
5
- import { fromString, string, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
5
+ import { fromString, array, string, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
6
6
  import { ArcStudy } from "../../ISA/ArcTypes/ArcTypes.js";
7
+ import { ArcTable_compressedDecoder, ArcTable_compressedEncoder } from "./ArcTable.js";
8
+ import { safeHash, equals, uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
7
9
  import { Study_decoder, Study_encoder } from "../Study.js";
8
10
  import { ConverterOptions__set_IncludeType_Z1FBCCD16, ConverterOptions__set_SetID_Z1FBCCD16, ConverterOptions_$ctor } from "../ConverterOptions.js";
9
11
  import { fromJsonString } from "../Decode.js";
10
- import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
11
12
  import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
13
+ import { StringTable_arrayFromMap, StringTable_encoder, StringTable_decoder } from "../StringTable.js";
14
+ import { OATable_arrayFromMap, OATable_encoder, OATable_decoder } from "./OATable.js";
15
+ import { CellTable_arrayFromMap, CellTable_encoder, CellTable_decoder } from "./CellTable.js";
16
+ import { Dictionary } from "../../../fable_modules/fable-library.4.5.0/MutableMap.js";
12
17
 
13
18
  export function ArcStudy_encoder(study) {
14
19
  return object(toList(delay(() => append(singleton(["Identifier", study.Identifier]), delay(() => append((study.Title != null) ? singleton(["Title", value_7(study.Title)]) : empty(), delay(() => append((study.Description != null) ? singleton(["Description", value_7(study.Description)]) : empty(), delay(() => append((study.SubmissionDate != null) ? singleton(["SubmissionDate", value_7(study.SubmissionDate)]) : empty(), delay(() => append((study.PublicReleaseDate != null) ? singleton(["PublicReleaseDate", value_7(study.PublicReleaseDate)]) : empty(), delay(() => append((study.Publications.length !== 0) ? singleton(["Publications", JsonHelper_EncoderPublications(study.Publications)]) : empty(), delay(() => append((study.Contacts.length !== 0) ? singleton(["Contacts", JsonHelper_EncoderPersons(study.Contacts)]) : empty(), delay(() => append((study.StudyDesignDescriptors.length !== 0) ? singleton(["StudyDesignDescriptors", JsonHelper_EncoderOAs(study.StudyDesignDescriptors)]) : empty(), delay(() => append((study.TableCount !== 0) ? singleton(["Tables", JsonHelper_EncoderTables(study.Tables)]) : empty(), delay(() => append((study.RegisteredAssayIdentifiers.length !== 0) ? singleton(["RegisteredAssayIdentifiers", seq(map((value_5) => value_5, study.RegisteredAssayIdentifiers))]) : empty(), delay(() => append((study.Factors.length !== 0) ? singleton(["Factors", JsonHelper_EncoderFactors(study.Factors)]) : empty(), delay(() => ((study.Comments.length !== 0) ? singleton(["Comments", JsonHelper_EncoderComments(study.Comments)]) : empty()))))))))))))))))))))))))));
@@ -40,6 +45,39 @@ export const ArcStudy_decoder = (path_5) => ((v) => object_1((get$) => {
40
45
  return ArcStudy.make(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, registeredAssayIdentifiers, factors, comments);
41
46
  }, path_5, v));
42
47
 
48
+ export function ArcStudy_compressedEncoder(stringTable, oaTable, cellTable, study) {
49
+ return object(toList(delay(() => append(singleton(["Identifier", study.Identifier]), delay(() => append((study.Title != null) ? singleton(["Title", value_7(study.Title)]) : empty(), delay(() => append((study.Description != null) ? singleton(["Description", value_7(study.Description)]) : empty(), delay(() => append((study.SubmissionDate != null) ? singleton(["SubmissionDate", value_7(study.SubmissionDate)]) : empty(), delay(() => append((study.PublicReleaseDate != null) ? singleton(["PublicReleaseDate", value_7(study.PublicReleaseDate)]) : empty(), delay(() => append((study.Publications.length !== 0) ? singleton(["Publications", JsonHelper_EncoderPublications(study.Publications)]) : empty(), delay(() => append((study.Contacts.length !== 0) ? singleton(["Contacts", JsonHelper_EncoderPersons(study.Contacts)]) : empty(), delay(() => append((study.StudyDesignDescriptors.length !== 0) ? singleton(["StudyDesignDescriptors", JsonHelper_EncoderOAs(study.StudyDesignDescriptors)]) : empty(), delay(() => append((study.TableCount !== 0) ? singleton(["Tables", seq(map((table) => ArcTable_compressedEncoder(stringTable, oaTable, cellTable, table), study.Tables))]) : empty(), delay(() => append((study.RegisteredAssayIdentifiers.length !== 0) ? singleton(["RegisteredAssayIdentifiers", seq(map((value_5) => value_5, study.RegisteredAssayIdentifiers))]) : empty(), delay(() => append((study.Factors.length !== 0) ? singleton(["Factors", JsonHelper_EncoderFactors(study.Factors)]) : empty(), delay(() => ((study.Comments.length !== 0) ? singleton(["Comments", JsonHelper_EncoderComments(study.Comments)]) : empty()))))))))))))))))))))))))));
50
+ }
51
+
52
+ export function ArcStudy_compressedDecoder(stringTable, oaTable, cellTable) {
53
+ return (path_6) => ((v) => object_1((get$) => {
54
+ let arg_1, decoder, objectArg;
55
+ const tables = defaultArg(map_1((collection) => Array.from(collection), (arg_1 = ((decoder = ArcTable_compressedDecoder(stringTable, oaTable, cellTable), (path) => ((value) => array(uncurry2(decoder), path, value)))), (objectArg = get$.Optional, objectArg.Field("Tables", uncurry2(arg_1))))), []);
56
+ let identifier;
57
+ const objectArg_1 = get$.Required;
58
+ identifier = objectArg_1.Field("Identifier", string);
59
+ let title;
60
+ const objectArg_2 = get$.Optional;
61
+ title = objectArg_2.Field("Title", string);
62
+ let description;
63
+ const objectArg_3 = get$.Optional;
64
+ description = objectArg_3.Field("Description", string);
65
+ let submissionDate;
66
+ const objectArg_4 = get$.Optional;
67
+ submissionDate = objectArg_4.Field("SubmissionDate", string);
68
+ let publicReleaseDate;
69
+ const objectArg_5 = get$.Optional;
70
+ publicReleaseDate = objectArg_5.Field("PublicReleaseDate", string);
71
+ const publications = JsonHelper_tryGetPublications(get$, "Publications");
72
+ const contacts = JsonHelper_tryGetPersons(get$, "Contacts");
73
+ const studyDesignDescriptors = JsonHelper_tryGetOAs(get$, "StudyDesignDescriptors");
74
+ const registeredAssayIdentifiers = JsonHelper_tryGetStringResizeArray(get$, "RegisteredAssayIdentifiers");
75
+ const factors = JsonHelper_tryGetFactors(get$, "Factors");
76
+ const comments = JsonHelper_tryGetComments(get$, "Comments");
77
+ return ArcStudy.make(identifier, title, description, submissionDate, publicReleaseDate, publications, contacts, studyDesignDescriptors, tables, registeredAssayIdentifiers, factors, comments);
78
+ }, path_6, v));
79
+ }
80
+
43
81
  /**
44
82
  * exports in json-ld format
45
83
  */
@@ -89,3 +127,44 @@ export function ARCtrl_ISA_ArcStudy__ArcStudy_toArcJsonString_Static_1B3D5E9B(a)
89
127
  return ARCtrl_ISA_ArcStudy__ArcStudy_ToArcJsonString_71136F3F(a);
90
128
  }
91
129
 
130
+ export function ARCtrl_ISA_ArcStudy__ArcStudy_fromCompressedJsonString_Static_Z721C83C5(jsonString) {
131
+ const matchValue = fromString((path, v) => object_1((get$) => {
132
+ let arg_5, objectArg_2;
133
+ let stringTable;
134
+ const objectArg = get$.Required;
135
+ stringTable = objectArg.Field("stringTable", uncurry2(StringTable_decoder));
136
+ let oaTable;
137
+ const arg_3 = OATable_decoder(stringTable);
138
+ const objectArg_1 = get$.Required;
139
+ oaTable = objectArg_1.Field("oaTable", uncurry2(arg_3));
140
+ const arg_7 = ArcStudy_compressedDecoder(stringTable, oaTable, (arg_5 = CellTable_decoder(stringTable, oaTable), (objectArg_2 = get$.Required, objectArg_2.Field("cellTable", uncurry2(arg_5)))));
141
+ const objectArg_3 = get$.Required;
142
+ return objectArg_3.Field("study", uncurry2(arg_7));
143
+ }, path, v), jsonString);
144
+ if (matchValue.tag === 1) {
145
+ return toFail(printf("Error. Unable to parse json string to ArcAssay: %s"))(matchValue.fields[0]);
146
+ }
147
+ else {
148
+ return matchValue.fields[0];
149
+ }
150
+ }
151
+
152
+ export function ARCtrl_ISA_ArcStudy__ArcStudy_ToCompressedJsonString_71136F3F(this$, spaces) {
153
+ const spaces_1 = defaultArg(spaces, 0) | 0;
154
+ const stringTable = new Map([]);
155
+ const oaTable = new Dictionary([], {
156
+ Equals: equals,
157
+ GetHashCode: safeHash,
158
+ });
159
+ const cellTable = new Dictionary([], {
160
+ Equals: equals,
161
+ GetHashCode: safeHash,
162
+ });
163
+ const arcStudy = ArcStudy_compressedEncoder(stringTable, oaTable, cellTable, this$);
164
+ return toString(spaces_1, object([["cellTable", CellTable_encoder(stringTable, oaTable, CellTable_arrayFromMap(cellTable))], ["oaTable", OATable_encoder(stringTable, OATable_arrayFromMap(oaTable))], ["stringTable", StringTable_encoder(StringTable_arrayFromMap(stringTable))], ["study", arcStudy]]));
165
+ }
166
+
167
+ export function ARCtrl_ISA_ArcStudy__ArcStudy_toCompressedJsonString_Static_1B3D5E9B(s) {
168
+ return ARCtrl_ISA_ArcStudy__ArcStudy_ToCompressedJsonString_71136F3F(s);
169
+ }
170
+
@@ -1,15 +1,21 @@
1
1
  import { toString, tuple2, map as map_1, list, object } from "../../../fable_modules/Thoth.Json.10.1.0/Encode.fs.js";
2
- import { collect, empty, map, singleton, append, delay, toList } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
2
+ import { iterate, toArray, collect, empty, map, singleton, append, delay, toList } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
3
3
  import { CompositeHeader_decoder, CompositeHeader_encoder } from "./CompositeHeader.js";
4
4
  import { CompositeCell_decoder, CompositeCell_encoder } from "./CompositeCell.js";
5
5
  import { empty as empty_2, ofSeq } from "../../../fable_modules/fable-library.4.5.0/Map.js";
6
- import { arrayHash, equalArrays, uncurry2, compareArrays } from "../../../fable_modules/fable-library.4.5.0/Util.js";
7
- import { fromString, string, int, tuple2 as tuple2_1, map$0027, list as list_1, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
8
- import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
6
+ import { safeHash, equals, arrayHash, equalArrays, uncurry2, compareArrays } from "../../../fable_modules/fable-library.4.5.0/Util.js";
7
+ import { fromString, value as value_5, array as array_1, string, int, tuple2 as tuple2_1, map$0027, list as list_1, object as object_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
8
+ import { toArray as toArray_1, defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
9
9
  import { empty as empty_1 } from "../../../fable_modules/fable-library.4.5.0/List.js";
10
10
  import { Dictionary } from "../../../fable_modules/fable-library.4.5.0/MutableMap.js";
11
11
  import { ArcTable } from "../../ISA/ArcTypes/ArcTable.js";
12
+ import { CellTable_arrayFromMap, CellTable_encoder, CellTable_decoder, CellTable_decodeCell, CellTable_encodeCell } from "./CellTable.js";
13
+ import { addToDict, getItemFromDict } from "../../../fable_modules/fable-library.4.5.0/MapUtil.js";
14
+ import { rangeDouble } from "../../../fable_modules/fable-library.4.5.0/Range.js";
15
+ import { iterateIndexed } from "../../../fable_modules/fable-library.4.5.0/Array.js";
16
+ import { StringTable_arrayFromMap, StringTable_encoder, StringTable_decoder, StringTable_decodeString, StringTable_encodeString } from "../StringTable.js";
12
17
  import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
18
+ import { OATable_arrayFromMap, OATable_encoder, OATable_decoder } from "./OATable.js";
13
19
 
14
20
  export function ArcTable_encoder(table) {
15
21
  return object(toList(delay(() => append(singleton(["name", table.Name]), delay(() => append((table.Headers.length !== 0) ? singleton(["header", list(toList(delay(() => map(CompositeHeader_encoder, table.Headers))))]) : empty(), delay(() => ((table.Values.size !== 0) ? singleton(["values", map_1((tupledArg) => tuple2((value) => value, (value_2) => value_2, tupledArg[0], tupledArg[1]), CompositeCell_encoder, ofSeq(toList(delay(() => collect((matchValue) => {
@@ -37,6 +43,80 @@ export const ArcTable_decoder = (path_2) => ((v) => object_1((get$) => {
37
43
  return ArcTable.create((objectArg_2 = get$.Required, objectArg_2.Field("name", string)), decodedHeader, decodedValues);
38
44
  }, path_2, v));
39
45
 
46
+ export function ArcTable_compressedColumnEncoder(columnIndex, rowCount, cellTable, table) {
47
+ if (table.Headers[columnIndex].IsIOType ? true : (rowCount < 100)) {
48
+ return toArray(delay(() => map((r) => CellTable_encodeCell(cellTable, getItemFromDict(table.Values, [columnIndex, r])), rangeDouble(0, 1, rowCount - 1))));
49
+ }
50
+ else {
51
+ let current = getItemFromDict(table.Values, [columnIndex, 0]);
52
+ let from = 0;
53
+ return toArray(delay(() => append(collect((i) => {
54
+ const next = getItemFromDict(table.Values, [columnIndex, i]);
55
+ return !equals(next, current) ? append(singleton(object([["f", from], ["t", i - 1], ["v", CellTable_encodeCell(cellTable, current)]])), delay(() => {
56
+ current = next;
57
+ from = (i | 0);
58
+ return empty();
59
+ })) : empty();
60
+ }, rangeDouble(1, 1, rowCount - 1)), delay(() => singleton(object([["f", from], ["t", rowCount - 1], ["v", CellTable_encodeCell(cellTable, current)]]))))));
61
+ }
62
+ }
63
+
64
+ export function ArcTable_compressedColumnDecoder(columnIndex, cellTable, table, column) {
65
+ const matchValue = array_1((s, o) => CellTable_decodeCell(cellTable, s, o), "", column);
66
+ if (matchValue.tag === 1) {
67
+ array_1((s_1, jv) => object_1((get$) => {
68
+ let from;
69
+ const objectArg = get$.Required;
70
+ from = objectArg.Field("f", uncurry2(int));
71
+ let to_;
72
+ const objectArg_1 = get$.Required;
73
+ to_ = objectArg_1.Field("t", uncurry2(int));
74
+ let value;
75
+ const objectArg_2 = get$.Required;
76
+ value = objectArg_2.Field("v", (s_2, o_1) => CellTable_decodeCell(cellTable, s_2, o_1));
77
+ for (let i = from; i <= to_; i++) {
78
+ addToDict(table.Values, [columnIndex, i], value);
79
+ }
80
+ }, s_1, jv), "", column);
81
+ }
82
+ else {
83
+ iterateIndexed((r, cell) => {
84
+ addToDict(table.Values, [columnIndex, r], cell);
85
+ }, matchValue.fields[0]);
86
+ }
87
+ }
88
+
89
+ export function ArcTable_compressedEncoder(stringTable, oaTable, cellTable, table) {
90
+ return object(toList(delay(() => append(singleton(["n", StringTable_encodeString(stringTable, table.Name)]), delay(() => append((table.Headers.length !== 0) ? singleton(["h", list(toList(delay(() => map(CompositeHeader_encoder, table.Headers))))]) : empty(), delay(() => {
91
+ if (table.Values.size !== 0) {
92
+ const rowCount = table.RowCount | 0;
93
+ return singleton(["c", toArray(delay(() => map((c) => ArcTable_compressedColumnEncoder(c, rowCount, cellTable, table), rangeDouble(0, 1, table.ColumnCount - 1))))]);
94
+ }
95
+ else {
96
+ return empty();
97
+ }
98
+ })))))));
99
+ }
100
+
101
+ export function ArcTable_compressedDecoder(stringTable, oaTable, cellTable) {
102
+ return (path_2) => ((v_1) => object_1((get$) => {
103
+ let objectArg, objectArg_1, objectArg_2;
104
+ let decodedHeader;
105
+ const collection = defaultArg((objectArg = get$.Optional, objectArg.Field("h", (path, value) => list_1(uncurry2(CompositeHeader_decoder), path, value))), empty_1());
106
+ decodedHeader = Array.from(collection);
107
+ const table = ArcTable.create((objectArg_1 = get$.Required, objectArg_1.Field("n", (s, o) => StringTable_decodeString(stringTable, s, o))), decodedHeader, new Dictionary([], {
108
+ Equals: equalArrays,
109
+ GetHashCode: arrayHash,
110
+ }));
111
+ iterate((array) => {
112
+ iterateIndexed((c, col) => {
113
+ ArcTable_compressedColumnDecoder(c, cellTable, table, col);
114
+ }, array);
115
+ }, toArray_1((objectArg_2 = get$.Optional, objectArg_2.Field("c", (path_1, value_2) => array_1(value_5, path_1, value_2)))));
116
+ return table;
117
+ }, path_2, v_1));
118
+ }
119
+
40
120
  export function ARCtrl_ISA_ArcTable__ArcTable_fromJsonString_Static_Z721C83C5(jsonString) {
41
121
  const matchValue = fromString(uncurry2(ArcTable_decoder), jsonString);
42
122
  if (matchValue.tag === 1) {
@@ -55,3 +135,44 @@ export function ARCtrl_ISA_ArcTable__ArcTable_toJsonString_Static_1B2566EA(a) {
55
135
  return ARCtrl_ISA_ArcTable__ArcTable_ToJsonString_71136F3F(a);
56
136
  }
57
137
 
138
+ export function ARCtrl_ISA_ArcTable__ArcTable_fromCompressedJsonString_Static_Z721C83C5(jsonString) {
139
+ const matchValue = fromString((path, v) => object_1((get$) => {
140
+ let arg_5, objectArg_2;
141
+ let stringTable;
142
+ const objectArg = get$.Required;
143
+ stringTable = objectArg.Field("stringTable", uncurry2(StringTable_decoder));
144
+ let oaTable;
145
+ const arg_3 = OATable_decoder(stringTable);
146
+ const objectArg_1 = get$.Required;
147
+ oaTable = objectArg_1.Field("oaTable", uncurry2(arg_3));
148
+ const arg_7 = ArcTable_compressedDecoder(stringTable, oaTable, (arg_5 = CellTable_decoder(stringTable, oaTable), (objectArg_2 = get$.Required, objectArg_2.Field("cellTable", uncurry2(arg_5)))));
149
+ const objectArg_3 = get$.Required;
150
+ return objectArg_3.Field("table", uncurry2(arg_7));
151
+ }, path, v), jsonString);
152
+ if (matchValue.tag === 1) {
153
+ return toFail(printf("Error. Unable to parse json string to ArcTable: %s"))(matchValue.fields[0]);
154
+ }
155
+ else {
156
+ return matchValue.fields[0];
157
+ }
158
+ }
159
+
160
+ export function ARCtrl_ISA_ArcTable__ArcTable_ToCompressedJsonString_71136F3F(this$, spaces) {
161
+ const spaces_1 = defaultArg(spaces, 0) | 0;
162
+ const stringTable = new Map([]);
163
+ const oaTable = new Dictionary([], {
164
+ Equals: equals,
165
+ GetHashCode: safeHash,
166
+ });
167
+ const cellTable = new Dictionary([], {
168
+ Equals: equals,
169
+ GetHashCode: safeHash,
170
+ });
171
+ const arcTable = ArcTable_compressedEncoder(stringTable, oaTable, cellTable, this$);
172
+ return toString(spaces_1, object([["cellTable", CellTable_encoder(stringTable, oaTable, CellTable_arrayFromMap(cellTable))], ["oaTable", OATable_encoder(stringTable, OATable_arrayFromMap(oaTable))], ["stringTable", StringTable_encoder(StringTable_arrayFromMap(stringTable))], ["table", arcTable]]));
173
+ }
174
+
175
+ export function ARCtrl_ISA_ArcTable__ArcTable_toCompressedJsonString_Static_1B2566EA(a) {
176
+ return ARCtrl_ISA_ArcTable__ArcTable_ToCompressedJsonString_71136F3F(a);
177
+ }
178
+
@@ -0,0 +1,46 @@
1
+ import { sortBy, map, toArray } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
2
+ import { uncurry2, comparePrimitives } from "../../../fable_modules/fable-library.4.5.0/Util.js";
3
+ import { map as map_1 } from "../../../fable_modules/fable-library.4.5.0/Array.js";
4
+ import { CompositeCell_compressedDecoder, CompositeCell_compressedEncoder } from "./CompositeCell.js";
5
+ import { int, array as array_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
6
+ import { Dict_tryFind } from "../../ISA/Helper.js";
7
+ import { addToDict } from "../../../fable_modules/fable-library.4.5.0/MapUtil.js";
8
+ import { FSharpResult$2 } from "../../../fable_modules/fable-library.4.5.0/Choice.js";
9
+
10
+ export function CellTable_arrayFromMap(otm) {
11
+ return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
12
+ Compare: comparePrimitives,
13
+ })));
14
+ }
15
+
16
+ export function CellTable_encoder(stringTable, oaTable, ot) {
17
+ return map_1((cc) => CompositeCell_compressedEncoder(stringTable, oaTable, cc), ot);
18
+ }
19
+
20
+ export function CellTable_decoder(stringTable, oaTable) {
21
+ const decoder = CompositeCell_compressedDecoder(stringTable, oaTable);
22
+ return (path) => ((value) => array_1(uncurry2(decoder), path, value));
23
+ }
24
+
25
+ export function CellTable_encodeCell(otm, cc) {
26
+ const matchValue = Dict_tryFind(cc, otm);
27
+ if (matchValue == null) {
28
+ const i_1 = otm.size | 0;
29
+ addToDict(otm, cc, i_1);
30
+ return i_1;
31
+ }
32
+ else {
33
+ return matchValue;
34
+ }
35
+ }
36
+
37
+ export function CellTable_decodeCell(ot, s, o) {
38
+ const matchValue = int(s)(o);
39
+ if (matchValue.tag === 1) {
40
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
41
+ }
42
+ else {
43
+ return new FSharpResult$2(0, [ot[matchValue.fields[0]]]);
44
+ }
45
+ }
46
+
@@ -6,6 +6,8 @@ import { fromString, index, string, object as object_1 } from "../../../fable_mo
6
6
  import { CompositeCell } from "../../ISA/ArcTypes/CompositeCell.js";
7
7
  import { uncurry2 } from "../../../fable_modules/fable-library.4.5.0/Util.js";
8
8
  import { printf, toFail } from "../../../fable_modules/fable-library.4.5.0/String.js";
9
+ import { OATable_decodeOA, OATable_encodeOA } from "./OATable.js";
10
+ import { StringTable_decodeString, StringTable_encodeString } from "../StringTable.js";
9
11
  import { defaultArg } from "../../../fable_modules/fable-library.4.5.0/Option.js";
10
12
 
11
13
  export function CompositeCell_encoder(cc) {
@@ -31,6 +33,30 @@ export const CompositeCell_decoder = (path_7) => ((v_1) => object_1((get$) => {
31
33
  }
32
34
  }, path_7, v_1));
33
35
 
36
+ export function CompositeCell_compressedEncoder(stringTable, oaTable, cc) {
37
+ const patternInput = (cc.tag === 0) ? ["Term", singleton(OATable_encodeOA(oaTable, cc.fields[0]))] : ((cc.tag === 2) ? ["Unitized", ofArray([StringTable_encodeString(stringTable, cc.fields[0]), OATable_encodeOA(oaTable, cc.fields[1])])] : ["FreeText", singleton(StringTable_encodeString(stringTable, cc.fields[0]))]);
38
+ return object([["t", StringTable_encodeString(stringTable, patternInput[0])], ["v", list(patternInput[1])]]);
39
+ }
40
+
41
+ export function CompositeCell_compressedDecoder(stringTable, oaTable) {
42
+ return (path_4) => ((v_1) => object_1((get$) => {
43
+ let objectArg_1, objectArg_2, objectArg_3, objectArg_4;
44
+ let matchValue;
45
+ const objectArg = get$.Required;
46
+ matchValue = objectArg.Field("t", (s, o) => StringTable_decodeString(stringTable, s, o));
47
+ switch (matchValue) {
48
+ case "FreeText":
49
+ return new CompositeCell(1, [(objectArg_1 = get$.Required, objectArg_1.Field("v", (path, value) => index(0, (s_1, o_1) => StringTable_decodeString(stringTable, s_1, o_1), path, value)))]);
50
+ case "Term":
51
+ return new CompositeCell(0, [(objectArg_2 = get$.Required, objectArg_2.Field("v", (path_1, value_1) => index(0, (s_3, o_2) => OATable_decodeOA(oaTable, s_3, o_2), path_1, value_1)))]);
52
+ case "Unitized":
53
+ return new CompositeCell(2, [(objectArg_3 = get$.Required, objectArg_3.Field("v", (path_2, value_2) => index(0, (s_4, o_3) => StringTable_decodeString(stringTable, s_4, o_3), path_2, value_2))), (objectArg_4 = get$.Required, objectArg_4.Field("v", (path_3, value_3) => index(1, (s_5, o_4) => OATable_decodeOA(oaTable, s_5, o_4), path_3, value_3)))]);
54
+ default:
55
+ return toFail(printf("Error reading CompositeCell from json string: %A"))(matchValue);
56
+ }
57
+ }, path_4, v_1));
58
+ }
59
+
34
60
  export function ARCtrl_ISA_CompositeCell__CompositeCell_fromJsonString_Static_Z721C83C5(jsonString) {
35
61
  const matchValue = fromString(uncurry2(CompositeCell_decoder), jsonString);
36
62
  if (matchValue.tag === 1) {
@@ -0,0 +1,48 @@
1
+ import { sortBy, map, toArray } from "../../../fable_modules/fable-library.4.5.0/Seq.js";
2
+ import { uncurry2, comparePrimitives } from "../../../fable_modules/fable-library.4.5.0/Util.js";
3
+ import { map as map_1 } from "../../../fable_modules/fable-library.4.5.0/Array.js";
4
+ import { ConverterOptions_$ctor } from "../ConverterOptions.js";
5
+ import { OntologyAnnotation_compressedDecoder, OntologyAnnotation_compressedEncoder } from "../Ontology.js";
6
+ import { int, array as array_1 } from "../../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
7
+ import { Dict_tryFind } from "../../ISA/Helper.js";
8
+ import { addToDict } from "../../../fable_modules/fable-library.4.5.0/MapUtil.js";
9
+ import { FSharpResult$2 } from "../../../fable_modules/fable-library.4.5.0/Choice.js";
10
+
11
+ export function OATable_arrayFromMap(otm) {
12
+ return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
13
+ Compare: comparePrimitives,
14
+ })));
15
+ }
16
+
17
+ export function OATable_encoder(stringTable, ot) {
18
+ let options;
19
+ return map_1((options = ConverterOptions_$ctor(), (oa) => OntologyAnnotation_compressedEncoder(stringTable, options, oa)), ot);
20
+ }
21
+
22
+ export function OATable_decoder(stringTable) {
23
+ const decoder = OntologyAnnotation_compressedDecoder(stringTable, ConverterOptions_$ctor());
24
+ return (path) => ((value) => array_1(uncurry2(decoder), path, value));
25
+ }
26
+
27
+ export function OATable_encodeOA(otm, oa) {
28
+ const matchValue = Dict_tryFind(oa, otm);
29
+ if (matchValue == null) {
30
+ const i_1 = otm.size | 0;
31
+ addToDict(otm, oa, i_1);
32
+ return i_1;
33
+ }
34
+ else {
35
+ return matchValue;
36
+ }
37
+ }
38
+
39
+ export function OATable_decodeOA(ot, s, o) {
40
+ const matchValue = int(s)(o);
41
+ if (matchValue.tag === 1) {
42
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
43
+ }
44
+ else {
45
+ return new FSharpResult$2(0, [ot[matchValue.fields[0]]]);
46
+ }
47
+ }
48
+
@@ -13,6 +13,7 @@ import { OntologySourceReference } from "../ISA/JsonTypes/OntologySourceReferenc
13
13
  import { URIModule_toString } from "../ISA/JsonTypes/URI.js";
14
14
  import { OntologyAnnotation } from "../ISA/JsonTypes/OntologyAnnotation.js";
15
15
  import { unwrap } from "../../fable_modules/fable-library.4.5.0/Option.js";
16
+ import { StringTable_decodeString, StringTable_encodeString } from "./StringTable.js";
16
17
 
17
18
  /**
18
19
  * This decodes from integer, float or string to string only!
@@ -175,6 +176,35 @@ export function OntologyAnnotation_decoder(options) {
175
176
  }, path_3, v));
176
177
  }
177
178
 
179
+ export function OntologyAnnotation_compressedEncoder(stringTable, options, oa) {
180
+ return object_10(choose((tupledArg) => {
181
+ const v = tupledArg[1];
182
+ if (equals(v, nil)) {
183
+ return void 0;
184
+ }
185
+ else {
186
+ return [tupledArg[0], v];
187
+ }
188
+ }, toList(delay(() => {
189
+ let value, s;
190
+ return append(ConverterOptions__get_SetID(options) ? singleton(["@id", (value = OntologyAnnotation_genID(oa), (typeof value === "string") ? ((s = value, s)) : nil)]) : singleton(tryInclude("@id", (value_2) => {
191
+ let s_1;
192
+ const value_3 = value_2;
193
+ return (typeof value_3 === "string") ? ((s_1 = value_3, s_1)) : nil;
194
+ }, oa["ID"])), delay(() => {
195
+ let value_5, s_2;
196
+ return append(ConverterOptions__get_IncludeType(options) ? singleton(["@type", (value_5 = "OntologyAnnotation", (typeof value_5 === "string") ? ((s_2 = value_5, s_2)) : nil)]) : empty(), delay(() => append(singleton(tryInclude("a", (s_3) => StringTable_encodeString(stringTable, s_3), oa["Name"])), delay(() => append(singleton(tryInclude("ts", (s_4) => StringTable_encodeString(stringTable, s_4), oa["TermSourceREF"])), delay(() => append(singleton(tryInclude("ta", (s_5) => StringTable_encodeString(stringTable, s_5), oa["TermAccessionNumber"])), delay(() => singleton(tryInclude("comments", (comment) => encoder(options, comment), oa["Comments"]))))))))));
197
+ }));
198
+ }))));
199
+ }
200
+
201
+ export function OntologyAnnotation_compressedDecoder(stringTable, options) {
202
+ return (path_1) => ((v) => object_11((get$) => {
203
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, arg_9, decoder, objectArg_4;
204
+ return OntologyAnnotation.create(unwrap((objectArg = get$.Optional, objectArg.Field("@id", uri))), unwrap((objectArg_1 = get$.Optional, objectArg_1.Field("a", (s_1, o) => StringTable_decodeString(stringTable, s_1, o)))), unwrap((objectArg_2 = get$.Optional, objectArg_2.Field("ts", (s_2, o_1) => StringTable_decodeString(stringTable, s_2, o_1)))), unwrap((objectArg_3 = get$.Optional, objectArg_3.Field("ta", (s_3, o_2) => StringTable_decodeString(stringTable, s_3, o_2)))), unwrap((arg_9 = ((decoder = decoder_1(options), (path) => ((value) => array(uncurry2(decoder), path, value)))), (objectArg_4 = get$.Optional, objectArg_4.Field("comments", uncurry2(arg_9))))));
205
+ }, path_1, v));
206
+ }
207
+
178
208
  export function OntologyAnnotation_fromJsonString(s) {
179
209
  return fromJsonString(uncurry2(OntologyAnnotation_decoder(ConverterOptions_$ctor())), s);
180
210
  }
@@ -0,0 +1,43 @@
1
+ import { sortBy, map, toArray } from "../../fable_modules/fable-library.4.5.0/Seq.js";
2
+ import { comparePrimitives } from "../../fable_modules/fable-library.4.5.0/Util.js";
3
+ import { map as map_1 } from "../../fable_modules/fable-library.4.5.0/Array.js";
4
+ import { int, string, array as array_1 } from "../../fable_modules/Thoth.Json.10.1.0/Decode.fs.js";
5
+ import { Dict_tryFind } from "../ISA/Helper.js";
6
+ import { addToDict } from "../../fable_modules/fable-library.4.5.0/MapUtil.js";
7
+ import { FSharpResult$2 } from "../../fable_modules/fable-library.4.5.0/Choice.js";
8
+
9
+ export function StringTable_arrayFromMap(otm) {
10
+ return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
11
+ Compare: comparePrimitives,
12
+ })));
13
+ }
14
+
15
+ export function StringTable_encoder(ot) {
16
+ return map_1((value) => value, ot);
17
+ }
18
+
19
+ export const StringTable_decoder = (path_1) => ((value_1) => array_1(string, path_1, value_1));
20
+
21
+ export function StringTable_encodeString(otm, s) {
22
+ const s_1 = s;
23
+ const matchValue = Dict_tryFind(s_1, otm);
24
+ if (matchValue == null) {
25
+ const i_1 = otm.size | 0;
26
+ addToDict(otm, s_1, i_1);
27
+ return i_1;
28
+ }
29
+ else {
30
+ return matchValue;
31
+ }
32
+ }
33
+
34
+ export function StringTable_decodeString(ot, s, o) {
35
+ const matchValue = int(s)(o);
36
+ if (matchValue.tag === 1) {
37
+ return new FSharpResult$2(1, [matchValue.fields[0]]);
38
+ }
39
+ else {
40
+ return new FSharpResult$2(0, [ot[matchValue.fields[0]]]);
41
+ }
42
+ }
43
+