@nfdi4plants/arctrl 3.0.0-alpha.3 → 3.0.0-alpha.4
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/README.md +9 -9
- package/dist/ts/cjs/ts/Conversion.js +11 -10
- package/dist/ts/cjs/ts/Core/Helper/Collections.js +15 -0
- package/dist/ts/cjs/ts/Core/Table/ArcTableAux.js +39 -8
- package/dist/ts/cjs/ts/Json/StringTable.js +9 -2
- package/dist/ts/cjs/ts/Json/Table/CellTable.js +2 -2
- package/dist/ts/cjs/ts/Json/Table/OATable.js +2 -2
- package/dist/ts/cjs/ts/JsonIO/Table/Compression.js +4 -11
- package/dist/ts/cjs/ts/ROCrate/Generic/LabProcess.js +1 -1
- package/dist/ts/cjs/ts/ROCrate/LDContext.js +92 -54
- package/dist/ts/esm/ts/Conversion.js +9 -8
- package/dist/ts/esm/ts/Core/Helper/Collections.js +12 -0
- package/dist/ts/esm/ts/Core/Table/ArcTableAux.js +36 -8
- package/dist/ts/esm/ts/Json/StringTable.js +10 -3
- package/dist/ts/esm/ts/Json/Table/CellTable.js +2 -2
- package/dist/ts/esm/ts/Json/Table/OATable.js +2 -2
- package/dist/ts/esm/ts/JsonIO/Table/Compression.js +4 -11
- package/dist/ts/esm/ts/ROCrate/Generic/LabProcess.js +1 -1
- package/dist/ts/esm/ts/ROCrate/LDContext.js +106 -66
- package/dist/ts/types/ts/Conversion.d.ts +3 -3
- package/dist/ts/types/ts/Conversion.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts +3 -0
- package/dist/ts/types/ts/Core/Helper/Collections.d.ts.map +1 -1
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts +5 -2
- package/dist/ts/types/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/StringTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Table/CellTable.d.ts.map +1 -1
- package/dist/ts/types/ts/Json/Table/OATable.d.ts.map +1 -1
- package/dist/ts/types/ts/JsonIO/Table/Compression.d.ts.map +1 -1
- package/dist/ts/types/ts/ROCrate/LDContext.d.ts +3 -5
- package/dist/ts/types/ts/ROCrate/LDContext.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -767,7 +767,7 @@ export function ProcessConversion_tryGetPerformerGetter(generalI, header) {
|
|
|
767
767
|
/**
|
|
768
768
|
* Given the header sequence of an ArcTable, returns a function for parsing each row of the table to a process
|
|
769
769
|
*/
|
|
770
|
-
export function ProcessConversion_getProcessGetter(processNameRoot, headers) {
|
|
770
|
+
export function ProcessConversion_getProcessGetter(assayName, studyName, processNameRoot, headers) {
|
|
771
771
|
const headers_1 = indexed(headers);
|
|
772
772
|
const valueHeaders = toList(indexed(filter((arg) => arg[1].IsCvParamColumn, headers_1)));
|
|
773
773
|
const charGetters = choose((tupledArg) => {
|
|
@@ -846,6 +846,7 @@ export function ProcessConversion_getProcessGetter(processNameRoot, headers) {
|
|
|
846
846
|
const paramvalues = map((collection_4) => Array.from(collection_4), Option_fromValueWithDefault(empty(), map_2((f_4) => f_4(matrix_6)(i_6), parameterValueGetters)));
|
|
847
847
|
const comments = map((collection_5) => Array.from(collection_5), Option_fromValueWithDefault(empty(), map_2((f_5) => f_5(matrix_6)(i_6), commentGetters)));
|
|
848
848
|
const components = map((collection_6) => Array.from(collection_6), Option_fromValueWithDefault(empty(), map_2((f_6) => f_6(matrix_6)(i_6), componentGetters)));
|
|
849
|
+
const id = LDLabProcess.genId(processNameRoot, unwrap(assayName), unwrap(studyName)) + (`_${i_6}`);
|
|
849
850
|
let protocol;
|
|
850
851
|
const name = map((f_7) => f_7(matrix_6)(i_6), protocolREFGetter);
|
|
851
852
|
const protocolId = LDLabProtocol.genId(unwrap(name), processNameRoot);
|
|
@@ -853,7 +854,7 @@ export function ProcessConversion_getProcessGetter(processNameRoot, headers) {
|
|
|
853
854
|
const matchValue_2 = inputGetter_1(matrix_6)(i_6);
|
|
854
855
|
const matchValue_3 = outputGetter_1(matrix_6)(i_6);
|
|
855
856
|
const agent = map((f_12) => f_12(matrix_6)(i_6), performerGetter);
|
|
856
|
-
return LDLabProcess.create(pn, matchValue_2, matchValue_3,
|
|
857
|
+
return LDLabProcess.create(pn, matchValue_2, matchValue_3, id, unwrap(agent), unwrap(protocol), unwrap(paramvalues), undefined, unwrap(comments));
|
|
857
858
|
});
|
|
858
859
|
}
|
|
859
860
|
/**
|
|
@@ -1179,12 +1180,12 @@ export function ARCtrl_ArcTable__ArcTable_GetProtocols(this$) {
|
|
|
1179
1180
|
/**
|
|
1180
1181
|
* Returns the list of processes specidified in this ArcTable
|
|
1181
1182
|
*/
|
|
1182
|
-
export function
|
|
1183
|
+
export function ARCtrl_ArcTable__ArcTable_GetProcesses_40457300(this$, assayName, studyName) {
|
|
1183
1184
|
if (this$.RowCount === 0) {
|
|
1184
1185
|
return singleton_2(LDLabProcess.create(this$.Name));
|
|
1185
1186
|
}
|
|
1186
1187
|
else {
|
|
1187
|
-
const getter = ProcessConversion_getProcessGetter(this$.Name, this$.Headers);
|
|
1188
|
+
const getter = ProcessConversion_getProcessGetter(assayName, studyName, this$.Name, this$.Headers);
|
|
1188
1189
|
return toList(delay(() => map_1((i) => getter(this$.Values)(i), rangeDouble(0, 1, this$.RowCount - 1))));
|
|
1189
1190
|
}
|
|
1190
1191
|
}
|
|
@@ -1202,8 +1203,8 @@ export function ARCtrl_ArcTable__ArcTable_fromProcesses_Static_Z3575FB5F(name, p
|
|
|
1202
1203
|
/**
|
|
1203
1204
|
* Return a list of all the processes in all the tables.
|
|
1204
1205
|
*/
|
|
1205
|
-
export function
|
|
1206
|
-
return collect(
|
|
1206
|
+
export function ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(this$, assayName, studyName) {
|
|
1207
|
+
return collect((t) => ARCtrl_ArcTable__ArcTable_GetProcesses_40457300(t, unwrap(assayName), unwrap(studyName)), toList(this$.Tables));
|
|
1207
1208
|
}
|
|
1208
1209
|
/**
|
|
1209
1210
|
* Create a collection of tables from a list of processes.
|
|
@@ -1453,7 +1454,7 @@ export function AssayConversion_composeAssay_1501C0F8(assay) {
|
|
|
1453
1454
|
const measurementTechnique = map(BaseTypes_composeDefinedTerm_ZDED3A0F, assay.TechnologyPlatform);
|
|
1454
1455
|
const variableMeasured = map(BaseTypes_composePropertyValueFromOA_ZDED3A0F, assay.MeasurementType);
|
|
1455
1456
|
const creators = Option_fromSeq(ResizeArray_map(PersonConversion_composePerson_Z64D846DC, assay.Performers));
|
|
1456
|
-
const processSequence = Option_fromSeq((collection =
|
|
1457
|
+
const processSequence = Option_fromSeq((collection = ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(new ArcTables(assay.Tables), assay.Identifier), Array.from(collection)));
|
|
1457
1458
|
const fragmentDescriptors = map(DatamapConversion_composeFragmentDescriptors_Z8923FA3, assay.DataMap);
|
|
1458
1459
|
const dataFiles = map((ps) => AssayConversion_getDataFilesFromProcesses_6BABD1B0(ps, unwrap(fragmentDescriptors)), processSequence);
|
|
1459
1460
|
const variableMeasureds = (variableMeasured == null) ? ((fragmentDescriptors == null) ? undefined : ((fds_1 = value_4(fragmentDescriptors), fds_1))) : ((fragmentDescriptors == null) ? ((vm_1 = value_4(variableMeasured), ResizeArray_singleton(vm_1))) : ((fds = value_4(fragmentDescriptors), (vm = value_4(variableMeasured), ResizeArray_appendSingleton(vm, fds)))));
|
|
@@ -1486,7 +1487,7 @@ export function StudyConversion_composeStudy_1680536E(study) {
|
|
|
1486
1487
|
const dateModified = now();
|
|
1487
1488
|
const publications = Option_fromSeq(ResizeArray_map(ScholarlyArticleConversion_composeScholarlyArticle_D324A6D, study.Publications));
|
|
1488
1489
|
const creators = Option_fromSeq(ResizeArray_map(PersonConversion_composePerson_Z64D846DC, study.Contacts));
|
|
1489
|
-
const processSequence = Option_fromSeq((collection =
|
|
1490
|
+
const processSequence = Option_fromSeq((collection = ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(new ArcTables(study.Tables), undefined, study.Identifier), Array.from(collection)));
|
|
1490
1491
|
const fragmentDescriptors = map(DatamapConversion_composeFragmentDescriptors_Z8923FA3, study.DataMap);
|
|
1491
1492
|
const dataFiles = map((ps) => AssayConversion_getDataFilesFromProcesses_6BABD1B0(ps, unwrap(fragmentDescriptors)), processSequence);
|
|
1492
1493
|
const comments = Option_fromSeq(ResizeArray_map(BaseTypes_composeComment_Z13201A7E, study.Comments));
|
|
@@ -123,6 +123,18 @@ export function Dictionary_ofSeqWithMerge(merge, s) {
|
|
|
123
123
|
}, s);
|
|
124
124
|
return dict;
|
|
125
125
|
}
|
|
126
|
+
export function Dictionary_init() {
|
|
127
|
+
return new Dictionary([], {
|
|
128
|
+
Equals: equals,
|
|
129
|
+
GetHashCode: structuralHash,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export function Dictionary_items(dict) {
|
|
133
|
+
return dict;
|
|
134
|
+
}
|
|
135
|
+
export function StringDictionary_ofSeq(s) {
|
|
136
|
+
return new Map(s);
|
|
137
|
+
}
|
|
126
138
|
export function ResizeArray_create(i, v) {
|
|
127
139
|
const a = [];
|
|
128
140
|
if (i > 0) {
|
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { op_UnaryNegation_Int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
2
|
-
import {
|
|
3
|
-
import { arrayHash, equalArrays, numberHash, disposeSafe, getEnumerator, compare, equals, safeHash, comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
2
|
+
import { getItemFromDict, tryGetValue, addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
4
3
|
import { CompositeCell } from "./CompositeCell.js";
|
|
5
|
-
import {
|
|
4
|
+
import { numberHash, disposeSafe, getEnumerator, compare, equals, safeHash, comparePrimitives, defaultOf, arrayHash, equalArrays } from "@fable-org/fable-library-js/Util.js";
|
|
5
|
+
import { Dictionary } from "@fable-org/fable-library-js/MutableMap.js";
|
|
6
|
+
import { toString, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
6
7
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
8
|
+
import { toList, head as head_1, toArray, filter, tryFindIndex, maxBy } from "@fable-org/fable-library-js/Seq.js";
|
|
7
9
|
import { mapIndexed, pick, exists, ofSeq, empty, head, tail as tail_1, isEmpty, cons } from "@fable-org/fable-library-js/List.js";
|
|
8
10
|
import { printf, toConsole } from "@fable-org/fable-library-js/String.js";
|
|
9
|
-
import { List_tryPickAndRemove, Dictionary_tryFind } from "../Helper/Collections.js";
|
|
10
11
|
import { max } from "@fable-org/fable-library-js/Double.js";
|
|
11
12
|
import { setItem, item, map, iterateIndexed } from "@fable-org/fable-library-js/Array.js";
|
|
12
13
|
import { tryFind, ofArray } from "@fable-org/fable-library-js/Map.js";
|
|
13
14
|
import { Array_groupBy } from "@fable-org/fable-library-js/Seq2.js";
|
|
14
15
|
import { FSharpSet__Contains, ofArray as ofArray_1 } from "@fable-org/fable-library-js/Set.js";
|
|
15
|
-
import { toString } from "@fable-org/fable-library-js/Types.js";
|
|
16
16
|
import { rangeDouble } from "@fable-org/fable-library-js/Range.js";
|
|
17
|
-
import {
|
|
17
|
+
import { List_tryPickAndRemove } from "../Helper/Collections.js";
|
|
18
|
+
export function CellDictionary_addOrUpdate(key_, key__1, value, dict) {
|
|
19
|
+
const key = [key_, key__1];
|
|
20
|
+
if (dict.has(key)) {
|
|
21
|
+
dict.set(key, value);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
addToDict(dict, key, value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function CellDictionary_ofSeq(s) {
|
|
28
|
+
return new Dictionary(s, {
|
|
29
|
+
Equals: equalArrays,
|
|
30
|
+
GetHashCode: arrayHash,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function CellDictionary_tryFind(key_, key__1, dict) {
|
|
34
|
+
let patternInput;
|
|
35
|
+
let outArg = defaultOf();
|
|
36
|
+
patternInput = [tryGetValue(dict, [key_, key__1], new FSharpRef(() => outArg, (v) => {
|
|
37
|
+
outArg = v;
|
|
38
|
+
})), outArg];
|
|
39
|
+
if (patternInput[0]) {
|
|
40
|
+
return patternInput[1];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
18
46
|
export function getColumnCount(headers) {
|
|
19
47
|
return headers.length;
|
|
20
48
|
}
|
|
@@ -176,7 +204,7 @@ export function SanityChecks_validate(headers, values, raiseException) {
|
|
|
176
204
|
return isValid;
|
|
177
205
|
}
|
|
178
206
|
export function Unchecked_tryGetCellAt(column, row, cells) {
|
|
179
|
-
return
|
|
207
|
+
return CellDictionary_tryFind(column, row, cells);
|
|
180
208
|
}
|
|
181
209
|
/**
|
|
182
210
|
* Add or update a cell in the dictionary.
|
|
@@ -191,7 +219,7 @@ export function Unchecked_addCellAt(columnIndex, rowIndex, c, cells) {
|
|
|
191
219
|
addToDict(cells, [columnIndex, rowIndex], c);
|
|
192
220
|
}
|
|
193
221
|
export function Unchecked_moveCellTo(fromCol, fromRow, toCol, toRow, cells) {
|
|
194
|
-
const matchValue =
|
|
222
|
+
const matchValue = CellDictionary_tryFind(fromCol, fromRow, cells);
|
|
195
223
|
if (matchValue == null) {
|
|
196
224
|
}
|
|
197
225
|
else {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { item, map, setItem, fill } from "@fable-org/fable-library-js/Array.js";
|
|
2
2
|
import { iterate } from "@fable-org/fable-library-js/Seq.js";
|
|
3
|
+
import { defaultOf } from "@fable-org/fable-library-js/Util.js";
|
|
3
4
|
import { int, string, array as array_2 } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
4
|
-
import { Dictionary_tryFind } from "../Core/Helper/Collections.js";
|
|
5
5
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
6
|
-
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
6
|
+
import { addToDict, tryGetValue } from "@fable-org/fable-library-js/MapUtil.js";
|
|
7
|
+
import { FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
7
8
|
import { FSharpResult$2_Ok, FSharpResult$2_Error } from "@fable-org/fable-library-js/Result.js";
|
|
8
9
|
export function arrayFromMap(otm) {
|
|
9
10
|
const a = fill(new Array(otm.size), 0, otm.size, "");
|
|
@@ -27,7 +28,13 @@ export function encoder(ot) {
|
|
|
27
28
|
}
|
|
28
29
|
export const decoder = array_2(string);
|
|
29
30
|
export function encodeString(otm, s) {
|
|
30
|
-
|
|
31
|
+
let matchValue;
|
|
32
|
+
let patternInput;
|
|
33
|
+
let outArg = defaultOf();
|
|
34
|
+
patternInput = [tryGetValue(otm, s, new FSharpRef(() => outArg, (v) => {
|
|
35
|
+
outArg = (v | 0);
|
|
36
|
+
})), outArg];
|
|
37
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
31
38
|
if (matchValue == null) {
|
|
32
39
|
const i_1 = otm.size | 0;
|
|
33
40
|
addToDict(otm, s, i_1);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { sortBy, map, toArray } from "@fable-org/fable-library-js/Seq.js";
|
|
2
|
+
import { Dictionary_tryFind, Dictionary_items } from "../../Core/Helper/Collections.js";
|
|
2
3
|
import { comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
3
4
|
import { item, map as map_1 } from "@fable-org/fable-library-js/Array.js";
|
|
4
5
|
import { decoderCompressed, encoderCompressed } from "./CompositeCell.js";
|
|
5
6
|
import { int, object, array as array_2 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
6
|
-
import { Dictionary_tryFind } from "../../Core/Helper/Collections.js";
|
|
7
7
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
8
8
|
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
9
9
|
export function arrayFromMap(otm) {
|
|
10
|
-
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
|
|
10
|
+
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], Dictionary_items(otm), {
|
|
11
11
|
Compare: comparePrimitives,
|
|
12
12
|
})));
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { sortBy, map, toArray } from "@fable-org/fable-library-js/Seq.js";
|
|
2
|
+
import { Dictionary_tryFind, Dictionary_items } from "../../Core/Helper/Collections.js";
|
|
2
3
|
import { comparePrimitives } from "@fable-org/fable-library-js/Util.js";
|
|
3
4
|
import { item, map as map_1 } from "@fable-org/fable-library-js/Array.js";
|
|
4
5
|
import { OntologyAnnotation_compressedDecoder, OntologyAnnotation_compressedEncoder } from "../OntologyAnnotation.js";
|
|
5
6
|
import { int, object, array as array_2 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
6
|
-
import { Dictionary_tryFind } from "../../Core/Helper/Collections.js";
|
|
7
7
|
import { value as value_2 } from "@fable-org/fable-library-js/Option.js";
|
|
8
8
|
import { addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
9
9
|
export function arrayFromMap(otm) {
|
|
10
|
-
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], otm, {
|
|
10
|
+
return toArray(map((kv_1) => kv_1[0], sortBy((kv) => kv[1], Dictionary_items(otm), {
|
|
11
11
|
Compare: comparePrimitives,
|
|
12
12
|
})));
|
|
13
13
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dictionary } from "@fable-org/fable-library-js/MutableMap.js";
|
|
1
|
+
import { Dictionary_init } from "../../Core/Helper/Collections.js";
|
|
3
2
|
import { toString } from "../../fable_modules/Thoth.Json.JavaScript.0.3.0/Encode.fs.js";
|
|
4
3
|
import { decoder as decoder_3, arrayFromMap, encoder as encoder_1 } from "../../Json/Table/CellTable.js";
|
|
5
4
|
import { decoder as decoder_2, arrayFromMap as arrayFromMap_1, encoder as encoder_2 } from "../../Json/Table/OATable.js";
|
|
@@ -7,15 +6,9 @@ import { decoder as decoder_1, arrayFromMap as arrayFromMap_2, encoder as encode
|
|
|
7
6
|
import { map } from "@fable-org/fable-library-js/Seq.js";
|
|
8
7
|
import { object as object_1 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
9
8
|
export function encode(encoder, obj) {
|
|
10
|
-
const stringTable =
|
|
11
|
-
const oaTable =
|
|
12
|
-
|
|
13
|
-
GetHashCode: safeHash,
|
|
14
|
-
});
|
|
15
|
-
const cellTable = new Dictionary([], {
|
|
16
|
-
Equals: equals,
|
|
17
|
-
GetHashCode: safeHash,
|
|
18
|
-
});
|
|
9
|
+
const stringTable = Dictionary_init();
|
|
10
|
+
const oaTable = Dictionary_init();
|
|
11
|
+
const cellTable = Dictionary_init();
|
|
19
12
|
const object = encoder(stringTable, oaTable, cellTable, obj);
|
|
20
13
|
toString(0, object);
|
|
21
14
|
const values = [["cellTable", encoder_1(stringTable, oaTable, arrayFromMap(cellTable))], ["oaTable", encoder_2(stringTable, arrayFromMap_1(oaTable))], ["stringTable", encoder_3(arrayFromMap_2(stringTable))], ["object", object]];
|
|
@@ -212,7 +212,7 @@ export class LDLabProcess {
|
|
|
212
212
|
}
|
|
213
213
|
static genId(name, assayName, studyName) {
|
|
214
214
|
let study_1, assay_1, assay, study;
|
|
215
|
-
return clean((assayName == null) ? ((studyName != null) ? ((study_1 = value(studyName), `#
|
|
215
|
+
return clean((assayName == null) ? ((studyName != null) ? ((study_1 = value(studyName), `#Process_S_${study_1}_${name}`)) : (`#Process_${name}`)) : ((studyName == null) ? ((assay_1 = value(assayName), `#Process_A_${assay_1}_${name}`)) : ((assay = value(assayName), (study = value(studyName), `#Process_S_${study}_A_${assay}_${name}`)))));
|
|
216
216
|
}
|
|
217
217
|
static create(name, objects, results, id, agent, executesLabProtocol, parameterValues, endTime, disambiguatingDescriptions, context) {
|
|
218
218
|
const id_1 = (id == null) ? LDLabProcess.genId(name) : value(id);
|
|
@@ -1,42 +1,18 @@
|
|
|
1
|
-
import { Dictionary } from "@fable-org/fable-library-js/MutableMap.js";
|
|
2
|
-
import { stringHash, comparePrimitives, safeHash, disposeSafe, getEnumerator, defaultOf, structuralHash, equals } from "@fable-org/fable-library-js/Util.js";
|
|
3
|
-
import { tryPick, sort, map, reduce, iterate } from "@fable-org/fable-library-js/Seq.js";
|
|
4
|
-
import { getItemFromDict, tryGetValue, addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
5
|
-
import { toString, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
6
|
-
import { defaultArg, unwrap, value as value_1, some } from "@fable-org/fable-library-js/Option.js";
|
|
7
1
|
import { ActivePatterns_$007CRegex$007C_$007C } from "../Core/Helper/Regex.js";
|
|
2
|
+
import { defaultArg, unwrap, value as value_5 } from "@fable-org/fable-library-js/Option.js";
|
|
3
|
+
import { FSharpRef, toString } from "@fable-org/fable-library-js/Types.js";
|
|
8
4
|
import { Uri } from "@fable-org/fable-library-js/Uri.js";
|
|
9
|
-
import {
|
|
5
|
+
import { defaultOf, stringHash, comparePrimitives, safeHash, disposeSafe, getEnumerator } from "@fable-org/fable-library-js/Util.js";
|
|
6
|
+
import { tryGetValue, getItemFromDict, addToDict } from "@fable-org/fable-library-js/MapUtil.js";
|
|
7
|
+
import { tryPick, sort, map, reduce } from "@fable-org/fable-library-js/Seq.js";
|
|
8
|
+
import { StringDictionary_ofSeq } from "../Core/Helper/Collections.js";
|
|
10
9
|
import { hash as hash_2, mergeHashes, boxHashSeq } from "../Core/Helper/HashCodes.js";
|
|
11
10
|
import { class_type } from "@fable-org/fable-library-js/Reflection.js";
|
|
12
|
-
export function Dictionary_ofSeq(s) {
|
|
13
|
-
const dict = new Dictionary([], {
|
|
14
|
-
Equals: equals,
|
|
15
|
-
GetHashCode: structuralHash,
|
|
16
|
-
});
|
|
17
|
-
iterate((tupledArg) => {
|
|
18
|
-
addToDict(dict, tupledArg[0], tupledArg[1]);
|
|
19
|
-
}, s);
|
|
20
|
-
return dict;
|
|
21
|
-
}
|
|
22
|
-
export function Dictionary_tryFind(key, dict) {
|
|
23
|
-
let patternInput;
|
|
24
|
-
let outArg = defaultOf();
|
|
25
|
-
patternInput = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => {
|
|
26
|
-
outArg = v;
|
|
27
|
-
})), outArg];
|
|
28
|
-
if (patternInput[0]) {
|
|
29
|
-
return some(patternInput[1]);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
11
|
export const IRIHelper_compactIRIRegex = "(?<prefix>.*):(?<suffix>[^\\/][^\\/].*)";
|
|
36
12
|
export function IRIHelper_$007CCompactIri$007C_$007C(termDefition) {
|
|
37
13
|
const activePatternResult = ActivePatterns_$007CRegex$007C_$007C(IRIHelper_compactIRIRegex, termDefition);
|
|
38
14
|
if (activePatternResult != null) {
|
|
39
|
-
const result =
|
|
15
|
+
const result = value_5(activePatternResult);
|
|
40
16
|
return [(result.groups && result.groups.prefix) || "", (result.groups && result.groups.suffix) || ""];
|
|
41
17
|
}
|
|
42
18
|
else {
|
|
@@ -54,7 +30,7 @@ export function IRIHelper_combine(baseIRI, relative) {
|
|
|
54
30
|
export function IRIHelper_combineOptional(baseIRI, relative) {
|
|
55
31
|
if (baseIRI == null) {
|
|
56
32
|
if (relative != null) {
|
|
57
|
-
const r_1 =
|
|
33
|
+
const r_1 = value_5(relative);
|
|
58
34
|
return r_1;
|
|
59
35
|
}
|
|
60
36
|
else {
|
|
@@ -62,23 +38,23 @@ export function IRIHelper_combineOptional(baseIRI, relative) {
|
|
|
62
38
|
}
|
|
63
39
|
}
|
|
64
40
|
else if (relative == null) {
|
|
65
|
-
const b_1 =
|
|
41
|
+
const b_1 = value_5(baseIRI);
|
|
66
42
|
return b_1;
|
|
67
43
|
}
|
|
68
44
|
else {
|
|
69
|
-
const b =
|
|
70
|
-
const r =
|
|
45
|
+
const b = value_5(baseIRI);
|
|
46
|
+
const r = value_5(relative);
|
|
71
47
|
return IRIHelper_combine(b, r);
|
|
72
48
|
}
|
|
73
49
|
}
|
|
74
50
|
export class LDContext {
|
|
75
51
|
constructor(mappings, baseContexts) {
|
|
76
|
-
this["baseContexts@
|
|
52
|
+
this["baseContexts@41"] = defaultArg(baseContexts, []);
|
|
77
53
|
this.name = undefined;
|
|
78
|
-
this["mappings@
|
|
54
|
+
this["mappings@45"] = ((mappings == null) ? (new Map([])) : value_5(mappings));
|
|
79
55
|
this.reverseMappings = (new Map([]));
|
|
80
56
|
this.compactReverseMappings = (new Map([]));
|
|
81
|
-
let enumerator = getEnumerator(this["mappings@
|
|
57
|
+
let enumerator = getEnumerator(this["mappings@45"]);
|
|
82
58
|
try {
|
|
83
59
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
84
60
|
const kvp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -91,15 +67,15 @@ export class LDContext {
|
|
|
91
67
|
}
|
|
92
68
|
get Mappings() {
|
|
93
69
|
const this$ = this;
|
|
94
|
-
return this$["mappings@
|
|
70
|
+
return this$["mappings@45"];
|
|
95
71
|
}
|
|
96
72
|
get BaseContexts() {
|
|
97
73
|
const this$ = this;
|
|
98
|
-
return this$["baseContexts@
|
|
74
|
+
return this$["baseContexts@41"];
|
|
99
75
|
}
|
|
100
76
|
set BaseContexts(value) {
|
|
101
77
|
const this$ = this;
|
|
102
|
-
this$["baseContexts@
|
|
78
|
+
this$["baseContexts@41"] = value;
|
|
103
79
|
}
|
|
104
80
|
get Name() {
|
|
105
81
|
const this$ = this;
|
|
@@ -111,7 +87,15 @@ export class LDContext {
|
|
|
111
87
|
}
|
|
112
88
|
AddMapping(term, definition) {
|
|
113
89
|
const this$ = this;
|
|
114
|
-
|
|
90
|
+
const key = term;
|
|
91
|
+
const value = definition;
|
|
92
|
+
const dict = this$["mappings@45"];
|
|
93
|
+
if (dict.has(key)) {
|
|
94
|
+
dict.set(key, value);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
addToDict(dict, key, value);
|
|
98
|
+
}
|
|
115
99
|
this$.addReverseMapping(term, definition);
|
|
116
100
|
}
|
|
117
101
|
TryResolveTerm(term) {
|
|
@@ -131,11 +115,11 @@ export class LDContext {
|
|
|
131
115
|
else {
|
|
132
116
|
const p1Def = this$.TryResolveTerm(p1);
|
|
133
117
|
const p2Def = this$.TryResolveTerm(p2);
|
|
134
|
-
return (p1Def == null) ? ((p2Def != null) && ((p2Def_2 =
|
|
118
|
+
return (p1Def == null) ? ((p2Def != null) && ((p2Def_2 = value_5(p2Def), p1 === p2Def_2))) : ((p2Def == null) ? ((p1Def_2 = value_5(p1Def), p1Def_2 === p2)) : ((p1Def_1 = value_5(p1Def), (p2Def_1 = value_5(p2Def), p1Def_1 === p2Def_1))));
|
|
135
119
|
}
|
|
136
120
|
}
|
|
137
121
|
static fromMappingSeq(mappings) {
|
|
138
|
-
return new LDContext(
|
|
122
|
+
return new LDContext(StringDictionary_ofSeq(mappings));
|
|
139
123
|
}
|
|
140
124
|
static combine_InPlace(baseContext, specificContext) {
|
|
141
125
|
void (specificContext.BaseContexts.push(baseContext));
|
|
@@ -146,12 +130,12 @@ export class LDContext {
|
|
|
146
130
|
}
|
|
147
131
|
static tryCombineOptional(baseContext, specificContext) {
|
|
148
132
|
let s_1, f_1, f, s;
|
|
149
|
-
return (baseContext == null) ? ((specificContext != null) ? ((s_1 =
|
|
133
|
+
return (baseContext == null) ? ((specificContext != null) ? ((s_1 = value_5(specificContext), s_1)) : undefined) : ((specificContext == null) ? ((f_1 = value_5(baseContext), f_1)) : ((f = value_5(baseContext), (s = value_5(specificContext), LDContext.combine(f, s)))));
|
|
150
134
|
}
|
|
151
135
|
ShallowCopy() {
|
|
152
136
|
const this$ = this;
|
|
153
137
|
const newMappings = new Map([]);
|
|
154
|
-
let enumerator = getEnumerator(this$["mappings@
|
|
138
|
+
let enumerator = getEnumerator(this$["mappings@45"]);
|
|
155
139
|
try {
|
|
156
140
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
157
141
|
const kvp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -161,12 +145,12 @@ export class LDContext {
|
|
|
161
145
|
finally {
|
|
162
146
|
disposeSafe(enumerator);
|
|
163
147
|
}
|
|
164
|
-
return new LDContext(newMappings, this$["baseContexts@
|
|
148
|
+
return new LDContext(newMappings, this$["baseContexts@41"]);
|
|
165
149
|
}
|
|
166
150
|
DeepCopy() {
|
|
167
151
|
const this$ = this;
|
|
168
152
|
const newMappings = new Map([]);
|
|
169
|
-
let enumerator = getEnumerator(this$["mappings@
|
|
153
|
+
let enumerator = getEnumerator(this$["mappings@45"]);
|
|
170
154
|
try {
|
|
171
155
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
172
156
|
const kvp = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -177,7 +161,7 @@ export class LDContext {
|
|
|
177
161
|
disposeSafe(enumerator);
|
|
178
162
|
}
|
|
179
163
|
const newBaseContexts = [];
|
|
180
|
-
let enumerator_1 = getEnumerator(this$["baseContexts@
|
|
164
|
+
let enumerator_1 = getEnumerator(this$["baseContexts@41"]);
|
|
181
165
|
try {
|
|
182
166
|
while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
183
167
|
const ctx = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
@@ -209,8 +193,8 @@ export class LDContext {
|
|
|
209
193
|
}))) | 0;
|
|
210
194
|
let nameHash;
|
|
211
195
|
const matchValue = this$.Name;
|
|
212
|
-
nameHash = ((matchValue == null) ? 0 : stringHash(
|
|
213
|
-
const baseContextsHash = ((this$["baseContexts@
|
|
196
|
+
nameHash = ((matchValue == null) ? 0 : stringHash(value_5(matchValue)));
|
|
197
|
+
const baseContextsHash = ((this$["baseContexts@41"].length === 0) ? 0 : reduce(mergeHashes, map(safeHash, this$["baseContexts@41"]))) | 0;
|
|
214
198
|
return mergeHashes(mergeHashes(mappingsHash, nameHash), baseContextsHash) | 0;
|
|
215
199
|
}
|
|
216
200
|
"System.ICloneable.Clone"() {
|
|
@@ -219,26 +203,70 @@ export class LDContext {
|
|
|
219
203
|
}
|
|
220
204
|
addReverseMapping(key, value) {
|
|
221
205
|
const this$ = this;
|
|
222
|
-
|
|
206
|
+
const key_1 = value;
|
|
207
|
+
const value_1 = key;
|
|
208
|
+
const dict = this$.reverseMappings;
|
|
209
|
+
if (dict.has(key_1)) {
|
|
210
|
+
dict.set(key_1, value_1);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
addToDict(dict, key_1, value_1);
|
|
214
|
+
}
|
|
223
215
|
const activePatternResult = IRIHelper_$007CCompactIri$007C_$007C(value);
|
|
224
216
|
if (activePatternResult != null) {
|
|
225
|
-
const prefix =
|
|
226
|
-
const suffix =
|
|
227
|
-
|
|
228
|
-
const
|
|
217
|
+
const prefix = value_5(activePatternResult)[0];
|
|
218
|
+
const suffix = value_5(activePatternResult)[1];
|
|
219
|
+
const key_2 = prefix;
|
|
220
|
+
const value_2 = [suffix, key];
|
|
221
|
+
const dict_1 = this$.compactReverseMappings;
|
|
222
|
+
if (dict_1.has(key_2)) {
|
|
223
|
+
dict_1.set(key_2, value_2);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
addToDict(dict_1, key_2, value_2);
|
|
227
|
+
}
|
|
228
|
+
let matchValue;
|
|
229
|
+
let patternInput;
|
|
230
|
+
let outArg = defaultOf();
|
|
231
|
+
patternInput = [tryGetValue(this$["mappings@45"], prefix, new FSharpRef(() => outArg, (v) => {
|
|
232
|
+
outArg = v;
|
|
233
|
+
})), outArg];
|
|
234
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
229
235
|
if (matchValue == null) {
|
|
230
236
|
}
|
|
231
237
|
else {
|
|
232
|
-
|
|
238
|
+
const key_4 = IRIHelper_combine(value_5(matchValue), suffix);
|
|
239
|
+
const value_3 = key;
|
|
240
|
+
const dict_3 = this$.reverseMappings;
|
|
241
|
+
if (dict_3.has(key_4)) {
|
|
242
|
+
dict_3.set(key_4, value_3);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
addToDict(dict_3, key_4, value_3);
|
|
246
|
+
}
|
|
233
247
|
}
|
|
234
248
|
}
|
|
235
249
|
else {
|
|
236
|
-
|
|
250
|
+
let matchValue_1;
|
|
251
|
+
let patternInput_1;
|
|
252
|
+
let outArg_1 = defaultOf();
|
|
253
|
+
patternInput_1 = [tryGetValue(this$.compactReverseMappings, key, new FSharpRef(() => outArg_1, (v_2) => {
|
|
254
|
+
outArg_1 = v_2;
|
|
255
|
+
})), outArg_1];
|
|
256
|
+
matchValue_1 = (patternInput_1[0] ? patternInput_1[1] : undefined);
|
|
237
257
|
if (matchValue_1 == null) {
|
|
238
258
|
}
|
|
239
259
|
else {
|
|
240
|
-
const term =
|
|
241
|
-
|
|
260
|
+
const term = value_5(matchValue_1)[1];
|
|
261
|
+
const key_6 = IRIHelper_combine(value, value_5(matchValue_1)[0]);
|
|
262
|
+
const value_4 = term;
|
|
263
|
+
const dict_5 = this$.reverseMappings;
|
|
264
|
+
if (dict_5.has(key_6)) {
|
|
265
|
+
dict_5.set(key_6, value_4);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
addToDict(dict_5, key_6, value_4);
|
|
269
|
+
}
|
|
242
270
|
}
|
|
243
271
|
}
|
|
244
272
|
}
|
|
@@ -246,20 +274,32 @@ export class LDContext {
|
|
|
246
274
|
let prefix, suffix, d;
|
|
247
275
|
const this$ = this;
|
|
248
276
|
let definition;
|
|
249
|
-
|
|
250
|
-
|
|
277
|
+
let matchValue;
|
|
278
|
+
let patternInput;
|
|
279
|
+
let outArg = defaultOf();
|
|
280
|
+
patternInput = [tryGetValue(this$["mappings@45"], term, new FSharpRef(() => outArg, (v) => {
|
|
281
|
+
outArg = v;
|
|
282
|
+
})), outArg];
|
|
283
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
284
|
+
definition = ((matchValue == null) ? tryPick((ctx) => ctx.TryResolveTerm(term), this$["baseContexts@41"]) : value_5(matchValue));
|
|
251
285
|
if (definition == null) {
|
|
252
286
|
return undefined;
|
|
253
287
|
}
|
|
254
288
|
else {
|
|
255
|
-
const activePatternResult = IRIHelper_$007CCompactIri$007C_$007C(
|
|
256
|
-
return (activePatternResult != null) ? ((prefix =
|
|
289
|
+
const activePatternResult = IRIHelper_$007CCompactIri$007C_$007C(value_5(definition));
|
|
290
|
+
return (activePatternResult != null) ? ((prefix = value_5(activePatternResult)[0], (suffix = value_5(activePatternResult)[1], IRIHelper_combine((prefix === term) ? prefix : defaultArg(this$.tryFindTerm(prefix), prefix), (suffix === term) ? suffix : defaultArg(this$.tryFindTerm(suffix), suffix))))) : ((d = value_5(definition), d));
|
|
257
291
|
}
|
|
258
292
|
}
|
|
259
293
|
tryFindIri(iri) {
|
|
260
294
|
const this$ = this;
|
|
261
|
-
|
|
262
|
-
|
|
295
|
+
let matchValue;
|
|
296
|
+
let patternInput;
|
|
297
|
+
let outArg = defaultOf();
|
|
298
|
+
patternInput = [tryGetValue(this$.reverseMappings, iri, new FSharpRef(() => outArg, (v) => {
|
|
299
|
+
outArg = v;
|
|
300
|
+
})), outArg];
|
|
301
|
+
matchValue = (patternInput[0] ? patternInput[1] : undefined);
|
|
302
|
+
return (matchValue == null) ? tryPick((ctx) => ctx.TryGetTerm(iri), this$["baseContexts@41"]) : value_5(matchValue);
|
|
263
303
|
}
|
|
264
304
|
tryCompactIRI(iri) {
|
|
265
305
|
throw new Error("TryCompactIRI is Not implemented yet");
|
|
@@ -172,7 +172,7 @@ export declare function ProcessConversion_tryGetPerformerGetter(generalI: int32,
|
|
|
172
172
|
/**
|
|
173
173
|
* Given the header sequence of an ArcTable, returns a function for parsing each row of the table to a process
|
|
174
174
|
*/
|
|
175
|
-
export declare function ProcessConversion_getProcessGetter(processNameRoot: string, headers: Iterable<CompositeHeader_$union>): ((arg0: IMap<[int32, int32], CompositeCell_$union>) => ((arg0: int32) => LDNode));
|
|
175
|
+
export declare function ProcessConversion_getProcessGetter(assayName: Option<string>, studyName: Option<string>, processNameRoot: string, headers: Iterable<CompositeHeader_$union>): ((arg0: IMap<[int32, int32], CompositeCell_$union>) => ((arg0: int32) => LDNode));
|
|
176
176
|
/**
|
|
177
177
|
* Groups processes by their name, or by the name of the protocol they execute
|
|
178
178
|
*
|
|
@@ -199,7 +199,7 @@ export declare function ARCtrl_ArcTable__ArcTable_GetProtocols(this$: ArcTable):
|
|
|
199
199
|
/**
|
|
200
200
|
* Returns the list of processes specidified in this ArcTable
|
|
201
201
|
*/
|
|
202
|
-
export declare function
|
|
202
|
+
export declare function ARCtrl_ArcTable__ArcTable_GetProcesses_40457300(this$: ArcTable, assayName: Option<string>, studyName: Option<string>): FSharpList<LDNode>;
|
|
203
203
|
/**
|
|
204
204
|
* Create a new table from a list of processes
|
|
205
205
|
*
|
|
@@ -211,7 +211,7 @@ export declare function ARCtrl_ArcTable__ArcTable_fromProcesses_Static_Z3575FB5F
|
|
|
211
211
|
/**
|
|
212
212
|
* Return a list of all the processes in all the tables.
|
|
213
213
|
*/
|
|
214
|
-
export declare function
|
|
214
|
+
export declare function ARCtrl_ArcTables__ArcTables_GetProcesses_40457300(this$: ArcTables, assayName: Option<string>, studyName: Option<string>): FSharpList<LDNode>;
|
|
215
215
|
/**
|
|
216
216
|
* Create a collection of tables from a list of processes.
|
|
217
217
|
*
|