@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.
Files changed (90) hide show
  1. package/ARC.js +103 -12
  2. package/CWL/CWLTypes.js +2 -2
  3. package/CWL/Decode.js +2 -2
  4. package/CWL/Inputs.js +2 -2
  5. package/CWL/Outputs.js +2 -2
  6. package/CWL/Requirements.js +2 -2
  7. package/CWL/ToolDescription.js +1 -1
  8. package/CWL/WorkflowDescription.js +1 -1
  9. package/CWL/WorkflowSteps.js +1 -1
  10. package/ColumnIndex.js +258 -0
  11. package/Conversion.js +1679 -0
  12. package/Core/Data.js +28 -3
  13. package/Core/DataFile.js +19 -3
  14. package/Core/Helper/Collections.js +107 -4
  15. package/Core/Helper/DateTime.js +17 -0
  16. package/Core/Helper/ORCID.js +39 -0
  17. package/Core/Table/ArcTable.js +6 -0
  18. package/Core/Table/CompositeHeader.js +4 -0
  19. package/Json/Assay.js +1 -1
  20. package/Json/Decode.js +3 -3
  21. package/Json/Encode.js +9 -0
  22. package/Json/Investigation.js +5 -4
  23. package/Json/OntologySourceReference.js +4 -4
  24. package/Json/ROCrate/LDContext.js +121 -0
  25. package/Json/ROCrate/LDGraph.js +87 -0
  26. package/Json/{LDObject.js → ROCrate/LDNode.js} +55 -46
  27. package/Json/ROCrate/LDRef.js +25 -0
  28. package/Json/ROCrate/LDValue.js +66 -0
  29. package/Json/Study.js +5 -4
  30. package/Json/context/rocrate/isa_investigation_context.js +2 -2
  31. package/Json/context/rocrate/isa_study_context.js +15 -11
  32. package/Json/context/rocrate/rocrate_context.js +1 -1
  33. package/JsonIO/LDObject.js +30 -5
  34. package/README.md +12 -3
  35. package/ROCrate/ArcROCrateMetadata.js +14 -13
  36. package/ROCrate/Generic/Comment.js +115 -0
  37. package/ROCrate/Generic/Dataset.js +669 -0
  38. package/ROCrate/Generic/DefinedTerm.js +115 -0
  39. package/ROCrate/Generic/File.js +200 -0
  40. package/ROCrate/Generic/LabProcess.js +238 -0
  41. package/ROCrate/Generic/LabProtocol.js +275 -0
  42. package/ROCrate/Generic/Organization.js +71 -0
  43. package/ROCrate/Generic/Person.js +411 -0
  44. package/ROCrate/Generic/PostalAddress.js +159 -0
  45. package/ROCrate/Generic/PropertyValue.js +548 -0
  46. package/ROCrate/Generic/Sample.js +139 -0
  47. package/ROCrate/Generic/ScholarlyArticle.js +187 -0
  48. package/ROCrate/Helper.js +6 -0
  49. package/ROCrate/ISAProfile/Assay.js +3 -3
  50. package/ROCrate/ISAProfile/Data.js +7 -7
  51. package/ROCrate/ISAProfile/Dataset.js +7 -6
  52. package/ROCrate/ISAProfile/Investigation.js +3 -3
  53. package/ROCrate/ISAProfile/LabProcess.js +7 -7
  54. package/ROCrate/ISAProfile/LabProtocol.js +7 -7
  55. package/ROCrate/ISAProfile/Person.js +7 -7
  56. package/ROCrate/ISAProfile/PropertyValue.js +7 -7
  57. package/ROCrate/ISAProfile/Sample.js +7 -7
  58. package/ROCrate/ISAProfile/ScholarlyArticle.js +7 -7
  59. package/ROCrate/ISAProfile/Study.js +3 -3
  60. package/ROCrate/LDContext.js +283 -0
  61. package/ROCrate/LDObject.js +902 -36
  62. package/ROCrate/ROCrateContext.js +44 -0
  63. package/ROCrateIO.js +62 -0
  64. package/Spreadsheet/DataMap.js +11 -3
  65. package/Spreadsheet/DataMapTable/DataMapHeader.js +3 -2
  66. package/Xlsx.js +21 -8
  67. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs +31 -1
  68. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynObj.fs.js +30 -1
  69. package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs +1025 -0
  70. package/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +433 -0
  71. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs +16 -0
  72. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FablePy.fs +14 -0
  73. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs +15 -0
  74. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/HashCodes.fs.js +4 -0
  75. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/DynamicObj.AssemblyInfo.fs +1 -1
  76. package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/DynamicObj.AssemblyInfo.fs +3 -3
  77. package/fable_modules/project_cracked.json +1 -1
  78. package/package.json +1 -1
  79. package/Json/ARC.js +0 -31
  80. package/JsonIO/ARC.js +0 -31
  81. package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs +0 -310
  82. package/fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js +0 -166
  83. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/DynamicObj.fableproj +0 -0
  84. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/FableJS.fs.js +0 -0
  85. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs +0 -0
  86. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/PropertyHelper.fs.js +0 -0
  87. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs +0 -0
  88. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/ReflectionUtils.fs.js +0 -0
  89. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  90. /package/fable_modules/{DynamicObj.4.0.3 → DynamicObj.7.0.1}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
