CWLDotNet 0.1.0

dotnet add package CWLDotNet --version 0.1.0
NuGet\Install-Package CWLDotNet -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CWLDotNet" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CWLDotNet --version 0.1.0
#r "nuget: CWLDotNet, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CWLDotNet as a Cake Addin
#addin nuget:?package=CWLDotNet&version=0.1.0

// Install CWLDotNet as a Cake Tool
#tool nuget:?package=CWLDotNet&version=0.1.0

CWLDotNet

example workflow

This project contains .Net objects and utilities auto-generated by https://github.com/common-workflow-language/schema_salad for parsing documents corresponding to the https://w3id.org/cwl/cwl schema

Usage

Loading Documents

// Specify the CWL file to load
Uri fileUri = new Uri(Path.GetFullPath("my-cwl-document.cwl"));

// Read the file contents 
string fileContent = System.IO.File.ReadAllText(fileUri.AbsolutePath);

// Parse the CWL document
var doc = CWLDotNet.RootLoader.LoadDocument(fileContent, fileUri.AbsoluteUri);

// Work with the document
doc.Switch(
    CommandLineTool => Console.WriteLine("The loaded document is a CommandLineTool"),
    ExpressionTool => Console.WriteLine("The loaded document is a ExpressionTool"),
    Workflow => Console.WriteLine("The loaded document is a Workflow"),
    Operation => Console.WriteLine("The loaded document is an Operation"),
    ListOf => Console.WriteLine("This is a list of one of: CommandLineTool | ExpressionTool | Workflow | Operation")
);

Creating, Editing and Serializing Documents

using System.Text.Json;
using CWLDotNet;

// Create a CommandLineTool with empty inputs and outputs
CommandLineTool mytool = new CommandLineTool(new(),new());

// Set the base command
mytool.baseCommand = "echo";

// Create an input parameter with a default value
CommandInputParameter input1 = new CommandInputParameter(CWLType.INT);
input1.default_ = "Hello World!";

// Add the input to the tool
mytool.inputs.Add(input1);

// Serialize the tool
string outDoc = JsonSerializer.Serialize(mytool.Save());

Documentation

The complete documentation, autogenerated by DocFX can be found under the following link: https://common-workflow-lab.github.io/CWLDotNet/

Limitations

CWLDotNet only supports the CWL v1.2 syntax. Other documents have to be upgraded using the cwl-upgrader

Maintainers

@ZimmerA

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 207 6/27/2022