@nfdi4plants/arctrl 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Json/Process/Sample.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { replace } from "../../fable_modules/fable-library-js.4.22.0/String.js";
|
|
2
|
-
import { ofArray, singleton, choose, append, empty, map } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
2
|
+
import { tail, head, isEmpty, ofArray, singleton, choose, append, empty, map } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
3
3
|
import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_1 } from "./MaterialAttributeValue.js";
|
|
4
4
|
import { map as map_1, defaultArg } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
|
|
5
5
|
import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_2, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_2 } from "./FactorValue.js";
|
|
@@ -7,10 +7,10 @@ import { list as list_5 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode
|
|
|
7
7
|
import { tryIncludeListOpt, tryIncludeList, tryInclude } from "../Encode.js";
|
|
8
8
|
import { context_jsonvalue } from "../context/rocrate/isa_sample_context.js";
|
|
9
9
|
import { map as map_2 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
|
|
10
|
-
import {
|
|
10
|
+
import { list as list_6, unit, object, string } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
11
11
|
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.22.0/Result.js";
|
|
12
|
-
import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
13
12
|
import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
|
|
13
|
+
import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
14
14
|
import { ISAJson_decoder as ISAJson_decoder_3, ISAJson_encoder as ISAJson_encoder_3, ROCrate_decoder as ROCrate_decoder_3 } from "./Source.js";
|
|
15
15
|
import { Sample } from "../../Core/Process/Sample.js";
|
|
16
16
|
import { encode } from "../IDTable.js";
|
|
@@ -76,22 +76,10 @@ export const ROCrate_additionalPropertyDecoder = {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
export const ROCrate_decoder = object((get$) => {
|
|
79
|
-
let
|
|
80
|
-
let additionalProperties;
|
|
81
|
-
const arg_1 = list_6(ROCrate_additionalPropertyDecoder);
|
|
82
|
-
const objectArg = get$.Optional;
|
|
83
|
-
additionalProperties = objectArg.Field("additionalProperties", arg_1);
|
|
84
|
-
let patternInput;
|
|
85
|
-
if (additionalProperties != null) {
|
|
86
|
-
const additionalProperties_1 = additionalProperties;
|
|
87
|
-
patternInput = [Option_fromValueWithDefault(empty(), choose((tuple) => tuple[0], additionalProperties_1)), Option_fromValueWithDefault(empty(), choose((tuple_1) => tuple_1[1], additionalProperties_1))];
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
patternInput = [undefined, undefined];
|
|
91
|
-
}
|
|
79
|
+
let objectArg_5, objectArg_6, arg_15, objectArg_7;
|
|
92
80
|
let matchValue;
|
|
93
|
-
const
|
|
94
|
-
matchValue =
|
|
81
|
+
const objectArg = get$.Optional;
|
|
82
|
+
matchValue = objectArg.Field("additionalType", Decode_uri);
|
|
95
83
|
let matchResult;
|
|
96
84
|
if (matchValue == null) {
|
|
97
85
|
matchResult = 0;
|
|
@@ -104,12 +92,55 @@ export const ROCrate_decoder = object((get$) => {
|
|
|
104
92
|
}
|
|
105
93
|
switch (matchResult) {
|
|
106
94
|
case 1: {
|
|
107
|
-
const
|
|
108
|
-
|
|
95
|
+
const objectArg_1 = get$.Required;
|
|
96
|
+
objectArg_1.Field("FailBecauseNotSample", unit);
|
|
109
97
|
break;
|
|
110
98
|
}
|
|
111
99
|
}
|
|
112
|
-
|
|
100
|
+
let matchValue_1;
|
|
101
|
+
const arg_5 = list_6(string);
|
|
102
|
+
const objectArg_2 = get$.Optional;
|
|
103
|
+
matchValue_1 = objectArg_2.Field("@type", arg_5);
|
|
104
|
+
let matchResult_1;
|
|
105
|
+
if (matchValue_1 == null) {
|
|
106
|
+
matchResult_1 = 0;
|
|
107
|
+
}
|
|
108
|
+
else if (!isEmpty(matchValue_1)) {
|
|
109
|
+
if (head(matchValue_1) === "Sample") {
|
|
110
|
+
if (isEmpty(tail(matchValue_1))) {
|
|
111
|
+
matchResult_1 = 0;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
matchResult_1 = 1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
matchResult_1 = 1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
matchResult_1 = 1;
|
|
123
|
+
}
|
|
124
|
+
switch (matchResult_1) {
|
|
125
|
+
case 1: {
|
|
126
|
+
const objectArg_3 = get$.Required;
|
|
127
|
+
objectArg_3.Field("FailBecauseNotSample", unit);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
let additionalProperties;
|
|
132
|
+
const arg_9 = list_6(ROCrate_additionalPropertyDecoder);
|
|
133
|
+
const objectArg_4 = get$.Optional;
|
|
134
|
+
additionalProperties = objectArg_4.Field("additionalProperties", arg_9);
|
|
135
|
+
let patternInput;
|
|
136
|
+
if (additionalProperties != null) {
|
|
137
|
+
const additionalProperties_1 = additionalProperties;
|
|
138
|
+
patternInput = [Option_fromValueWithDefault(empty(), choose((tuple) => tuple[0], additionalProperties_1)), Option_fromValueWithDefault(empty(), choose((tuple_1) => tuple_1[1], additionalProperties_1))];
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
patternInput = [undefined, undefined];
|
|
142
|
+
}
|
|
143
|
+
return new Sample((objectArg_5 = get$.Optional, objectArg_5.Field("@id", Decode_uri)), (objectArg_6 = get$.Optional, objectArg_6.Field("name", string)), patternInput[0], patternInput[1], (arg_15 = list_6(ROCrate_decoder_3), (objectArg_7 = get$.Optional, objectArg_7.Field("derivesFrom", arg_15))));
|
|
113
144
|
});
|
|
114
145
|
|
|
115
146
|
export function ISAJson_encoder(idMap, oa) {
|
package/Json/Process/Source.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { replace } from "../../fable_modules/fable-library-js.4.22.0/String.js";
|
|
2
2
|
import { URIModule_toString } from "../../Core/URI.js";
|
|
3
|
-
import { ofArray, singleton, choose } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
3
|
+
import { tail, head, isEmpty, ofArray, singleton, choose } from "../../fable_modules/fable-library-js.4.22.0/List.js";
|
|
4
4
|
import { map } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
|
|
5
5
|
import { list as list_1 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
|
|
6
6
|
import { tryIncludeListOpt, tryInclude } from "../Encode.js";
|
|
7
7
|
import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_1, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_1 } from "./MaterialAttributeValue.js";
|
|
8
8
|
import { context_jsonvalue } from "../context/rocrate/isa_source_context.js";
|
|
9
9
|
import { map as map_1 } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
|
|
10
|
-
import { list as list_2,
|
|
10
|
+
import { string, list as list_2, unit, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
11
11
|
import { Decode_objectNoAdditionalProperties, Decode_uri } from "../Decode.js";
|
|
12
12
|
import { Source } from "../../Core/Process/Source.js";
|
|
13
13
|
import { encode } from "../IDTable.js";
|
|
@@ -56,7 +56,7 @@ export function ROCrate_encoder(oa) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export const ROCrate_decoder = object((get$) => {
|
|
59
|
-
let
|
|
59
|
+
let objectArg_4, objectArg_5, arg_13, objectArg_6;
|
|
60
60
|
let matchValue;
|
|
61
61
|
const objectArg = get$.Optional;
|
|
62
62
|
matchValue = objectArg.Field("additionalType", Decode_uri);
|
|
@@ -77,7 +77,38 @@ export const ROCrate_decoder = object((get$) => {
|
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
let matchValue_1;
|
|
81
|
+
const arg_5 = list_2(string);
|
|
82
|
+
const objectArg_2 = get$.Optional;
|
|
83
|
+
matchValue_1 = objectArg_2.Field("@type", arg_5);
|
|
84
|
+
let matchResult_1;
|
|
85
|
+
if (matchValue_1 == null) {
|
|
86
|
+
matchResult_1 = 0;
|
|
87
|
+
}
|
|
88
|
+
else if (!isEmpty(matchValue_1)) {
|
|
89
|
+
if (head(matchValue_1) === "Source") {
|
|
90
|
+
if (isEmpty(tail(matchValue_1))) {
|
|
91
|
+
matchResult_1 = 0;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
matchResult_1 = 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
matchResult_1 = 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
matchResult_1 = 1;
|
|
103
|
+
}
|
|
104
|
+
switch (matchResult_1) {
|
|
105
|
+
case 1: {
|
|
106
|
+
const objectArg_3 = get$.Required;
|
|
107
|
+
objectArg_3.Field("FailBecauseNotSample", unit);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return new Source((objectArg_4 = get$.Optional, objectArg_4.Field("@id", Decode_uri)), (objectArg_5 = get$.Optional, objectArg_5.Field("name", string)), (arg_13 = list_2(ROCrate_decoder_1), (objectArg_6 = get$.Optional, objectArg_6.Field("characteristics", arg_13))));
|
|
81
112
|
});
|
|
82
113
|
|
|
83
114
|
export function ISAJson_encoder(idMap, oa) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defaultArg, unwrap, map } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
|
|
1
|
+
import { defaultArg, bind, unwrap, map } from "../../fable_modules/fable-library-js.4.22.0/Option.js";
|
|
2
2
|
import { item } from "../../fable_modules/fable-library-js.4.22.0/Array.js";
|
|
3
3
|
import { CompositeCell } from "../../Core/Table/CompositeCell.js";
|
|
4
|
+
import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
4
5
|
|
|
5
6
|
export function termFromStringCells(tsrCol, tanCol, cellValues) {
|
|
6
7
|
const tan = map((i) => item(i, cellValues), tanCol);
|
|
@@ -20,8 +21,8 @@ export function freeTextFromStringCells(cellValues) {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export function dataFromStringCells(format, selectorFormat, cellValues) {
|
|
23
|
-
const format_1 =
|
|
24
|
-
const selectorFormat_1 =
|
|
24
|
+
const format_1 = bind((i) => Option_fromValueWithDefault("", item(i, cellValues)), format);
|
|
25
|
+
const selectorFormat_1 = bind((i_1) => Option_fromValueWithDefault("", item(i_1, cellValues)), selectorFormat);
|
|
25
26
|
return CompositeCell.createDataFromString(item(0, cellValues), unwrap(format_1), unwrap(selectorFormat_1));
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -2,7 +2,7 @@ import { tryItem, map, setItem, item, skip } from "../../fable_modules/fable-lib
|
|
|
2
2
|
import { CompositeHeader, IOType } from "../../Core/Table/CompositeHeader.js";
|
|
3
3
|
import { toString } from "../../fable_modules/fable-library-js.4.22.0/Types.js";
|
|
4
4
|
import { toStringCells, fromStringCells } from "./CompositeHeader.js";
|
|
5
|
-
import {
|
|
5
|
+
import { singleton, append, toList, exists, map as map_1, delay, toArray } from "../../fable_modules/fable-library-js.4.22.0/Seq.js";
|
|
6
6
|
import { rangeDouble } from "../../fable_modules/fable-library-js.4.22.0/Range.js";
|
|
7
7
|
import { CompositeColumn } from "../../Core/Table/CompositeColumn.js";
|
|
8
8
|
import { toStringCells as toStringCells_1 } from "./CompositeCell.js";
|
|
@@ -65,9 +65,7 @@ export function toStringCellColumns(column) {
|
|
|
65
65
|
return ofArray([toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i_4) => getCellOrDefault(i_4, 0, cells), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(1, header)), delay(() => map_1((i_5) => getCellOrDefault(i_5, 1, cells), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(2, header)), delay(() => map_1((i_6) => getCellOrDefault(i_6, 2, cells), rangeDouble(0, 1, column.Cells.length - 1))))))]);
|
|
66
66
|
}
|
|
67
67
|
else if (isData) {
|
|
68
|
-
|
|
69
|
-
const hasSelectorFormat = exists((c_3) => (c_3.ToDataCell().AsData.SelectorFormat != null), column.Cells);
|
|
70
|
-
return toList(delay(() => append(singleton(toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i_7) => getCellOrDefault(i_7, 0, cells), rangeDouble(0, 1, column.Cells.length - 1))))))), delay(() => append(hasFormat ? singleton(toList(delay(() => append(singleton(item(1, header)), delay(() => map_1((i_8) => getCellOrDefault(i_8, 1, cells), rangeDouble(0, 1, column.Cells.length - 1))))))) : empty(), delay(() => (hasSelectorFormat ? singleton(toList(delay(() => append(singleton(item(2, header)), delay(() => map_1((i_9) => getCellOrDefault(i_9, 2, cells), rangeDouble(0, 1, column.Cells.length - 1))))))) : empty())))))));
|
|
68
|
+
return ofArray([toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i_7) => getCellOrDefault(i_7, 0, cells), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(1, header)), delay(() => map_1((i_8) => getCellOrDefault(i_8, 1, cells), rangeDouble(0, 1, column.Cells.length - 1)))))), toList(delay(() => append(singleton(item(2, header)), delay(() => map_1((i_9) => getCellOrDefault(i_9, 2, cells), rangeDouble(0, 1, column.Cells.length - 1))))))]);
|
|
71
69
|
}
|
|
72
70
|
else {
|
|
73
71
|
return singleton_1(toList(delay(() => append(singleton(item(0, header)), delay(() => map_1((i_10) => item(0, item(i_10, cells)), rangeDouble(0, 1, column.Cells.length - 1)))))));
|
package/Spreadsheet/Template.js
CHANGED
|
@@ -261,6 +261,10 @@ export function Metadata_Template_toRows(template) {
|
|
|
261
261
|
return delay(() => append(singleton(SparseRowModule_fromValues(["TEMPLATE"])), delay(() => append(Metadata_Template_TemplateInfo_toRows_48C39BE1(template), delay(() => append(singleton(SparseRowModule_fromValues(["ERS"])), delay(() => append(Metadata_ER_toRows(undefined, toList(template.EndpointRepositories)), delay(() => append(singleton(SparseRowModule_fromValues(["TAGS"])), delay(() => append(Metadata_Tags_toRows(undefined, toList(template.Tags)), delay(() => append(singleton(SparseRowModule_fromValues(["AUTHORS"])), delay(() => toRows_1("Author", ofSeq(template.Authors)))))))))))))))));
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
export const Template_metadataSheetName = "isa_template";
|
|
265
|
+
|
|
266
|
+
export const Template_obsoleteMetadataSheetName = "SwateTemplateMetadata";
|
|
267
|
+
|
|
264
268
|
export function Template_fromParts(templateInfo, ers, tags, authors, table, lastUpdated) {
|
|
265
269
|
const id = parse(templateInfo.Id);
|
|
266
270
|
const organisation = Organisation.ofString(templateInfo.Organisation);
|
|
@@ -271,11 +275,11 @@ export function Template_fromParts(templateInfo, ers, tags, authors, table, last
|
|
|
271
275
|
}
|
|
272
276
|
|
|
273
277
|
export function Template_isMetadataSheetName(name) {
|
|
274
|
-
if (name ===
|
|
278
|
+
if (name === Template_metadataSheetName) {
|
|
275
279
|
return true;
|
|
276
280
|
}
|
|
277
281
|
else {
|
|
278
|
-
return name ===
|
|
282
|
+
return name === Template_obsoleteMetadataSheetName;
|
|
279
283
|
}
|
|
280
284
|
}
|
|
281
285
|
|
|
@@ -288,7 +292,7 @@ export function Template_tryGetMetadataSheet(doc) {
|
|
|
288
292
|
}
|
|
289
293
|
|
|
290
294
|
export function Template_toMetadataSheet(template) {
|
|
291
|
-
const sheet = new FsWorksheet(
|
|
295
|
+
const sheet = new FsWorksheet(Template_metadataSheetName);
|
|
292
296
|
iterateIndexed((rowI, r) => {
|
|
293
297
|
SparseRowModule_writeToSheet(rowI + 1, r, sheet);
|
|
294
298
|
}, Metadata_Template_toRows(template));
|