materialdigital / core-ontology

The PMD Core Ontology (PMDco) official release repository
12 stars 10 forks source link

Evaluate the use of the Common Workflow Language (CWL) for workflow sequences within the PMDco? #23

Open BerndBayerlein opened 1 year ago

joergwa commented 1 year ago

CWL file:

cwlVersion: v1.2

# What type of CWL process we have in this document.
class: CommandLineTool
# This CommandLineTool executes the linux "echo" command-line tool.
baseCommand: echo

# The inputs for this process.
inputs:
  message:
    type: string
    # A default value that can be overridden, e.g. --message "Hola mundo"
    default: "Hello World"
    # Bind this message value as an argument to "echo".
    inputBinding:
      position: 1
outputs: []

RDF conversion with cwltool:

cwltool --print-rdf --rdf-serializer=turtle test.cwl

Nice RDF result:

@prefix CommandLineBinding: <https://w3id.org/cwl/cwl#CommandLineBinding/> .
@prefix cwl: <https://w3id.org/cwl/cwl#> .
@prefix ns1: <http://commonwl.org/cwltool#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sld: <https://w3id.org/cwl/salad#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<file:///Users/joerg/test.cwl> a cwl:CommandLineTool ;
    ns1:original_cwlVersion "v1.2" ;
    cwl:baseCommand ( "echo" ) ;
    cwl:cwlVersion cwl:v1.2 ;
    cwl:inputs <file:///Users/joerg/test.cwl#message> .

<file:///Users/joerg/test.cwl#message> cwl:inputBinding [ CommandLineBinding:position 1 ] ;
    sld:default "Hello World" ;
    sld:type xsd:string .