tree: ba053fd34c67bcd42290faec9c9e7b10c079c19a [path history] [tgz]
  2. pom.xml
  3. src/

Convert SCUFL2 to wfdesc

This is an extension to Scufl2 API which provides the export capability to wfdesc ontology from the Wf4Ever [2] RO wfdesc ontology.

You can use the tavlang convert command line tool for converting Taverna workflows to wfdesc.


The output is a RDF Turtle document containing statements about the workflow structure according to the RO ontology wfdesc ontology, with additional service descriptions using the wf4ever ontology where supported.

: stain@ralph ~/src/wf4ever/scufl2-wfdesc; cat src/test/resources/helloworld.wfdesc.ttl
	@base <> .
	@prefix rdfs: <> .
	@prefix xsd: <> .
	@prefix owl: <> .
	@prefix prov: <> .
	@prefix wfdesc: <> .
	@prefix wf4ever: <> .
	@prefix roterms: <> .
	@prefix dc: <> .
	@prefix dcterms: <> .
	@prefix comp: <> .
	@prefix dep: <> .
	@prefix biocat: <> .
	@prefix : <#> .

	<datalink?from=processor/hello/out/value&to=out/greeting> a wfdesc:DataLink ;
		wfdesc:hasSource <processor/hello/out/value> ;
		wfdesc:hasSink <out/greeting> .

	<> a wfdesc:Workflow , wfdesc:Description , wfdesc:Process ;
		dc:creator "Stian Soiland-Reyes" ;
		dcterms:description "One of the simplest workflows possible. No workflow input ports, a single workflow output port \"greeting\",  outputting \"Hello, world!\" as produced by the String Constant \"hello\"." ;
		dcterms:title "Hello World" ;
		rdfs:label "Hello_World" ;
		wfdesc:hasOutput <out/greeting> ;
		wfdesc:hasSubProcess <processor/hello/> ;
		wfdesc:hasDataLink <datalink?from=processor/hello/out/value&to=out/greeting> .

	<out/greeting> a wfdesc:Output , wfdesc:Description , wfdesc:Input ;
		rdfs:label "greeting" .

	<processor/hello/> a wfdesc:Process , wfdesc:Description ;
		rdfs:label "hello" ;
		wfdesc:hasOutput <processor/hello/out/value> .

	<processor/hello/out/value> a wfdesc:Output , wfdesc:Description ;
		rdfs:label "value" .

Extracted annotations

Annotations in the workflow are also extracted for the workflow, processors and input ports (see namespaces above):

  • dc:creator
  • dcterms:description
  • dcterms:title
  • biocat:exampleData

Richer semantic annotations (e.g. on Taverna Components) are extracted verbatim, e.g.:

	<> a wfdesc:Workflow , wfdesc:Description , wfdesc:Process ;
		comp:fits comp:MigrationAction ;
		comp:migrates _:node18musbm56x1 .

	_:node18musbm56x1 a comp:MigrationPath ;
		comp:fromMimetype "image/tiff" ;
		comp:toMimetype "image/tiff" .

See valid_component_imagemagickconvert.wfdesc.ttl for the complete example.


import org.apache.taverna.scufl2.api.container.WorkflowBundle;

File original = new File("helloworld.t2flow");
File output = new File("helloworld.wfdesc.ttl");
String original = null; // to guess filetype
WorkflowBundle wfBundle = io.readBundle(original, null);
io.writeBundle(wfBundle, output, "text/vnd.wf4ever.wfdesc+turtle");

Common queries

These queries can be executed using SPARQL on the returned wfdesc Turtle, and assume these PREFIXes:

PREFIX prov: <>
PREFIX wfdesc: <>
PREFIX wfprov: <>
PREFIX tavernaprov: <>
PREFIX cnt:  <>
PREFIX rdfs: <>
PREFIX wf4ever: <>
PREFIX comp: <>

How do I exclude nested workflows from a query?

The wfdesc model does not have a concept of “top-level” workflow, however you can use a SPARQL NOT EXISTS filter to skip any nested workflows:

  ?wf a wfdesc:Workflow .

      ?processInParent prov:specializationOf ?wf .
      ?parent wfdesc:hasSubProcess ?processInParent
  } .

Thus any workflow ?wf which (specialization) has been used as a sub-process in ?parent are excluded from the result. As SCUFL2 workflows have unique URIs within each workflow bundle, e.g. - the above would not be excluding a workflow just because its structure has been reused elsewhere.

How do I select processors in the top-level workflows?

A variant of the above is if you are only interested in processors in top-level workflows:

  ?wf a wfdesc:Workflow ;
      wfdesc:hasSubProcess ?proc .

      ?processInParent prov:specializationOf ?wf .
      ?parent wfdesc:hasSubProcess ?processInParent
  } .