Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions Operation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
saladVersion: v1.1
$base: "https://w3id.org/cwl/cwl#"

$namespaces:
cwl: "https://w3id.org/cwl/cwl#"

$graph:

- name: OperationInputParameter
type: record
extends: InputParameter
docParent: "#Operation"
doc: |
Describe an input parameter of an operation.
fields:
- name: type
type:
- CWLType
- InputRecordSchema
- InputEnumSchema
- InputArraySchema
- string
- type: array
items:
- CWLType
- InputRecordSchema
- InputEnumSchema
- InputArraySchema
- string
jsonldPredicate:
"_id": "sld:type"
"_type": "@vocab"
refScope: 2
typeDSL: True
doc: |
Specify valid types of data that may be assigned to this parameter.

- name: OperationOutputParameter
type: record
extends: OutputParameter
docParent: "#Operation"
doc: |
Describe an output parameter of an operation.
fields:
- name: type
type:
- CWLType
- OutputRecordSchema
- OutputEnumSchema
- OutputArraySchema
- string
- type: array
items:
- CWLType
- OutputRecordSchema
- OutputEnumSchema
- OutputArraySchema
- string
jsonldPredicate:
"_id": "sld:type"
"_type": "@vocab"
refScope: 2
typeDSL: True
doc: |
Specify valid types of data that may be assigned to this parameter.

- type: record
name: Operation
extends: Process
documentRoot: true
specialize:
- specializeFrom: InputParameter
specializeTo: OperationInputParameter
- specializeFrom: OutputParameter
specializeTo: OperationOutputParameter
doc: |
This record describes an abstract operation. It is a potential
step of a workflow that has not yet been bound to a concrete
implementation. It specifies an input and output signature, but
cannot be executed.

fields:
- name: class
jsonldPredicate:
"_id": "@type"
"_type": "@vocab"
type: string
14 changes: 8 additions & 6 deletions Workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ $graph:
- |
# Abstract

One way to define a workflow is: an analysis task represented by a
directed graph describing a sequence of operations that transform an
input data set to output. This specification defines the Common Workflow
Language (CWL) Workflow description, a vendor-neutral standard for
representing workflows intended to be portable across a variety of
computing platforms.
This specification defines the Common Workflow Language (CWL)
Workflow description, a vendor-neutral standard for representing
analysis tasks where a sequence of operations are described
using a directed graph of operations to transform input to
output. CWL is portable across a variety of computing
platforms.

- {$include: intro.md}

Expand Down Expand Up @@ -734,3 +734,5 @@ $graph:
jsonldPredicate:
"_id": "@type"
"_type": "@vocab"

- {$import: Operation.yml}
25 changes: 25 additions & 0 deletions tests/operation.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Example of an operation that has not yet been implemented
#
class: Operation
cwlVersion: v1.2.0-dev1

# an Operation is a placeholder for a CommandLineTool or
# Workflow to be added later, therefore its documentation
# are very important.
id: reverse
doc: "Reverse each line"

# The "inputs" array work the same as in CommandLineTool, but do
# not have any inputBinding
inputs:
input:
type: File

# The "outputs" array defines the structure of the output object, just like
# in CommandLineTool, but without outputBinding
outputs:
output:
type: File

# There are no "run" or "steps" command (FIXME: Should they be allowed?)
52 changes: 52 additions & 0 deletions tests/revsort-abstract.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# This is a variant of revsort.cwl where the "sorted"
# step has not yet been implemented, but has a placeholder
# Operation.
#
class: Workflow
doc: "Reverse the lines in a document, then sort those lines."
cwlVersion: v1.2.0-dev1

inputs:
input:
type: File
doc: "The input file to be processed."
reverse_sort:
type: boolean
default: true
doc: "If true, reverse (decending) sort"

outputs:
output:
type: File
outputSource: sort/sorted
doc: "The output with the lines reversed and sorted."

steps:
rev:
in:
input: input
out: [output]
run: revtool.cwl

sort:
in:
input: rev/output
reverse: reverse_sort
out: [sorted]
run:
class: Operation
id: "sort"
doc: "Sort the lines of the file"
inputs:
input:
type: File
doc: "The input file to be sorted."
reverse:
type: boolean
default: true
doc: "If true, reverse (decending) sort"
outputs:
sorted:
type: File
doc: "The sorted file"