Skip to content

Commit e3deae4

Browse files
caroottHLWeil
authored andcommitted
add workflowprotocol
1 parent 1a3a934 commit e3deae4

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

src/ROCrate/ARCtrl.ROCrate.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<Compile Include="Generic\FormalParameter.fs" />
3434
<Compile Include="Generic\ComputationalWorkflow.fs" />
3535
<Compile Include="Generic\SoftwareSourceCode.fs" />
36+
<Compile Include="Generic\WorkflowProtocol.fs" />
3637

3738
<!-- ISA Profile types -->
3839
<Compile Include="ISAProfile\Dataset.fs" />
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
namespace ARCtrl.ROCrate
2+
3+
open DynamicObj
4+
open Fable.Core
5+
open ARCtrl.ROCrate
6+
open ARCtrl.Helper
7+
8+
[<AttachMembers>]
9+
type LDWorkflowProtocol =
10+
11+
static member validate (wp : LDNode, ?context : LDContext) =
12+
LDComputationalWorkflow.validate(wp, ?context = context)
13+
&& LDSoftwareSourceCode.validate(wp, ?context = context)
14+
&& LDLabProtocol.validate(wp, ?context = context)
15+
16+
static member create
17+
(
18+
?id : string,
19+
?inputs : ResizeArray<LDNode>,
20+
?outputs : ResizeArray<LDNode>,
21+
?creator : LDNode,
22+
?dateCreated : string,
23+
?licenses : ResizeArray<LDNode>,
24+
?name : string,
25+
?programmingLanguages : ResizeArray<LDNode>,
26+
?sdPublisher : LDNode,
27+
?url : string,
28+
?version : string,
29+
?description : string,
30+
?hasParts : ResizeArray<LDNode>,
31+
?intendedUse : LDNode,
32+
?comments : ResizeArray<LDNode>,
33+
?computationalTools : ResizeArray<LDNode>,
34+
?context : LDContext
35+
) =
36+
let id =
37+
match id with
38+
| Some i -> i
39+
| None -> $"#ComputationalWorkflow_{ARCtrl.Helper.Identifier.createMissingIdentifier()}" |> Helper.ID.clean
40+
let wp = LDNode(id, ResizeArray [LDComputationalWorkflow.schemaType], ?context = context)
41+
wp.SetOptionalProperty(LDComputationalWorkflow.input, inputs, ?context = context)
42+
wp.SetOptionalProperty(LDComputationalWorkflow.output, outputs, ?context = context)
43+
wp.SetOptionalProperty(LDComputationalWorkflow.creator, creator, ?context = context)
44+
wp.SetOptionalProperty(LDComputationalWorkflow.dateCreated, dateCreated, ?context = context)
45+
wp.SetOptionalProperty(LDComputationalWorkflow.license, licenses, ?context = context)
46+
wp.SetOptionalProperty(LDComputationalWorkflow.name, name, ?context = context)
47+
wp.SetOptionalProperty(LDComputationalWorkflow.programmingLanguage, programmingLanguages, ?context = context)
48+
wp.SetOptionalProperty(LDComputationalWorkflow.sdPublisher, sdPublisher, ?context = context)
49+
wp.SetOptionalProperty(LDComputationalWorkflow.url, url, ?context = context)
50+
wp.SetOptionalProperty(LDComputationalWorkflow.version, version, ?context = context)
51+
wp.SetOptionalProperty(LDComputationalWorkflow.description, description, ?context = context)
52+
wp.SetOptionalProperty(LDComputationalWorkflow.hasPart, hasParts, ?context = context)
53+
wp.SetOptionalProperty(LDLabProtocol.intendedUse, intendedUse, ?context = context)
54+
wp.SetOptionalProperty(LDLabProtocol.computationalTool, computationalTools, ?context = context)
55+
wp.SetOptionalProperty(LDComputationalWorkflow.comment, comments, ?context = context)
56+
wp
57+

0 commit comments

Comments
 (0)