@nfdi4plants/arctrl 3.0.0-beta.14 → 3.0.0-beta.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Run.d.ts","sourceRoot":"","sources":["../../../../src/ARCtrl/ts/Conversion/Run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAQjF,OAAO,EAAE,QAAQ,EAAgB,MAAM,kBAAkB,CAAC;AAI1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AASvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAWzD,qBAAa,aAAa;;CAGzB;AAED,wBAAgB,yBAAyB,IAAI,QAAQ,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,+CAA+C,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOrG;AAED,wBAAgB,iDAAiD,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQvG;AAED,wBAAgB,2CAA2C,CAAC,UAAU,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwCnK;AAED,wBAAgB,8CAA8C,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAqB/J;AAED,wBAAgB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,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQvG;AAED,wBAAgB,2CAA2C,CAAC,UAAU,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwCnK;AAED,wBAAgB,8CAA8C,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,qBAAqB,CAqB/J;AAED,wBAAgB,0DAA0D,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,CAkDjH;AAED,wBAAgB,uDAAuD,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,wBAAwB,EAAE,qBAAqB,EAAE,CAAC,CAK9M;AAED,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAYtF;AAED,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAmC9G"}
@@ -12,7 +12,7 @@ import { CWLParameterReference } from '../CWL/ParameterReference.js';
12
12
  import { LDFormalParameter } from '../ROCrate/LDTypes/FormalParameter.js';
13
13
  import { Run_cwlFileNameFromIdentifier } from '../Core/Helper/Identifier.js';
14
14
  import { WorkflowConversion_composeWorkflowProtocolFromProcessingUnit_Z3099C0F7, WorkflowConversion_getInputParametersFromProcessingUnit_30922B92, WorkflowConversion_decomposeWorkflowProtocolToProcessingUnit_2664C4B8 } from './Workflow.js';
15
- import { tryPick, find, exists } from '../../node_modules/@fable-org/fable-library-js/Seq.js';
15
+ import { tryPick, find } from '../../node_modules/@fable-org/fable-library-js/Seq.js';
16
16
  import { LDComputationalWorkflow } from '../ROCrate/LDTypes/ComputationalWorkflow.js';
17
17
  import { ARCtrl_ArcTables__ArcTables_GetProcesses_5E660E5C, ARCtrl_ArcTables__ArcTables_fromProcesses_Static_Z27F0B586 } from './Table.js';
18
18
  import { ArcTables } from '../Core/Table/ArcTables.js';