@@ -1,15 +1,18 @@
1
- import { dateTime } from "./Encode.js";
2
- import { LDObject } from "../ROCrate/LDObject.js";
3
- import { int32ToString, disposeSafe, getEnumerator, isIterable, defaultOf, equals } from "../fable_modules/fable-library-js.4.24.0/Util.js";
4
- import { list } from "../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
5
- import { empty, singleton, append, choose, enumerateFromFunctions, map, delay, toList } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
6
- import { value as value_10 } from "../fable_modules/fable-library-js.4.24.0/Option.js";
7
- import { decimal, int, oneOf, map as map_1, Getters$2__get_Errors, string, Getters$2_$ctor_Z4BE6C149 } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
8
- import { ofArray, head, length, isEmpty } from "../fable_modules/fable-library-js.4.24.0/List.js";
9
- import { ErrorReason$1 } from "../fable_modules/Thoth.Json.Core.0.4.0/Types.fs.js";
10
- import { FSharpResult$2 } from "../fable_modules/fable-library-js.4.24.0/Result.js";
11
- import { fold } from "../fable_modules/fable-library-js.4.24.0/Array.js";
12
- import { Helpers_prependPath } from "./Decode.js";
1
+ import { resizeArrayOrSingleton, dateTime } from "../Encode.js";
2
+ import { LDNode, LDRef, LDValue } from "../../ROCrate/LDObject.js";
3
+ import { decoder as decoder_2, encoder as encoder_1 } from "./LDValue.js";
4
+ import { decoder as decoder_3, encoder as encoder_2 } from "./LDRef.js";
5
+ import { int32ToString, disposeSafe, getEnumerator, isIterable, defaultOf, equals } from "../../fable_modules/fable-library-js.4.24.0/Util.js";
6
+ import { list } from "../../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
7
+ import { collect, empty, singleton, append, enumerateFromFunctions, map, delay, toList } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
8
+ import { decoder as decoder_1, encoder as encoder_3 } from "./LDContext.js";
9
+ import { decimal, int, oneOf, map as map_1, Getters$2__get_Errors, string, Getters$2_$ctor_Z4BE6C149 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
10
+ import { Helpers_prependPath, Decode_resizeArrayOrSingleton } from "../Decode.js";
11
+ import { value as value_12, unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
12
+ import { ofArray, head, length, isEmpty } from "../../fable_modules/fable-library-js.4.24.0/List.js";
13
+ import { ErrorReason$1 } from "../../fable_modules/Thoth.Json.Core.0.4.0/Types.fs.js";
14
+ import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.24.0/Result.js";
15
+ import { fold } from "../../fable_modules/fable-library-js.4.24.0/Array.js";
13
16
 
14
17
  export function genericEncoder(obj) {
15
18
  if (typeof obj === "string") {
@@ -43,7 +46,13 @@ export function genericEncoder(obj) {
43
46
  else if (obj instanceof Date) {
44
47
  return dateTime(obj);
45
48
  }
46
- else if (obj instanceof LDObject) {
49
+ else if (obj instanceof LDValue) {
50
+ return encoder_1(obj);
51
+ }
52
+ else if (obj instanceof LDRef) {
53
+ return encoder_2(obj);
54
+ }
55
+ else if (obj instanceof LDNode) {
47
56
  return encoder(obj);
48
57
  }
49
58
  else if (equals(obj, defaultOf())) {
@@ -63,38 +72,28 @@ export function genericEncoder(obj) {
63
72
  }
64
73
 
65
74
  export function encoder(obj) {
66
- let values;
67
- const source_2 = choose((kv) => {
68
- const l = kv[0].toLocaleLowerCase();
69
- if (((l !== "id") && (l !== "schematype")) && (l !== "additionaltype")) {
70
- return [kv[0], genericEncoder(kv[1])];
71
- }
72
- else {
73
- return undefined;
74
- }
75
- }, obj.GetProperties(true));
76
- values = append(toList(delay(() => {
75
+ const values = toList(delay(() => {
77
76
  let value;
78
77
  return append(singleton(["@id", (value = obj.Id, {
79
78
  Encode(helpers) {
80
79
  return helpers.encodeString(value);
81
80
  },
82
- })]), delay(() => {
83
- let value_1;
84
- return append(singleton(["@type", (value_1 = obj.SchemaType, {
85
- Encode(helpers_1) {
86
- return helpers_1.encodeString(value_1);
87
- },
88
- })]), delay(() => {
89
- let value_2;
90
- return (obj.AdditionalType != null) ? singleton(["additionalType", (value_2 = value_10(obj.AdditionalType), {
91
- Encode(helpers_2) {
92
- return helpers_2.encodeString(value_2);
93
- },
94
- })]) : empty();
95
- }));
96
- }));
97
- })), source_2);
81
+ })]), delay(() => append(singleton(["@type", resizeArrayOrSingleton((value_1) => ({
82
+ Encode(helpers_1) {
83
+ return helpers_1.encodeString(value_1);
84
+ },
85
+ }), obj.SchemaType)]), delay(() => append((obj.AdditionalType.length !== 0) ? singleton(["additionalType", resizeArrayOrSingleton((value_3) => ({
86
+ Encode(helpers_2) {
87
+ return helpers_2.encodeString(value_3);
88
+ },
89
+ }), obj.AdditionalType)]) : empty(), delay(() => {
90
+ let matchValue;
91
+ return append((matchValue = obj.TryGetContext(), (matchValue != null) ? singleton(["@context", encoder_3(matchValue)]) : (empty())), delay(() => collect((kv) => {
92
+ const l = kv[0].toLocaleLowerCase();
93
+ return ((((((l !== "id") && (l !== "schematype")) && (l !== "additionaltype")) && (l !== "@context")) && !l.startsWith("init@")) && !l.startsWith("init_")) ? singleton([kv[0], genericEncoder(kv[1])]) : empty();
94
+ }, obj.GetProperties(true))));
95
+ }))))));
96
+ }));
98
97
  return {
99
98
  Encode(helpers_3) {
100
99
  const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_3)], values);
@@ -112,28 +111,38 @@ export function getDecoder(expectObject) {
112
111
  const decode = (expectObject_1) => {
113
112
  const decodeObject = {
114
113
  Decode(helpers, value) {
115
- let objectArg_1, arg_5, objectArg_2;
114
+ let arg_7, objectArg_3, arg_9, objectArg_4;
116
115
  if (helpers.isObject(value)) {
117
116
  const getters = Getters$2_$ctor_Z4BE6C149(helpers, value);
118
117
  const properties = helpers.getProperties(value);
119
118
  let result;
120
119
  const get$ = getters;
121
120
  let t;
121
+ const arg_1 = Decode_resizeArrayOrSingleton(string);
122
122
  const objectArg = get$.Required;
123
- t = objectArg.Field("@type", string);
124
- const o = new LDObject((objectArg_1 = get$.Required, objectArg_1.Field("@id", string)), t);
123
+ t = objectArg.Field("@type", arg_1);
124
+ let id;
125
+ const objectArg_1 = get$.Required;
126
+ id = objectArg_1.Field("@id", string);
127
+ let context;
128
+ const objectArg_2 = get$.Optional;
129
+ context = objectArg_2.Field("@context", decoder_1);
130
+ const o = new LDNode(id, t, unwrap((arg_7 = Decode_resizeArrayOrSingleton(string), (objectArg_3 = get$.Optional, objectArg_3.Field("additionalType", arg_7)))));
125
131
  const enumerator = getEnumerator(properties);
126
132
  try {
127
133
  while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
128
134
  const property = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
129
- if ((property !== "@id") && (property !== "@type")) {
130
- o.SetProperty(property, (arg_5 = decode(false), (objectArg_2 = get$.Required, objectArg_2.Field(property, arg_5))));
135
+ if (((property !== "@id") && (property !== "@type")) && (property !== "@context")) {
136
+ o.SetProperty(property, (arg_9 = decode(false), (objectArg_4 = get$.Required, objectArg_4.Field(property, arg_9))));
131
137
  }
132
138
  }
133
139
  }
134
140
  finally {
135
141
  disposeSafe(enumerator);
136
142
  }
143
+ if (context != null) {
144
+ o.SetContext(value_12(context));
145
+ }
137
146
  result = o;
138
147
  const matchValue = Getters$2__get_Errors(getters);
139
148
  if (!isEmpty(matchValue)) {
@@ -183,7 +192,7 @@ export function getDecoder(expectObject) {
183
192
  return map_1((value_4) => value_4, decodeObject);
184
193
  }
185
194
  else {
186
- return oneOf(ofArray([map_1((value_5) => value_5, decodeObject), map_1((value_6) => value_6, resizeArray), map_1((value_7) => value_7, string), map_1((value_8) => value_8, int), map_1((value_9) => value_9, decimal)]));
195
+ 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)]));
187
196
  }
188
197
  };
189
198
  return decode(expectObject);
@@ -0,0 +1,25 @@
1
+ import { string, object } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
2
+ import { LDRef } from "../../ROCrate/LDObject.js";
3
+ import { singleton } from "../../fable_modules/fable-library-js.4.24.0/List.js";
4
+ import { map } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
5
+
6
+ export const decoder = object((decoders) => {
7
+ let objectArg;
8
+ return new LDRef((objectArg = decoders.Required, objectArg.Field("@id", string)));
9
+ });
10
+
11
+ export function encoder(r) {
12
+ let value;
13
+ const values = singleton(["@id", (value = r.Id, {
14
+ Encode(helpers) {
15
+ return helpers.encodeString(value);
16
+ },
17
+ })]);
18
+ return {
19
+ Encode(helpers_1) {
20
+ const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_1)], values);
21
+ return helpers_1.encodeObject(arg);
22
+ },
23
+ };
24
+ }
25
+
@@ -0,0 +1,66 @@
1
+ import { object, decimal, int, string, map, oneOf } from "../../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
2
+ import { ofArray } from "../../fable_modules/fable-library-js.4.24.0/List.js";
3
+ import { dateTime } from "../Encode.js";
4
+ import { LDValue } from "../../ROCrate/LDObject.js";
5
+ import { unwrap } from "../../fable_modules/fable-library-js.4.24.0/Option.js";
6
+ import { map as map_1 } from "../../fable_modules/fable-library-js.4.24.0/Seq.js";
7
+
8
+ export const genericDecoder = oneOf(ofArray([map((value) => value, string), map((value_1) => value_1, int), map((value_2) => value_2, decimal)]));
9
+
10
+ export function genericEncoder(value) {
11
+ if (typeof value === "string") {
12
+ return {
13
+ Encode(helpers) {
14
+ return helpers.encodeString(value);
15
+ },
16
+ };
17
+ }
18
+ else if (typeof value === "number") {
19
+ return {
20
+ Encode(helpers_1) {
21
+ return helpers_1.encodeSignedIntegralNumber(value);
22
+ },
23
+ };
24
+ }
25
+ else if (typeof value === "boolean") {
26
+ return {
27
+ Encode(helpers_2) {
28
+ return helpers_2.encodeBool(value);
29
+ },
30
+ };
31
+ }
32
+ else if (typeof value === "number") {
33
+ return {
34
+ Encode(helpers_3) {
35
+ return helpers_3.encodeDecimalNumber(value);
36
+ },
37
+ };
38
+ }
39
+ else if (value instanceof Date) {
40
+ return dateTime(value);
41
+ }
42
+ else {
43
+ throw new Error("Unknown type");
44
+ }
45
+ }
46
+
47
+ export const decoder = object((decoders) => {
48
+ let objectArg, objectArg_1;
49
+ return new LDValue((objectArg = decoders.Required, objectArg.Field("@value", genericDecoder)), unwrap((objectArg_1 = decoders.Optional, objectArg_1.Field("@type", string))));
50
+ });
51
+
52
+ export function encoder(v) {
53
+ let value;
54
+ const values = ofArray([["@value", genericEncoder(v.Value)], ["@type", (value = v.ValueType, {
55
+ Encode(helpers) {
56
+ return helpers.encodeString(value);
57
+ },
58
+ })]]);
59
+ return {
60
+ Encode(helpers_1) {
61
+ const arg = map_1((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_1)], values);
62
+ return helpers_1.encodeObject(arg);
63
+ },
64
+ };
65
+ }
66
+
package/Json/Study.js CHANGED
@@ -8,7 +8,7 @@ import { ISAJson_decoder as ISAJson_decoder_3, ISAJson_encoder as ISAJson_encode
8
8
  import { OntologyAnnotation_ISAJson_decoder, OntologyAnnotation_ISAJson_encoder, OntologyAnnotation_ROCrate_decoderDefinedTerm, OntologyAnnotation_ROCrate_encoderDefinedTerm, OntologyAnnotation_decoder, OntologyAnnotation_encoder } from "./OntologyAnnotation.js";
9
9
  import { decoderCompressed as decoderCompressed_1, encoderCompressed as encoderCompressed_1, decoder as decoder_4, encoder as encoder_7 } from "./Table/ArcTable.js";
10
10
  import { decoderCompressed as decoderCompressed_2, encoderCompressed as encoderCompressed_2, decoder as decoder_5, encoder as encoder_8 } from "./DataMap/DataMap.js";
11
- import { ISAJson_decoder as ISAJson_decoder_5, ISAJson_encoder as ISAJson_encoder_6, ROCrate_decoder as ROCrate_decoder_5, ROCrate_encoder as ROCrate_encoder_5, decoder as decoder_6, encoder as encoder_9 } from "./Comment.js";
11
+ import { ISAJson_decoder as ISAJson_decoder_5, ISAJson_encoder as ISAJson_encoder_6, ROCrate_decoder as ROCrate_decoder_5, ROCrate_encoder as ROCrate_encoder_6, decoder as decoder_6, encoder as encoder_9 } from "./Comment.js";
12
12
  import { isEmpty, map as map_1 } from "../fable_modules/fable-library-js.4.24.0/Seq.js";
13
13
  import { list as list_2, resizeArray, string, object } from "../fable_modules/Thoth.Json.Core.0.4.0/Decode.fs.js";
14
14
  import { replace } from "../fable_modules/fable-library-js.4.24.0/String.js";
@@ -17,9 +17,10 @@ import { Person_removeSourceAssayComments, Person_getSourceAssayIdentifiersFromC
17
17
  import { list as list_1 } from "../fable_modules/Thoth.Json.Core.0.4.0/Encode.fs.js";
18
18
  import { ISAJson_decoder as ISAJson_decoder_1, ISAJson_encoder as ISAJson_encoder_4, ROCrate_decoder as ROCrate_decoder_2, ROCrate_encoder as ROCrate_encoder_3 } from "./Process/Process.js";
19
19
  import { ISAJson_decoder as ISAJson_decoder_2, ISAJson_encoder as ISAJson_encoder_5, ROCrate_decoder as ROCrate_decoder_1, ROCrate_encoder as ROCrate_encoder_4 } from "./Assay.js";
20
+ import { ROCrate_encoder as ROCrate_encoder_5 } from "./Data.js";
21
+ import { getProtocols, getCharacteristics, getFactors, getUnits, getData } from "../Core/Process/ProcessSequence.js";
20
22
  import { context_jsonvalue } from "./context/rocrate/isa_study_context.js";
21
23
  import { disposeSafe, getEnumerator } from "../fable_modules/fable-library-js.4.24.0/Util.js";
22
- import { getProtocols, getCharacteristics, getFactors, getUnits } from "../Core/Process/ProcessSequence.js";
23
24
  import { encoder as encoder_10 } from "./Process/Factor.js";
24
25
  import { encoder as encoder_11 } from "./Process/MaterialAttribute.js";
25
26
  import { encoder as encoder_12 } from "./Process/StudyMaterials.js";
@@ -127,7 +128,7 @@ export function ROCrate_genID(a) {
127
128
  return "#EmptyStudy";
128
129
  }
129
130
  else {
130
- return `#study/${replace(matchValue, " ", "_")}`;
131
+ return `studies/${replace(matchValue, " ", "_")}/`;
131
132
  }
132
133
  }
133
134
 
@@ -172,7 +173,7 @@ export function ROCrate_encoder(assays, s) {
172
173
  Encode(helpers_8) {
173
174
  return helpers_8.encodeString(value_12);
174
175
  },
175
- }), s.PublicReleaseDate), tryIncludeSeq("publications", ROCrate_encoder_1, s.Publications), tryIncludeSeq("people", ROCrate_encoder_2, s.Contacts), tryIncludeList("processSequence", (studyName = s.Identifier, (oa_3) => ROCrate_encoder_3(studyName, undefined, oa_3)), processes), tryIncludeSeq("assays", (studyName_1 = s.Identifier, (a_1) => ROCrate_encoder_4(studyName_1, a_1)), assays_1), tryIncludeSeq("comments", ROCrate_encoder_5, s.Comments), ["@context", context_jsonvalue]]));
176
+ }), s.PublicReleaseDate), tryIncludeSeq("publications", ROCrate_encoder_1, s.Publications), tryIncludeSeq("people", ROCrate_encoder_2, s.Contacts), tryIncludeList("processSequence", (studyName = s.Identifier, (oa_3) => ROCrate_encoder_3(studyName, undefined, oa_3)), processes), tryIncludeSeq("assays", (studyName_1 = s.Identifier, (a_1) => ROCrate_encoder_4(studyName_1, a_1)), assays_1), tryIncludeList("dataFiles", ROCrate_encoder_5, getData(processes)), tryIncludeSeq("comments", ROCrate_encoder_6, s.Comments), ["@context", context_jsonvalue]]));
176
177
  return {
177
178
  Encode(helpers_9) {
178
179
  const arg = map_1((tupledArg_1) => [tupledArg_1[0], tupledArg_1[1].Encode(helpers_9)], values);
@@ -42,7 +42,7 @@ export const context_jsonvalue = (() => {
42
42
  },
43
43
  }], ["title", {
44
44
  Encode(helpers_3) {
45
- return helpers_3.encodeString("sdo:headline");
45
+ return helpers_3.encodeString("sdo:name");
46
46
  },
47
47
  }], ["additionalType", {
48
48
  Encode(helpers_4) {
@@ -93,5 +93,5 @@ export const context_jsonvalue = (() => {
93
93
  };
94
94
  })();
95
95
 
96
- export const context_str = "\r\n{\r\n \"@context\": {\r\n \"sdo\": \"http://schema.org/\",\r\n \"arc\": \"http://purl.org/nfdi4plants/ontology/\",\r\n\r\n \"Investigation\": \"sdo:Dataset\",\r\n\r\n \"identifier\" : \"sdo:identifier\",\r\n \"title\": \"sdo:headline\",\r\n \"description\": \"sdo:description\",\r\n \"submissionDate\": \"sdo:dateCreated\",\r\n \"publicReleaseDate\": \"sdo:datePublished\",\r\n \"publications\": \"sdo:citation\",\r\n \"people\": \"sdo:creator\",\r\n \"studies\": \"sdo:hasPart\",\r\n \"ontologySourceReferences\": \"sdo:mentions\",\r\n \"comments\": \"sdo:disambiguatingDescription\",\r\n\r\n \"publications?\": \"sdo:SubjectOf?\",\r\n \"filename\": \"sdo:alternateName\"\r\n }\r\n}\r\n ";
96
+ export const context_str = "\r\n{\r\n \"@context\": {\r\n \"sdo\": \"http://schema.org/\",\r\n \"arc\": \"http://purl.org/nfdi4plants/ontology/\",\r\n\r\n \"Investigation\": \"sdo:Dataset\",\r\n\r\n \"identifier\" : \"sdo:identifier\",\r\n \"title\": \"sdo:name\",\r\n \"description\": \"sdo:description\",\r\n \"submissionDate\": \"sdo:dateCreated\",\r\n \"publicReleaseDate\": \"sdo:datePublished\",\r\n \"publications\": \"sdo:citation\",\r\n \"people\": \"sdo:creator\",\r\n \"studies\": \"sdo:hasPart\",\r\n \"ontologySourceReferences\": \"sdo:mentions\",\r\n \"comments\": \"sdo:disambiguatingDescription\",\r\n\r\n \"publications?\": \"sdo:SubjectOf?\",\r\n \"filename\": \"sdo:alternateName\"\r\n }\r\n}\r\n ";
97
97
 
@@ -81,27 +81,31 @@ export const context_jsonvalue = (() => {
81
81
  Encode(helpers_10) {
82
82
  return helpers_10.encodeString("sdo:hasPart");
83
83
  },
84
- }], ["filename", {
84
+ }], ["dataFiles", {
85
85
  Encode(helpers_11) {
86
- return helpers_11.encodeString("sdo:alternateName");
86
+ return helpers_11.encodeString("sdo:hasPart");
87
87
  },
88
- }], ["comments", {
88
+ }], ["filename", {
89
89
  Encode(helpers_12) {
90
- return helpers_12.encodeString("sdo:comment");
90
+ return helpers_12.encodeString("sdo:alternateName");
91
91
  },
92
- }], ["processSequence", {
92
+ }], ["comments", {
93
93
  Encode(helpers_13) {
94
- return helpers_13.encodeString("sdo:about");
94
+ return helpers_13.encodeString("sdo:comment");
95
95
  },
96
- }], ["studyDesignDescriptors", {
96
+ }], ["processSequence", {
97
97
  Encode(helpers_14) {
98
- return helpers_14.encodeString("arc:ARC#ARC_00000037");
98
+ return helpers_14.encodeString("sdo:about");
99
+ },
100
+ }], ["studyDesignDescriptors", {
101
+ Encode(helpers_15) {
102
+ return helpers_15.encodeString("arc:ARC#ARC_00000037");
99
103
  },
100
104
  }]];
101
105
  return {
102
- Encode(helpers_15) {
103
- const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_15)], values);
104
- return helpers_15.encodeObject(arg);
106
+ Encode(helpers_16) {
107
+ const arg = map((tupledArg) => [tupledArg[0], tupledArg[1].Encode(helpers_16)], values);
108
+ return helpers_16.encodeObject(arg);
105
109
  },
106
110
  };
