@nfdi4plants/arctrl 2.3.1 → 2.5.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.
- 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/Core/Table/ArcTable.js +6 -0
- package/Core/Table/CompositeHeader.js +4 -0
- package/Json/Assay.js +1 -1
- package/Json/Decode.js +3 -3
- package/Json/Encode.js +9 -0
- package/Json/Investigation.js +5 -4
- 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/Json/Study.js +5 -4
- package/Json/context/rocrate/isa_investigation_context.js +2 -2
- package/Json/context/rocrate/isa_study_context.js +15 -11
- package/Json/context/rocrate/rocrate_context.js +1 -1
- package/JsonIO/LDObject.js +30 -5
- package/README.md +12 -3
- 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/DataMap.js +11 -3
- package/Spreadsheet/DataMapTable/DataMapHeader.js +3 -2
- package/Xlsx.js +21 -8
- 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
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { value, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
|
|
2
|
+
import { clean } from "../Helper.js";
|
|
3
|
+
import { LDNode } from "../LDObject.js";
|
|
4
|
+
import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
|
|
5
|
+
|
|
6
|
+
export class LDDefinedTerm {
|
|
7
|
+
constructor() {
|
|
8
|
+
}
|
|
9
|
+
static get schemaType() {
|
|
10
|
+
return "http://schema.org/DefinedTerm";
|
|
11
|
+
}
|
|
12
|
+
static get termCode() {
|
|
13
|
+
return "http://schema.org/termCode";
|
|
14
|
+
}
|
|
15
|
+
static get name() {
|
|
16
|
+
return "http://schema.org/name";
|
|
17
|
+
}
|
|
18
|
+
static tryGetTermCodeAsString(dt, context) {
|
|
19
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDDefinedTerm.termCode, unwrap(context));
|
|
20
|
+
let matchResult, tc;
|
|
21
|
+
if (matchValue != null) {
|
|
22
|
+
if (typeof value(matchValue) === "string") {
|
|
23
|
+
matchResult = 0;
|
|
24
|
+
tc = value(matchValue);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
matchResult = 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
matchResult = 1;
|
|
32
|
+
}
|
|
33
|
+
switch (matchResult) {
|
|
34
|
+
case 0:
|
|
35
|
+
return tc;
|
|
36
|
+
default:
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
static getTermCodeAsString(dt, context) {
|
|
41
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDDefinedTerm.termCode, unwrap(context));
|
|
42
|
+
if (matchValue != null) {
|
|
43
|
+
if (typeof value(matchValue) === "string") {
|
|
44
|
+
const tc = value(matchValue);
|
|
45
|
+
return tc;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new Error(`Property of \`termCode\` of object with @id \`${dt.Id}\` was not a string`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
throw new Error(`Could not access property \`termCode\` of object with @id \`${dt.Id}\``);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static setTermCodeAsString(dt, termCode, context) {
|
|
56
|
+
return dt.SetProperty(LDDefinedTerm.termCode, termCode, unwrap(context));
|
|
57
|
+
}
|
|
58
|
+
static tryGetNameAsString(dt, context) {
|
|
59
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDDefinedTerm.name, unwrap(context));
|
|
60
|
+
let matchResult, n;
|
|
61
|
+
if (matchValue != null) {
|
|
62
|
+
if (typeof value(matchValue) === "string") {
|
|
63
|
+
matchResult = 0;
|
|
64
|
+
n = value(matchValue);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
matchResult = 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
matchResult = 1;
|
|
72
|
+
}
|
|
73
|
+
switch (matchResult) {
|
|
74
|
+
case 0:
|
|
75
|
+
return n;
|
|
76
|
+
default:
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
static getNameAsString(dt, context) {
|
|
81
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDDefinedTerm.name, unwrap(context));
|
|
82
|
+
if (matchValue != null) {
|
|
83
|
+
if (typeof value(matchValue) === "string") {
|
|
84
|
+
const n = value(matchValue);
|
|
85
|
+
return n;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
throw new Error(`Property of \`name\` of object with @id \`${dt.Id}\` was not a string`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
throw new Error(`Could not access property \`name\` of object with @id \`${dt.Id}\``);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
static setNameAsString(dt, name, context) {
|
|
96
|
+
return dt.SetProperty(LDDefinedTerm.name, name, unwrap(context));
|
|
97
|
+
}
|
|
98
|
+
static genID(name, termCode) {
|
|
99
|
+
return (termCode == null) ? clean(`#OA_${name}`) : (`${termCode}`);
|
|
100
|
+
}
|
|
101
|
+
static validate(dt, context) {
|
|
102
|
+
return dt.HasType(LDDefinedTerm.schemaType, unwrap(context)) && dt.HasProperty(LDDefinedTerm.name, unwrap(context));
|
|
103
|
+
}
|
|
104
|
+
static create(name, id, termCode, context) {
|
|
105
|
+
const dt = new LDNode((id == null) ? LDDefinedTerm.genID(name, unwrap(termCode)) : id, [LDDefinedTerm.schemaType], undefined, unwrap(context));
|
|
106
|
+
dt.SetProperty(LDDefinedTerm.name, name, unwrap(context));
|
|
107
|
+
dt.SetOptionalProperty(LDDefinedTerm.termCode, termCode, unwrap(context));
|
|
108
|
+
return dt;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function LDDefinedTerm_$reflection() {
|
|
113
|
+
return class_type("ARCtrl.ROCrate.LDDefinedTerm", undefined, LDDefinedTerm);
|
|
114
|
+
}
|
|
115
|
+
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { value, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
|
|
2
|
+
import { LDComment } from "./Comment.js";
|
|
3
|
+
import { LDDefinedTerm } from "./DefinedTerm.js";
|
|
4
|
+
import { LDNode } from "../LDObject.js";
|
|
5
|
+
import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
|
|
6
|
+
|
|
7
|
+
export class LDFile {
|
|
8
|
+
constructor() {
|
|
9
|
+
}
|
|
10
|
+
static get schemaType() {
|
|
11
|
+
return "http://schema.org/MediaObject";
|
|
12
|
+
}
|
|
13
|
+
static get name() {
|
|
14
|
+
return "http://schema.org/name";
|
|
15
|
+
}
|
|
16
|
+
static get comment() {
|
|
17
|
+
return "http://schema.org/comment";
|
|
18
|
+
}
|
|
19
|
+
static get disambiguatingDescription() {
|
|
20
|
+
return "http://schema.org/disambiguatingDescription";
|
|
21
|
+
}
|
|
22
|
+
static get usageInfo() {
|
|
23
|
+
return "http://schema.org/usageInfo";
|
|
24
|
+
}
|
|
25
|
+
static get encodingFormat() {
|
|
26
|
+
return "http://schema.org/encodingFormat";
|
|
27
|
+
}
|
|
28
|
+
static get pattern() {
|
|
29
|
+
return "http://schema.org/pattern";
|
|
30
|
+
}
|
|
31
|
+
static get about() {
|
|
32
|
+
return "http://schema.org/about";
|
|
33
|
+
}
|
|
34
|
+
static tryGetNameAsString(dt, context) {
|
|
35
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDFile.name, unwrap(context));
|
|
36
|
+
let matchResult, n;
|
|
37
|
+
if (matchValue != null) {
|
|
38
|
+
if (typeof value(matchValue) === "string") {
|
|
39
|
+
matchResult = 0;
|
|
40
|
+
n = value(matchValue);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
matchResult = 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
matchResult = 1;
|
|
48
|
+
}
|
|
49
|
+
switch (matchResult) {
|
|
50
|
+
case 0:
|
|
51
|
+
return n;
|
|
52
|
+
default:
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
static getNameAsString(dt, context) {
|
|
57
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDFile.name, unwrap(context));
|
|
58
|
+
if (matchValue != null) {
|
|
59
|
+
if (typeof value(matchValue) === "string") {
|
|
60
|
+
const n = value(matchValue);
|
|
61
|
+
return n;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
throw new Error(`Property of \`name\` of object with @id \`${dt.Id}\` was not a string`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw new Error(`Could not access property \`name\` of object with @id \`${dt.Id}\``);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
static setNameAsString(dt, name, context) {
|
|
72
|
+
return dt.SetProperty(LDFile.name, name, unwrap(context));
|
|
73
|
+
}
|
|
74
|
+
static getComments(dt, graph, context) {
|
|
75
|
+
return dt.GetPropertyNodes(LDFile.comment, (ldObject, context_1) => LDComment.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
76
|
+
}
|
|
77
|
+
static setComments(dt, comment, context) {
|
|
78
|
+
return dt.SetProperty(LDFile.comment, comment, unwrap(context));
|
|
79
|
+
}
|
|
80
|
+
static tryGetDisambiguatingDescriptionAsString(dt, context) {
|
|
81
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDFile.disambiguatingDescription, unwrap(context));
|
|
82
|
+
let matchResult, dd;
|
|
83
|
+
if (matchValue != null) {
|
|
84
|
+
if (typeof value(matchValue) === "string") {
|
|
85
|
+
matchResult = 0;
|
|
86
|
+
dd = value(matchValue);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
matchResult = 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
matchResult = 1;
|
|
94
|
+
}
|
|
95
|
+
switch (matchResult) {
|
|
96
|
+
case 0:
|
|
97
|
+
return dd;
|
|
98
|
+
default:
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
static setDisambiguatingDescriptionAsString(dt, disambiguatingDescription, context) {
|
|
103
|
+
return dt.SetProperty(LDFile.disambiguatingDescription, disambiguatingDescription, unwrap(context));
|
|
104
|
+
}
|
|
105
|
+
static tryGetEncodingFormatAsString(dt, context) {
|
|
106
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDFile.encodingFormat, unwrap(context));
|
|
107
|
+
let matchResult, ef;
|
|
108
|
+
if (matchValue != null) {
|
|
109
|
+
if (typeof value(matchValue) === "string") {
|
|
110
|
+
matchResult = 0;
|
|
111
|
+
ef = value(matchValue);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
matchResult = 1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
matchResult = 1;
|
|
119
|
+
}
|
|
120
|
+
switch (matchResult) {
|
|
121
|
+
case 0:
|
|
122
|
+
return ef;
|
|
123
|
+
default:
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
static setEncodingFormatAsString(dt, encodingFormat, context) {
|
|
128
|
+
return dt.SetProperty(LDFile.encodingFormat, encodingFormat, unwrap(context));
|
|
129
|
+
}
|
|
130
|
+
static tryGetUsageInfoAsString(dt, context) {
|
|
131
|
+
const matchValue = dt.TryGetPropertyAsSingleton(LDFile.usageInfo, unwrap(context));
|
|
132
|
+
let matchResult, ui;
|
|
133
|
+
if (matchValue != null) {
|
|
134
|
+
if (typeof value(matchValue) === "string") {
|
|
135
|
+
matchResult = 0;
|
|
136
|
+
ui = value(matchValue);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
matchResult = 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
matchResult = 1;
|
|
144
|
+
}
|
|
145
|
+
switch (matchResult) {
|
|
146
|
+
case 0:
|
|
147
|
+
return ui;
|
|
148
|
+
default:
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
static setUsageInfoAsString(dt, usageInfo, context) {
|
|
153
|
+
return dt.SetProperty(LDFile.usageInfo, usageInfo, unwrap(context));
|
|
154
|
+
}
|
|
155
|
+
static tryGetPatternAsDefinedTerm(dt, graph, context) {
|
|
156
|
+
let dt_1;
|
|
157
|
+
const matchValue = dt.TryGetPropertyAsSingleNode(LDFile.pattern, unwrap(graph), unwrap(context));
|
|
158
|
+
if (matchValue != null) {
|
|
159
|
+
if ((dt_1 = matchValue, LDDefinedTerm.validate(dt_1, unwrap(context)))) {
|
|
160
|
+
const dt_2 = matchValue;
|
|
161
|
+
return dt_2;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
throw new Error(`Property of \`pattern\` of object with @id \`${dt.Id}\` was not a DefinedTerm`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
static setPatternAsDefinedTerm(dt, pattern, context) {
|
|
172
|
+
return dt.SetProperty(LDFile.pattern, pattern, unwrap(context));
|
|
173
|
+
}
|
|
174
|
+
static tryGetAbout(dt, graph, context) {
|
|
175
|
+
return dt.TryGetPropertyAsSingleNode(LDFile.about, unwrap(graph), unwrap(context));
|
|
176
|
+
}
|
|
177
|
+
static setAbout(dt, about, context) {
|
|
178
|
+
return dt.SetProperty(LDFile.about, about, unwrap(context));
|
|
179
|
+
}
|
|
180
|
+
static genId(name) {
|
|
181
|
+
return `${name}`;
|
|
182
|
+
}
|
|
183
|
+
static validate(dt, context) {
|
|
184
|
+
return dt.HasType(LDFile.schemaType, unwrap(context)) && dt.HasProperty(LDFile.name, unwrap(context));
|
|
185
|
+
}
|
|
186
|
+
static create(name, id, comments, disambiguatingDescription, encodingFormat, usageInfo, context) {
|
|
187
|
+
const dt = new LDNode((id == null) ? LDFile.genId(name) : id, [LDFile.schemaType], undefined, unwrap(context));
|
|
188
|
+
dt.SetProperty(LDFile.name, name, unwrap(context));
|
|
189
|
+
dt.SetOptionalProperty(LDFile.comment, comments, unwrap(context));
|
|
190
|
+
dt.SetOptionalProperty(LDFile.disambiguatingDescription, disambiguatingDescription, unwrap(context));
|
|
191
|
+
dt.SetOptionalProperty(LDFile.encodingFormat, encodingFormat, unwrap(context));
|
|
192
|
+
dt.SetOptionalProperty(LDFile.usageInfo, usageInfo, unwrap(context));
|
|
193
|
+
return dt;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function LDFile_$reflection() {
|
|
198
|
+
return class_type("ARCtrl.ROCrate.LDFile", undefined, LDFile);
|
|
199
|
+
}
|
|
200
|
+
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { defaultArg, value, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
|
|
2
|
+
import { LDPerson } from "./Person.js";
|
|
3
|
+
import { LDSample } from "./Sample.js";
|
|
4
|
+
import { LDFile } from "./File.js";
|
|
5
|
+
import { LDLabProtocol } from "./LabProtocol.js";
|
|
6
|
+
import { LDPropertyValue } from "./PropertyValue.js";
|
|
7
|
+
import { ResizeArray_map } from "../../Core/Helper/Collections.js";
|
|
8
|
+
import { clean } from "../Helper.js";
|
|
9
|
+
import { LDNode } from "../LDObject.js";
|
|
10
|
+
import { class_type } from "../../fable_modules/fable-library-js.4.24.0/Reflection.js";
|
|
11
|
+
|
|
12
|
+
export class LDLabProcess {
|
|
13
|
+
constructor() {
|
|
14
|
+
}
|
|
15
|
+
static get schemaType() {
|
|
16
|
+
return "https://bioschemas.org/LabProcess";
|
|
17
|
+
}
|
|
18
|
+
static get name() {
|
|
19
|
+
return "http://schema.org/name";
|
|
20
|
+
}
|
|
21
|
+
static get agent() {
|
|
22
|
+
return "http://schema.org/agent";
|
|
23
|
+
}
|
|
24
|
+
static get object_() {
|
|
25
|
+
return "http://schema.org/object";
|
|
26
|
+
}
|
|
27
|
+
static get result() {
|
|
28
|
+
return "http://schema.org/result";
|
|
29
|
+
}
|
|
30
|
+
static get executesLabProtocol() {
|
|
31
|
+
return "https://bioschemas.org/executesLabProtocol";
|
|
32
|
+
}
|
|
33
|
+
static get parameterValue() {
|
|
34
|
+
return "https://bioschemas.org/parameterValue";
|
|
35
|
+
}
|
|
36
|
+
static get endTime() {
|
|
37
|
+
return "http://schema.org/endTime";
|
|
38
|
+
}
|
|
39
|
+
static get disambiguatingDescription() {
|
|
40
|
+
return "http://schema.org/disambiguatingDescription";
|
|
41
|
+
}
|
|
42
|
+
static tryGetNameAsString(lp, context) {
|
|
43
|
+
const matchValue = lp.TryGetPropertyAsSingleton(LDLabProcess.name, unwrap(context));
|
|
44
|
+
let matchResult, n;
|
|
45
|
+
if (matchValue != null) {
|
|
46
|
+
if (typeof value(matchValue) === "string") {
|
|
47
|
+
matchResult = 0;
|
|
48
|
+
n = value(matchValue);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
matchResult = 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
matchResult = 1;
|
|
56
|
+
}
|
|
57
|
+
switch (matchResult) {
|
|
58
|
+
case 0:
|
|
59
|
+
return n;
|
|
60
|
+
default:
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static getNameAsString(lp, context) {
|
|
65
|
+
const matchValue = lp.TryGetPropertyAsSingleton(LDLabProcess.name, unwrap(context));
|
|
66
|
+
if (matchValue != null) {
|
|
67
|
+
if (typeof value(matchValue) === "string") {
|
|
68
|
+
const n = value(matchValue);
|
|
69
|
+
return n;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
throw new Error(`property \`name\` of object with @id \`${lp.Id}\` was not a string`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
throw new Error(`Could not access property \`name\` of object with @id \`${lp.Id}\``);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
static setNameAsString(lp, name, context) {
|
|
80
|
+
return lp.SetProperty(LDLabProcess.name, name, unwrap(context));
|
|
81
|
+
}
|
|
82
|
+
static tryGetAgent(lp, graph, context) {
|
|
83
|
+
let ldObject;
|
|
84
|
+
const matchValue = lp.TryGetPropertyAsSingleNode(LDLabProcess.agent, unwrap(graph), unwrap(context));
|
|
85
|
+
let matchResult, a_1;
|
|
86
|
+
if (matchValue != null) {
|
|
87
|
+
if ((ldObject = matchValue, LDPerson.validate(ldObject, unwrap(context)))) {
|
|
88
|
+
matchResult = 0;
|
|
89
|
+
a_1 = matchValue;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
matchResult = 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
matchResult = 1;
|
|
97
|
+
}
|
|
98
|
+
switch (matchResult) {
|
|
99
|
+
case 0:
|
|
100
|
+
return a_1;
|
|
101
|
+
default:
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
static getAgent(lp, graph, context) {
|
|
106
|
+
let ldObject;
|
|
107
|
+
const matchValue = lp.TryGetPropertyAsSingleNode(LDLabProcess.agent, unwrap(graph), unwrap(context));
|
|
108
|
+
if (matchValue != null) {
|
|
109
|
+
if ((ldObject = matchValue, LDPerson.validate(ldObject, unwrap(context)))) {
|
|
110
|
+
const a_1 = matchValue;
|
|
111
|
+
return a_1;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
throw new Error(`Property of \`agent\` of object with @id \`${lp.Id}\` was not a valid Person`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
throw new Error(`Could not access property \`agent\` of object with @id \`${lp.Id}\``);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
static setAgent(lp, agent, context) {
|
|
122
|
+
return lp.SetProperty(LDLabProcess.agent, agent, unwrap(context));
|
|
123
|
+
}
|
|
124
|
+
static getObjects(lp, graph, context) {
|
|
125
|
+
return lp.GetPropertyNodes(LDLabProcess.object_, undefined, unwrap(graph), unwrap(context));
|
|
126
|
+
}
|
|
127
|
+
static getObjectsAsSample(lp, graph, context) {
|
|
128
|
+
return lp.GetPropertyNodes(LDLabProcess.object_, (ldObject, context_1) => LDSample.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
129
|
+
}
|
|
130
|
+
static getObjectsAsData(lp, graph, context) {
|
|
131
|
+
return lp.GetPropertyNodes(LDLabProcess.object_, (ldObject, context_1) => LDFile.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
132
|
+
}
|
|
133
|
+
static setObjects(lp, objects, context) {
|
|
134
|
+
return lp.SetProperty(LDLabProcess.object_, objects, unwrap(context));
|
|
135
|
+
}
|
|
136
|
+
static getResults(lp, graph, context) {
|
|
137
|
+
return lp.GetPropertyNodes(LDLabProcess.result, undefined, unwrap(graph), unwrap(context));
|
|
138
|
+
}
|
|
139
|
+
static getResultsAsSample(lp, graph, context) {
|
|
140
|
+
return lp.GetPropertyNodes(LDLabProcess.result, (ldObject, context_1) => LDSample.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
141
|
+
}
|
|
142
|
+
static getResultsAsData(lp, graph, context) {
|
|
143
|
+
return lp.GetPropertyNodes(LDLabProcess.result, (ldObject, context_1) => LDFile.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
144
|
+
}
|
|
145
|
+
static setResults(lp, results, context) {
|
|
146
|
+
return lp.SetProperty(LDLabProcess.result, results, unwrap(context));
|
|
147
|
+
}
|
|
148
|
+
static tryGetExecutesLabProtocol(lp, graph, context) {
|
|
149
|
+
let ldObject;
|
|
150
|
+
const matchValue = lp.TryGetPropertyAsSingleNode(LDLabProcess.executesLabProtocol, unwrap(graph), unwrap(context));
|
|
151
|
+
let matchResult, l_1;
|
|
152
|
+
if (matchValue != null) {
|
|
153
|
+
if ((ldObject = matchValue, LDLabProtocol.validate(ldObject, unwrap(context)))) {
|
|
154
|
+
matchResult = 0;
|
|
155
|
+
l_1 = matchValue;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
matchResult = 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
matchResult = 1;
|
|
163
|
+
}
|
|
164
|
+
switch (matchResult) {
|
|
165
|
+
case 0:
|
|
166
|
+
return l_1;
|
|
167
|
+
default:
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
static setExecutesLabProtocol(lp, executesLabProtocol, context) {
|
|
172
|
+
return lp.SetProperty(LDLabProcess.executesLabProtocol, executesLabProtocol, unwrap(context));
|
|
173
|
+
}
|
|
174
|
+
static getParameterValues(lp, graph, context) {
|
|
175
|
+
return lp.GetPropertyNodes(LDLabProcess.parameterValue, (ldObject, context_1) => LDPropertyValue.validate(ldObject, unwrap(context_1)), unwrap(graph), unwrap(context));
|
|
176
|
+
}
|
|
177
|
+
static setParameterValues(lp, parameterValues, context) {
|
|
178
|
+
return lp.SetProperty(LDLabProcess.parameterValue, parameterValues, unwrap(context));
|
|
179
|
+
}
|
|
180
|
+
static tryGetEndTime(lp, context) {
|
|
181
|
+
const matchValue = lp.TryGetPropertyAsSingleton(LDLabProcess.endTime, unwrap(context));
|
|
182
|
+
let matchResult, et;
|
|
183
|
+
if (matchValue != null) {
|
|
184
|
+
if (value(matchValue) instanceof Date) {
|
|
185
|
+
matchResult = 0;
|
|
186
|
+
et = value(matchValue);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
matchResult = 1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
matchResult = 1;
|
|
194
|
+
}
|
|
195
|
+
switch (matchResult) {
|
|
196
|
+
case 0:
|
|
197
|
+
return et;
|
|
198
|
+
default:
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
static setEndTime(lp, endTime, context) {
|
|
203
|
+
return lp.SetProperty(LDLabProcess.endTime, endTime, unwrap(context));
|
|
204
|
+
}
|
|
205
|
+
static getDisambiguatingDescriptionsAsString(lp, context) {
|
|
206
|
+
return ResizeArray_map((o_1) => o_1, lp.GetPropertyValues(LDLabProcess.disambiguatingDescription, (o, context_1) => (typeof o === "string"), unwrap(context)));
|
|
207
|
+
}
|
|
208
|
+
static setDisambiguatingDescriptionsAsString(lp, disambiguatingDescriptions, context) {
|
|
209
|
+
return lp.SetProperty(LDLabProcess.disambiguatingDescription, disambiguatingDescriptions, unwrap(context));
|
|
210
|
+
}
|
|
211
|
+
static validate(lp, context) {
|
|
212
|
+
return lp.HasType(LDLabProcess.schemaType, unwrap(context)) && lp.HasProperty(LDLabProcess.name, unwrap(context));
|
|
213
|
+
}
|
|
214
|
+
static genId(name, assayName, studyName) {
|
|
215
|
+
let study_1, assay_1, assay, study;
|
|
216
|
+
return clean((assayName == null) ? ((studyName != null) ? ((study_1 = value(studyName), `#Process_${study_1}_${name}`)) : (`#Process_${name}`)) : ((studyName == null) ? ((assay_1 = value(assayName), `#Process_${assay_1}_${name}`)) : ((assay = value(assayName), (study = value(studyName), `#Process_${study}_${assay}_${name}`)))));
|
|
217
|
+
}
|
|
218
|
+
static create(name, objects, results, id, agent, executesLabProtocol, parameterValues, endTime, disambiguatingDescriptions, context) {
|
|
219
|
+
const id_1 = (id == null) ? LDLabProcess.genId(name) : id;
|
|
220
|
+
const objects_1 = defaultArg(objects, []);
|
|
221
|
+
const results_1 = defaultArg(results, []);
|
|
222
|
+
const lp = new LDNode(id_1, [LDLabProcess.schemaType], undefined, unwrap(context));
|
|
223
|
+
lp.SetProperty(LDLabProcess.name, name, unwrap(context));
|
|
224
|
+
lp.SetOptionalProperty(LDLabProcess.agent, agent, unwrap(context));
|
|
225
|
+
lp.SetProperty(LDLabProcess.object_, objects_1, unwrap(context));
|
|
226
|
+
lp.SetProperty(LDLabProcess.result, results_1, unwrap(context));
|
|
227
|
+
lp.SetOptionalProperty(LDLabProcess.executesLabProtocol, executesLabProtocol, unwrap(context));
|
|
228
|
+
lp.SetOptionalProperty(LDLabProcess.parameterValue, parameterValues, unwrap(context));
|
|
229
|
+
lp.SetOptionalProperty(LDLabProcess.endTime, endTime, unwrap(context));
|
|
230
|
+
lp.SetOptionalProperty(LDLabProcess.disambiguatingDescription, disambiguatingDescriptions, unwrap(context));
|
|
231
|
+
return lp;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function LDLabProcess_$reflection() {
|
|
236
|
+
return class_type("ARCtrl.ROCrate.LDLabProcess", undefined, LDLabProcess);
|
|
237
|
+
}
|
|
238
|
+
|