@nfdi4plants/arctrl 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARC.js +103 -12
- package/CWL/CWLTypes.js +2 -2
- package/CWL/Decode.js +2 -2
- package/CWL/Inputs.js +2 -2
- package/CWL/Outputs.js +2 -2
- package/CWL/Requirements.js +2 -2
- package/CWL/ToolDescription.js +1 -1
- package/CWL/WorkflowDescription.js +1 -1
- package/CWL/WorkflowSteps.js +1 -1
- package/ColumnIndex.js +258 -0
- package/Conversion.js +1679 -0
- package/Core/Data.js +28 -3
- package/Core/DataFile.js +19 -3
- package/Core/Helper/Collections.js +107 -4
- package/Core/Helper/DateTime.js +17 -0
- package/Core/Helper/ORCID.js +39 -0
- package/Json/Decode.js +3 -3
- package/Json/Encode.js +9 -0
- package/Json/OntologySourceReference.js +4 -4
- package/Json/ROCrate/LDContext.js +121 -0
- package/Json/ROCrate/LDGraph.js +87 -0
- package/Json/{LDObject.js → ROCrate/LDNode.js} +55 -46
- package/Json/ROCrate/LDRef.js +25 -0
- package/Json/ROCrate/LDValue.js +66 -0
- package/JsonIO/LDObject.js +30 -5
- package/ROCrate/ArcROCrateMetadata.js +14 -13
- package/ROCrate/Generic/Comment.js +115 -0
- package/ROCrate/Generic/Dataset.js +669 -0
- package/ROCrate/Generic/DefinedTerm.js +115 -0
- package/ROCrate/Generic/File.js +200 -0
- package/ROCrate/Generic/LabProcess.js +238 -0
- package/ROCrate/Generic/LabProtocol.js +275 -0
- package/ROCrate/Generic/Organization.js +71 -0
- package/ROCrate/Generic/Person.js +411 -0
- package/ROCrate/Generic/PostalAddress.js +159 -0
- package/ROCrate/Generic/PropertyValue.js +548 -0
- package/ROCrate/Generic/Sample.js +139 -0
- package/ROCrate/Generic/ScholarlyArticle.js +187 -0
- package/ROCrate/Helper.js +6 -0
- package/ROCrate/ISAProfile/Assay.js +3 -3
- package/ROCrate/ISAProfile/Data.js +7 -7
- package/ROCrate/ISAProfile/Dataset.js +7 -6
- package/ROCrate/ISAProfile/Investigation.js +3 -3
- package/ROCrate/ISAProfile/LabProcess.js +7 -7
- package/ROCrate/ISAProfile/LabProtocol.js +7 -7
- package/ROCrate/ISAProfile/Person.js +7 -7
- package/ROCrate/ISAProfile/PropertyValue.js +7 -7
- package/ROCrate/ISAProfile/Sample.js +7 -7
- package/ROCrate/ISAProfile/ScholarlyArticle.js +7 -7
- package/ROCrate/ISAProfile/Study.js +3 -3
- package/ROCrate/LDContext.js +283 -0
- package/ROCrate/LDObject.js +902 -36
- package/ROCrate/ROCrateContext.js +44 -0
- package/ROCrateIO.js +62 -0
- package/Spreadsheet/DataMapTable/DataMapHeader.js +3 -2
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs +31 -1
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs.js +30 -1
- package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs +1025 -0
- package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +433 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs +16 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FablePy.fs +14 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs +15 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs.js +4 -0
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/DynamicObj.AssemblyInfo.fs +1 -1
- package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/DynamicObj.AssemblyInfo.fs +3 -3
- package/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
- package/Json/ARC.js +0 -31
- package/JsonIO/ARC.js +0 -31
- package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs +0 -310
- package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js +0 -166
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynamicObj.fableproj +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs.js +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs.js +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs.js +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
- /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
package/ROCrateIO.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { class_type } from "./fable_modules/fable-library-js.4.24.0/Reflection.js";
|
|
2
|
+
import { LDRef, LDNode } from "./ROCrate/LDObject.js";
|
|
3
|
+
import { unwrap, value } from "./fable_modules/fable-library-js.4.24.0/Option.js";
|
|
4
|
+
import { ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateInvestigation_Static_Z6839B9E8, ARCtrl_ArcInvestigation__ArcInvestigation_ToROCrateInvestigation } from "./Conversion.js";
|
|
5
|
+
import { LDDataset } from "./ROCrate/Generic/Dataset.js";
|
|
6
|
+
import { now } from "./fable_modules/fable-library-js.4.24.0/Date.js";
|
|
7
|
+
import { LDContext } from "./ROCrate/LDContext.js";
|
|
8
|
+
import { initBioschemasContext, initV1_1 } from "./ROCrate/ROCrateContext.js";
|
|
9
|
+
import { decoder, encoder } from "./Json/ROCrate/LDGraph.js";
|
|
10
|
+
import { map } from "./fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
|
|
11
|
+
import { exactlyOne } from "./fable_modules/fable-library-js.4.24.0/Seq.js";
|
|
12
|
+
import { decoder as decoder_1 } from "./Json/ROCrate/LDNode.js";
|
|
13
|
+
|
|
14
|
+
export class ROCrate {
|
|
15
|
+
constructor() {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function ROCrate_$reflection() {
|
|
20
|
+
return class_type("ARCtrl.Json.ARC.ROCrate", undefined, ROCrate);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function ROCrate_getDefaultLicense() {
|
|
24
|
+
return "ALL RIGHTS RESERVED BY THE AUTHORS";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function ROCrate_get_metadataFileDescriptor() {
|
|
28
|
+
const node = new LDNode("ro-crate-metadata.json", ["http://schema.org/CreativeWork"]);
|
|
29
|
+
node.SetProperty("http://purl.org/dc/terms/conformsTo", new LDRef("https://w3id.org/ro/crate/1.1"));
|
|
30
|
+
node.SetProperty("http://schema.org/about", new LDRef("./"));
|
|
31
|
+
return node;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function ROCrate_encoder_8A8D439(isa, license) {
|
|
35
|
+
const license_2 = (license == null) ? ROCrate_getDefaultLicense() : value(license);
|
|
36
|
+
const isa_1 = ARCtrl_ArcInvestigation__ArcInvestigation_ToROCrateInvestigation(isa);
|
|
37
|
+
LDDataset.setSDDatePublishedAsDateTime(isa_1, now());
|
|
38
|
+
LDDataset.setLicenseAsCreativeWork(isa_1, license_2);
|
|
39
|
+
const graph = isa_1.Flatten();
|
|
40
|
+
const context = new LDContext(undefined, [initV1_1(), initBioschemasContext()]);
|
|
41
|
+
graph.SetContext(context);
|
|
42
|
+
graph.AddNode(ROCrate_get_metadataFileDescriptor());
|
|
43
|
+
graph.Compact_InPlace();
|
|
44
|
+
return encoder(graph);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function ROCrate_get_decoder() {
|
|
48
|
+
return map((graph) => {
|
|
49
|
+
const matchValue = graph.TryGetNode("./");
|
|
50
|
+
if (matchValue == null) {
|
|
51
|
+
throw new Error("RO-Crate graph did not contain root data Entity");
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateInvestigation_Static_Z6839B9E8(matchValue, graph, unwrap(graph.TryGetContext()));
|
|
55
|
+
}
|
|
56
|
+
}, decoder);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function ROCrate_get_decoderDeprecated() {
|
|
60
|
+
return map((ldnode) => ARCtrl_ArcInvestigation__ArcInvestigation_fromROCrateInvestigation_Static_Z6839B9E8(exactlyOne(LDDataset.getAbouts(ldnode)), undefined, initV1_1()), decoder_1);
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -3,6 +3,7 @@ import { unwrap, map as map_1 } from "../../fable_modules/fable-library-js.4.24.
|
|
|
3
3
|
import { OntologyAnnotation } from "../../Core/OntologyAnnotation.js";
|
|
4
4
|
import { Data } from "../../Core/Data.js";
|
|
5
5
|
import { DataContext__set_GeneratedBy_6DFDD678, DataContext__set_Description_6DFDD678, DataContext__set_ObjectType_279AAFF2, DataContext__set_Unit_279AAFF2, DataContext__set_Explication_279AAFF2 } from "../../Core/DataContext.js";
|
|
6
|
+
import { Option_fromValueWithDefault } from "../../Core/Helper/Collections.js";
|
|
6
7
|
import { Comment$ } from "../../Core/Comment.js";
|
|
7
8
|
import { ActivePatterns_$007CComment$007C_$007C } from "../../Core/Helper/Regex.js";
|
|
8
9
|
import { printf, toFail, join } from "../../fable_modules/fable-library-js.4.24.0/String.js";
|
|
@@ -234,7 +235,7 @@ export function ActivePattern_$007CDescription$007C_$007C(cells) {
|
|
|
234
235
|
switch (matchResult) {
|
|
235
236
|
case 0:
|
|
236
237
|
return (dc) => ((cells_1) => {
|
|
237
|
-
DataContext__set_Description_6DFDD678(dc, ActivePattern_freeTextFromFsCells(cells_1));
|
|
238
|
+
DataContext__set_Description_6DFDD678(dc, Option_fromValueWithDefault("", ActivePattern_freeTextFromFsCells(cells_1)));
|
|
238
239
|
return dc;
|
|
239
240
|
});
|
|
240
241
|
default:
|
|
@@ -264,7 +265,7 @@ export function ActivePattern_$007CGeneratedBy$007C_$007C(cells) {
|
|
|
264
265
|
switch (matchResult) {
|
|
265
266
|
case 0:
|
|
266
267
|
return (dc) => ((cells_1) => {
|
|
267
|
-
DataContext__set_GeneratedBy_6DFDD678(dc, ActivePattern_freeTextFromFsCells(cells_1));
|
|
268
|
+
DataContext__set_GeneratedBy_6DFDD678(dc, Option_fromValueWithDefault("", ActivePattern_freeTextFromFsCells(cells_1)));
|
|
268
269
|
return dc;
|
|
269
270
|
});
|
|
270
271
|
default:
|
|
@@ -216,4 +216,34 @@ module DynObj =
|
|
|
216
216
|
/// Prints a formatted string containing all static and dynamic properties of the given DynamicObj
|
|
217
217
|
/// </summary>
|
|
218
218
|
/// <param name="dynObj">The DynamicObj for which to print a formatted string for</param>
|
|
219
|
-
let print (dynObj:DynamicObj) = printfn "%s" (dynObj |> format)
|
|
219
|
+
let print (dynObj:DynamicObj) = printfn "%s" (dynObj |> format)
|
|
220
|
+
|
|
221
|
+
/// <summary>
|
|
222
|
+
/// function to deep copy a boxed object (if possible)
|
|
223
|
+
///
|
|
224
|
+
/// The following cases are handled (in this precedence):
|
|
225
|
+
///
|
|
226
|
+
/// - Basic F# types (`bool`, `byte`, `sbyte`, `int16`, `uint16`, `int`, `uint`, `int64`, `uint64`, `nativeint`, `unativeint`, `float`, `float32`, `char`, `string`, `unit`, `decimal`)
|
|
227
|
+
///
|
|
228
|
+
/// - `ResizeArrays` and `Dictionaries` containing any combination of basic F# types
|
|
229
|
+
///
|
|
230
|
+
/// - `Dictionaries` containing `DynamicObj` as keys or values in any combination with `DynamicObj` or basic F# types as keys or values
|
|
231
|
+
///
|
|
232
|
+
/// - `array<DynamicObj>`, `list<DynamicObj>`, `ResizeArray<DynamicObj>`: These collections of DynamicObj are copied as a new collection with recursively deep copied elements.
|
|
233
|
+
///
|
|
234
|
+
/// - `System.ICloneable`: If the property implements `ICloneable`, the `Clone()` method is called on the property.
|
|
235
|
+
///
|
|
236
|
+
/// - `DynamicObj` (and derived classes): properties that are themselves `DynamicObj` instances are deep copied recursively.
|
|
237
|
+
/// if a derived class has static properties (e.g. instance properties), these can be copied as dynamic properties on the new instance or ignored.
|
|
238
|
+
///
|
|
239
|
+
/// Note on Classes that inherit from `DynamicObj`:
|
|
240
|
+
///
|
|
241
|
+
/// Classes that inherit from DynamicObj will match the `DynamicObj` typecheck if they do not implement `ICloneable`.
|
|
242
|
+
/// The deep copied instances will be cast to `DynamicObj` with deep copied dynamic properties. Staic/instance properties can be copied as dynamic properties on the new instance or be ignored.
|
|
243
|
+
/// It should be possible to 'recover' the original type by checking if the needed properties exist as dynamic properties,
|
|
244
|
+
/// and then passing them to the class constructor if needed.
|
|
245
|
+
/// </summary>
|
|
246
|
+
/// <param name="o">The object that should be deep copied</param>
|
|
247
|
+
/// <param name="includeInstanceProperties">Whether to include instance properties (= 'static' properties on the class) as dynamic properties on the new instance for matched DynamicObj.</param>
|
|
248
|
+
let tryDeepCopyObj (includeInstanceProperties:bool) (o:DynamicObj) =
|
|
249
|
+
CopyUtils.tryDeepCopyObj(o, includeInstanceProperties)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicObj } from "./DynamicObj.fs.js";
|
|
1
|
+
import { CopyUtils_tryDeepCopyObj_75B3D832, DynamicObj } from "./DynamicObj.fs.js";
|
|
2
2
|
import { disposeSafe, getEnumerator } from "../fable-library-js.4.24.0/Util.js";
|
|
3
3
|
import { value as value_1 } from "../fable-library-js.4.24.0/Option.js";
|
|
4
4
|
import { printf, toConsole, join } from "../fable-library-js.4.24.0/String.js";
|
|
@@ -163,3 +163,32 @@ export function print(dynObj) {
|
|
|
163
163
|
toConsole(printf("%s"))(arg);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* function to deep copy a boxed object (if possible)
|
|
168
|
+
*
|
|
169
|
+
* The following cases are handled (in this precedence):
|
|
170
|
+
*
|
|
171
|
+
* - Basic F# types (`bool`, `byte`, `sbyte`, `int16`, `uint16`, `int`, `uint`, `int64`, `uint64`, `nativeint`, `unativeint`, `float`, `float32`, `char`, `string`, `unit`, `decimal`)
|
|
172
|
+
*
|
|
173
|
+
* - `ResizeArrays` and `Dictionaries` containing any combination of basic F# types
|
|
174
|
+
*
|
|
175
|
+
* - `Dictionaries` containing `DynamicObj` as keys or values in any combination with `DynamicObj` or basic F# types as keys or values
|
|
176
|
+
*
|
|
177
|
+
* - `array<DynamicObj>`, `list<DynamicObj>`, `ResizeArray<DynamicObj>`: These collections of DynamicObj are copied as a new collection with recursively deep copied elements.
|
|
178
|
+
*
|
|
179
|
+
* - `System.ICloneable`: If the property implements `ICloneable`, the `Clone()` method is called on the property.
|
|
180
|
+
*
|
|
181
|
+
* - `DynamicObj` (and derived classes): properties that are themselves `DynamicObj` instances are deep copied recursively.
|
|
182
|
+
* if a derived class has static properties (e.g. instance properties), these can be copied as dynamic properties on the new instance or ignored.
|
|
183
|
+
*
|
|
184
|
+
* Note on Classes that inherit from `DynamicObj`:
|
|
185
|
+
*
|
|
186
|
+
* Classes that inherit from DynamicObj will match the `DynamicObj` typecheck if they do not implement `ICloneable`.
|
|
187
|
+
* The deep copied instances will be cast to `DynamicObj` with deep copied dynamic properties. Staic/instance properties can be copied as dynamic properties on the new instance or be ignored.
|
|
188
|
+
* It should be possible to 'recover' the original type by checking if the needed properties exist as dynamic properties,
|
|
189
|
+
* and then passing them to the class constructor if needed.
|
|
190
|
+
*/
|
|
191
|
+
export function tryDeepCopyObj(includeInstanceProperties, o) {
|
|
192
|
+
return CopyUtils_tryDeepCopyObj_75B3D832(o, includeInstanceProperties);
|
|
193
|
+
}
|
|
194
|
+
|