@@ -26,6 +26,7 @@ import { DatamapConversion_composeFragmentDescriptors_Z892BFC3, DatamapConversio
26
26
  import { Datamap } from '../Core/Datamap.js';
27
27
  import { AssayConversion_getDataFilesFromProcesses_6BABD1B0 } from './Assay.js';
28
28
  import { LDDataset } from '../ROCrate/LDTypes/Dataset.js';
29
+ import { LDWorkflowProtocol } from '../ROCrate/LDTypes/WorkflowProtocol.js';
29
30
 
30
31
  class RunConversion {
31
32
  constructor() {
@@ -128,7 +129,7 @@ function RunConversion_composeWorkflowInvocationFromArcRun_Z8CC08AC(run, fs) {
128
129
  }
129
130
  }, run.CWLInput);
130
131
  if (paramRef == null) {
131
- throw new Error(`Could not create workflow invocation for run "${run.Identifier}": Workflow parameter "name" had no assigned value.`);
132
+ throw new Error(`Could not create workflow invocation for run "${run.Identifier}": Workflow parameter "${name}" had no assigned value.`);
132
133
  } else {
133
134
  return RunConversion_composeCWLInputValue_70DD9184(value(paramRef), ldI, tupledArg[0], run.Identifier);
134
135
  }
@@ -173,7 +174,27 @@ function RunConversion_composeRun_Z8CC08AC(run, fs) {
173
174
  return LDDataset.createARCRun(run.Identifier, void 0, unwrap(run.Title), unwrap(run.Description), unwrap(creators), unwrap(dataFiles), unwrap(measurementMethod), unwrap(measurementTechnique), unwrap(variableMeasureds), unwrap(workflowInvocations), unwrap(workflowInvocations), unwrap(comments));
174
175
  }
175
176
  function RunConversion_decomposeRun_Z6839B9E8(run, graph, context) {
176
- const mainWorkflowInvocation = find((wi) => exists((i) => LDFile.tryGetExampleOfWorkAsFormalParameter(i, unwrap(graph), unwrap(context)) != null, LDLabProcess.getObjects(wi, unwrap(graph), unwrap(context))), LDDataset.getAboutsAsWorkflowInvocation(run, unwrap(graph), unwrap(context)));
177
+ const mainWorkflowInvocation = find((wi) => {
178
+ let lp;
179
+ const matchValue = LDLabProcess.tryGetExecutesLabProtocol(wi, unwrap(graph), unwrap(context));
180
+ let matchResult, lp_1;
181
+ if (matchValue != null) {
182
+ if (lp = value(matchValue), LDWorkflowProtocol.validate(lp, unwrap(context))) {
183
+ matchResult = 0;
184
+ lp_1 = value(matchValue);
185
+ } else {
186
+ matchResult = 1;
187
+ }
188
+ } else {
189
+ matchResult = 1;
190
+ }
191
+ switch (matchResult) {
192
+ case 0:
193
+ return true;
194
+ default:
195
+ return false;
196
+ }
197
+ }, LDDataset.getAboutsAsWorkflowInvocation(run, unwrap(graph), unwrap(context)));
177
198
  const patternInput = RunConversion_decomposeMainWorkflowInvocation_Z1346FE9D(mainWorkflowInvocation, LDDataset.getIdentifierAsString(run, unwrap(context)), unwrap(context), unwrap(graph));
178
199
  const measurementMethod = map((m) => BaseTypes_decomposeDefinedTerm_Z2F770004(m, unwrap(context)), LDDataset.tryGetMeasurementMethodAsDefinedTerm(run, unwrap(graph), unwrap(context)));
179
200
  const measurementTechnique = map((m_1) => BaseTypes_decomposeDefinedTerm_Z2F770004(m_1, unwrap(context)), LDDataset.tryGetMeasurementTechniqueAsDefinedTerm(run, unwrap(graph), unwrap(context)));
@@ -2,6 +2,7 @@ import { Decoder$1, IEncodable } from '../../fable_modules/Thoth.Json.Core.0.7.0
2
2
  import { LDNode } from '../../ROCrate/LDObject.js';
3
3
  export declare function genericEncoder(obj: any): IEncodable;
4
4
  export declare function encoder(obj: LDNode): IEncodable;
5
+ export declare const nullDecoder: Decoder$1<void>;
5
6
  /**
6
7
  * Returns a decoder
7
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"LDNode.d.ts","sourceRoot":"","sources":["../../../../../src/ARCtrl/ts/Json/ROCrate/LDNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+F,SAAS,EAAE,UAAU,EAAqB,MAAM,uDAAuD,CAAC;AAG9M,OAAO,EAAE,MAAM,EAAkB,MAAM,2BAA2B,CAAC;AAgBnE,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CA+DnD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CA6B/C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CA0FhE;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,MAAM,CAAuE,CAAC;AAE9G,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,GAAG,CAAqB,CAAC"}
1
+ {"version":3,"file":"LDNode.d.ts","sourceRoot":"","sources":["../../../../../src/ARCtrl/ts/Json/ROCrate/LDNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,SAAS,EAAuE,UAAU,EAAqB,MAAM,uDAAuD,CAAC;AAG9M,OAAO,EAAE,MAAM,EAAkB,MAAM,2BAA2B,CAAC;AAgBnE,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CA+DnD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CA6B/C;AAED,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,IAAI,CAIvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAgGhE;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,MAAM,CAAuE,CAAC;AAE9G,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,GAAG,CAAqB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ErrorReason$1_BadOneOf, ErrorReason$1_BadPrimitive } from '../../fable_modules/Thoth.Json.Core.0.7.0/Types.fs.js';
1
+ import { ErrorReason$1_BadPrimitive, ErrorReason$1_BadOneOf } from '../../fable_modules/Thoth.Json.Core.0.7.0/Types.fs.js';
2
2
  import { dateTime, resizeArrayOrSingleton } from '../Encode.js';
3
3
  import { LDValue, LDRef, LDNode } from '../../ROCrate/LDObject.js';
4
4
  import { encoder as encoder$1, decoder as decoder$2 } from './LDValue.js';
@@ -8,10 +8,10 @@ import { list } from '../../fable_modules/Thoth.Json.Core.0.7.0/Encode.fs.js';
8
8
  import { toList, delay, map, enumerateFromFunctions, append, singleton, empty, collect } from '../../../node_modules/@fable-org/fable-library-js/Seq.js';
9
9
  import { encoder as encoder$3, decoder as decoder$1 } from './LDContext.js';
10
10
  import { value, unwrap } from '../../../node_modules/@fable-org/fable-library-js/Option.js';
11
+ import { FSharpResult$2_Ok, FSharpResult$2_Error } from '../../../node_modules/@fable-org/fable-library-js/Result.js';
11
12
  import { Getters$2_$ctor_Z4BE6C149, string, Getters$2__get_Errors, map as map$1, oneOf, int, decimal, bool } from '../../fable_modules/Thoth.Json.Core.0.7.0/Decode.fs.js';
12
13
  import { Decode_resizeArrayOrSingleton, Helpers_prependPath } from '../Decode.js';
13
14
  import { isEmpty, length, head, ofArray } from '../../../node_modules/@fable-org/fable-library-js/List.js';
14
- import { FSharpResult$2_Error, FSharpResult$2_Ok } from '../../../node_modules/@fable-org/fable-library-js/Result.js';
15
15
  import { fold } from '../../../node_modules/@fable-org/fable-library-js/Array.js';
16
16
 
17
17
  function genericEncoder(obj) {
@@ -98,11 +98,16 @@ function encoder(obj) {
98
98
  }
99
99
  };
100
100
  }
101
+ const nullDecoder = {
102
+ Decode(helpers, value) {
103
+ return helpers.isNullValue(value) ? FSharpResult$2_Ok(void 0) : FSharpResult$2_Error(["", ErrorReason$1_BadPrimitive("null", value)]);
104
+ }
105
+ };
101
106
  function getDecoder(expectObject) {
102
107
  const decode = (expectObject_1) => {
103
108
  const decodeObject = {
104
109
  Decode(helpers, value$1) {
105
- let arg_7, objectArg_3, arg_9, objectArg_4;
110
+ let arg_7, objectArg_3;
106
111
  if (helpers.isObject(value$1)) {
107
112
  const getters = Getters$2_$ctor_Z4BE6C149(helpers, value$1);
108
113
  const properties = helpers.getProperties(value$1);
@@ -124,7 +129,13 @@ function getDecoder(expectObject) {
124
129
  while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
125
130
  const property = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
126
131
  if (property !== "@id" && property !== "@type" && property !== "@context") {
127
- o.SetProperty(property, (arg_9 = decode(false), objectArg_4 = get$.Required, objectArg_4.Field(property, arg_9)));
132
+ let r;
133
+ const arg_9 = decode(false);
134
+ const objectArg_4 = get$.Required;
135
+ r = objectArg_4.Field(property, arg_9);
136
+ if (!equals(r, defaultOf())) {
137
+ o.SetProperty(property, r);
138
+ }
128
139
  }
129
140
  }
130
141
  } finally {
@@ -179,7 +190,7 @@ function getDecoder(expectObject) {
179
190
  if (expectObject_1) {
180
191
  return map$1((value_4) => value_4, decodeObject);
181
192
  } else {
182
- return oneOf(ofArray([map$1((value_5) => value_5, decoder$2), map$1((value_6) => value_6, decodeObject), map$1((value_7) => value_7, decoder$3), map$1((value_8) => value_8, resizeArray), map$1((value_9) => value_9, string), map$1((value_10) => value_10, int), map$1((value_11) => value_11, decimal), map$1((value_12) => value_12, bool)]));
193
+ return oneOf(ofArray([map$1((value_5) => value_5, decoder$2), map$1((value_6) => value_6, decodeObject), map$1((value_7) => value_7, decoder$3), map$1((value_8) => value_8, resizeArray), map$1((value_9) => value_9, string), map$1((value_10) => value_10, int), map$1((value_11) => value_11, decimal), map$1((value_12) => value_12, bool), map$1(() => void 0, nullDecoder)]));
183
194
  }
184
195
  };
185
196
  return decode(expectObject);
@@ -187,4 +198,4 @@ function getDecoder(expectObject) {
187
198
  const decoder = map$1((value) => value, getDecoder(true));
188
199
  const genericDecoder = getDecoder(false);
189
200
 
190
- export { decoder, encoder, genericDecoder, genericEncoder, getDecoder };
201
+ export { decoder, encoder, genericDecoder, genericEncoder, getDecoder, nullDecoder };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@nfdi4plants/arctrl",
4
- "version": "3.0.0-beta.14",
4
+ "version": "3.0.0-beta.15",
5
5
  "description": "Top level ARC DataModel and API function descriptions.",
6
6
  "repository": {
7
7
  "type": "git",