107
111
  })();
@@ -50,7 +50,7 @@ export const context_jsonvalue = (() => {
50
50
  },
51
51
  }], ["conformsTo", {
52
52
  Encode(helpers_4) {
53
- return helpers_4.encodeString("sdo:conformsTo");
53
+ return helpers_4.encodeString("http://purl.org/dc/terms/conformsTo");
54
54
  },
55
55
  }]];
56
56
  return {
@@ -1,11 +1,12 @@
1
1
  import { fromString } from "../fable_modules/Thoth.Json.JavaScript.0.3.0/Decode.fs.js";
2
- import { encoder, decoder as decoder_1 } from "../Json/LDObject.js";
2
+ import { encoder, decoder as decoder_1 } from "../Json/ROCrate/LDNode.js";
3
3
  import { printf, toText } from "../fable_modules/fable-library-js.4.24.0/String.js";
4
4
  import { toString } from "../fable_modules/Thoth.Json.JavaScript.0.3.0/Encode.fs.js";
5
5
  import { defaultSpaces } from "../Json/Encode.js";
6
6
  import { unwrap } from "../fable_modules/fable-library-js.4.24.0/Option.js";
7
+ import { encoder as encoder_1, decoder as decoder_2 } from "../Json/ROCrate/LDGraph.js";
7
8
 
8
- export function ARCtrl_ROCrate_LDObject__LDObject_fromROCrateJsonString_Static_Z721C83C5(s) {
9
+ export function ARCtrl_ROCrate_LDNode__LDNode_fromROCrateJsonString_Static_Z721C83C5(s) {
9
10
  const matchValue = fromString(decoder_1, s);
10
11
  if (matchValue.tag === 1) {
11
12
  throw new Error(toText(printf("Error decoding string: %O"))(matchValue.fields[0]));
@@ -18,14 +19,38 @@ export function ARCtrl_ROCrate_LDObject__LDObject_fromROCrateJsonString_Static_Z
18
19
  /**
19
20
  * exports in json-ld format
20
21
  */
21
- export function ARCtrl_ROCrate_LDObject__LDObject_toROCrateJsonString_Static_71136F3F(spaces) {
22
+ export function ARCtrl_ROCrate_LDNode__LDNode_toROCrateJsonString_Static_71136F3F(spaces) {
22
23
  return (obj) => {
23
24
  const value = encoder(obj);
24
25
  return toString(defaultSpaces(spaces), value);
25
26
  };
26
27
  }
27
28
 
28
- export function ARCtrl_ROCrate_LDObject__LDObject_ToROCrateJsonString_71136F3F(this$, spaces) {
29
- return ARCtrl_ROCrate_LDObject__LDObject_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
29
+ export function ARCtrl_ROCrate_LDNode__LDNode_ToROCrateJsonString_71136F3F(this$, spaces) {
30
+ return ARCtrl_ROCrate_LDNode__LDNode_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
31
+ }
32
+
33
+ export function ARCtrl_ROCrate_LDGraph__LDGraph_fromROCrateJsonString_Static_Z721C83C5(s) {
34
+ const matchValue = fromString(decoder_2, s);
35
+ if (matchValue.tag === 1) {
36
+ throw new Error(toText(printf("Error decoding string: %O"))(matchValue.fields[0]));
37
+ }
38
+ else {
39
+ return matchValue.fields[0];
40
+ }
41
+ }
42
+
43
+ /**
44
+ * exports in json-ld format
45
+ */
46
+ export function ARCtrl_ROCrate_LDGraph__LDGraph_toROCrateJsonString_Static_71136F3F(spaces) {
47
+ return (obj) => {
48
+ const value = encoder_1(obj);
49
+ return toString(defaultSpaces(spaces), value);
50
+ };
51
+ }
52
+
53
+ export function ARCtrl_ROCrate_LDGraph__LDGraph_ToROCrateJsonString_71136F3F(this$, spaces) {
54
+ return ARCtrl_ROCrate_LDGraph__LDGraph_toROCrateJsonString_Static_71136F3F(unwrap(spaces))(this$);
30
55
  }
31
56
 
package/README.md CHANGED
@@ -1,3 +1,6 @@
1
+
2
+ ![logo](logos/ARCtrl_horizontal.png)
3
+
1
4
  # ARCtrl
2
5
 
3
6
  > **ARCtrl** the easy way to read, manipulate and write ARCs in __.NET__, __JavaScript__ and __Python__! ❤️
@@ -34,9 +37,7 @@ pip install arctrl
34
37
 
35
38
  ## Docs
36
39
 
37
- Currently we provide some documentation in form of markdown files in the `/docs` folder of this repository!
38
-
39
- [Check it out!](/docs)
40
+ Documentation can be found [here](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/arctrl/)
40
41
 
41
42
  ## Development
42
43
 
@@ -75,6 +76,14 @@ On windows you can use the `setup.cmd` to run the following steps automatically!
75
76
 
76
77
  Verify correct setup with `./build.cmd runtests` ✨
77
78
 
79
+ ## Branding
80
+
81
+ Feel free to reference `ARCtrl` on slides or elsewhere using our logos:
82
+
83
+ |Square | Horizontal | Vertical |
84
+ | - | - | - |
85
+ | ![square](logos/ARCtrl_square.png) | ![horizontal](logos/ARCtrl_horizontal.png) | ![vertical](logos/ARCtrl_vertical.png) |
86
+
78
87
  ## Performance
79
88
 
80
89
  Measured on 13th Gen Intel(R) Core(TM) i7-13800H
@@ -1,13 +1,14 @@
1
1
  import { defaultOf } from "../fable_modules/fable-library-js.4.24.0/Util.js";
2
2
  import { FSharpRef } from "../fable_modules/fable-library-js.4.24.0/Types.js";
3
- import { setOptionalProperty } from "../fable_modules/DynamicObj.4.0.3/DynObj.fs.js";
4
- import { DynamicObj } from "../fable_modules/DynamicObj.4.0.3/DynamicObj.fs.js";
5
- import { LDObject_$reflection, LDObject, LDContext_$ctor } from "./LDObject.js";
3
+ import { setOptionalProperty } from "../fable_modules/DynamicObj.7.0.1/DynObj.fs.js";
4
+ import { DynamicObj } from "../fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js";
5
+ import { LDContext } from "./LDContext.js";
6
+ import { LDNode_$reflection, LDNode } from "./LDObject.js";
6
7
  import { class_type } from "../fable_modules/fable-library-js.4.24.0/Reflection.js";
7
8
 
8
- export class ArcROCrateMetadata extends LDObject {
9
+ export class ArcROCrateMetadata extends LDNode {
9
10
  constructor(about) {
10
- super("ro-crate-metadata", "CreativeWork");
11
+ super("ro-crate-metadata", ["CreativeWork"]);
11
12
  const this$ = new FSharpRef(defaultOf());
12
13
  this$.contents = this;
13
14
  this["init@5"] = 1;
@@ -15,21 +16,21 @@ export class ArcROCrateMetadata extends LDObject {
15
16
  const conformsTo = new DynamicObj();
16
17
  conformsTo.SetProperty("@id", "https://w3id.org/ro/crate/1.1");
17
18
  this$.contents.SetProperty("conformsTo", conformsTo);
18
- const context = LDContext_$ctor();
19
- context.SetProperty("sdo", "http://schema.org/");
20
- context.SetProperty("arc", "http://purl.org/nfdi4plants/ontology/");
21
- context.SetProperty("CreativeWork", "sdo:CreativeWork");
22
- context.SetProperty("about", "sdo:about");
23
- context.SetProperty("conformsTo", "sdo:conformsTo");
19
+ const context = new LDContext();
20
+ context.AddMapping("sdo", "http://schema.org/");
21
+ context.AddMapping("arc", "http://purl.org/nfdi4plants/ontology/");
22
+ context.AddMapping("CreativeWork", "sdo:CreativeWork");
23
+ context.AddMapping("about", "sdo:about");
24
+ context.AddMapping("conformsTo", "sdo:conformsTo");
24
25
  this$.contents.SetProperty("@context", context);
25
26
  }
26
27
  }
27
28
 
28
29
  export function ArcROCrateMetadata_$reflection() {
29
- return class_type("ARCtrl.ROCrate.ArcROCrateMetadata", undefined, ArcROCrateMetadata, LDObject_$reflection());
30
+ return class_type("ARCtrl.ROCrate.ArcROCrateMetadata", undefined, ArcROCrateMetadata, LDNode_$reflection());
30
31
  }
31
32
 
32
- export function ArcROCrateMetadata_$ctor_Z475E1643(about) {
33
+ export function ArcROCrateMetadata_$ctor_Z7020538(about) {
33
34
  return new ArcROCrateMetadata(about);
34
35
  }
35
36
 
@@ -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 LDComment {
7
+ constructor() {
8
+ }
9
+ static get schemaType() {
10
+ return "http://schema.org/Comment";
11
+ }
12
+ static get text() {
13
+ return "http://schema.org/text";
14
+ }
15
+ static get name() {
16
+ return "http://schema.org/name";
17
+ }
18
+ static tryGetTextAsString(dt, context) {
19
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.text, 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 getTextAsString(dt, context) {
41
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.text, 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 \`text\` of object with @id \`${dt.Id}\` was not a string`);
49
+ }
50
+ }
51
+ else {
52
+ throw new Error(`Could not access property \`text\` of object with @id \`${dt.Id}\``);
53
+ }
54
+ }
55
+ static setTextAsString(dt, text, context) {
56
+ return dt.SetProperty(LDComment.text, text, unwrap(context));
57
+ }
58
+ static tryGetNameAsString(dt, context) {
59
+ const matchValue = dt.TryGetPropertyAsSingleton(LDComment.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(LDComment.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(LDComment.name, name, unwrap(context));
97
+ }
98
+ static genID(name, text) {
99
+ return clean((text == null) ? (`#LDComment_${name}`) : (`#LDComment_${name}_${text}`));
100
+ }
101
+ static validate(dt, context) {
102
+ return dt.HasType(LDComment.schemaType, unwrap(context)) && dt.HasProperty(LDComment.name, unwrap(context));
103
+ }
104
+ static create(name, id, text, context) {
105
+ const dt = new LDNode((id == null) ? LDComment.genID(name, unwrap(text)) : id, [LDComment.schemaType], undefined, unwrap(context));
106
+ dt.SetProperty(LDComment.name, name, unwrap(context));
107
+ dt.SetOptionalProperty(LDComment.text, text, unwrap(context));
108
+ return dt;
109
+ }
110
+ }
111
+
112
+ export function LDComment_$reflection() {
113
+ return class_type("ARCtrl.ROCrate.LDComment", undefined, LDComment);
114
+ }
115
+