Package jline.io

Class WfCommonsLoader

java.lang.Object
jline.io.WfCommonsLoader

public class WfCommonsLoader extends Object
Loader for WfCommons workflow JSON files.

WfCommons (https://github.com/wfcommons/workflow-schema) is a standard format for representing scientific workflow traces. This loader converts WfCommons JSON files into LINE Workflow objects.

Supported schema versions: 1.4, 1.5

Example usage:

 Workflow wf = WfCommonsLoader.load("workflow.json");
 APH ph = wf.toPH();
 System.out.println("Mean execution time: " + ph.getMean());
 

  • Method Details

    • load

      public static Workflow load(String jsonFile) throws IOException
      Load a WfCommons JSON file into a Workflow object.
      Parameters:
      jsonFile - Path to the WfCommons JSON file
      Returns:
      Workflow object
      Throws:
      IOException - If the file cannot be read
      IllegalArgumentException - If the JSON is invalid
    • load

      public static Workflow load(String jsonFile, WfCommonsOptions options) throws IOException
      Load a WfCommons JSON file with options.
      Parameters:
      jsonFile - Path to the WfCommons JSON file
      options - Loader options
      Returns:
      Workflow object
      Throws:
      IOException - If the file cannot be read
      IllegalArgumentException - If the JSON is invalid
    • loadFromUrl

      public static Workflow loadFromUrl(String urlString) throws IOException
      Load a WfCommons JSON file from a URL.

      Useful for loading workflows directly from repositories like wfcommons/pegasus-instances.

      Parameters:
      urlString - URL pointing to a WfCommons JSON file
      Returns:
      Workflow object
      Throws:
      IOException - If the URL cannot be read
      IllegalArgumentException - If the JSON is invalid
    • loadFromUrl

      public static Workflow loadFromUrl(String urlString, WfCommonsOptions options) throws IOException
      Load a WfCommons JSON file from a URL with options.
      Parameters:
      urlString - URL pointing to a WfCommons JSON file
      options - Loader options
      Returns:
      Workflow object
      Throws:
      IOException - If the URL cannot be read
      IllegalArgumentException - If the JSON is invalid
    • loadFromString

      public static Workflow loadFromString(String json)
      Load a workflow from a JSON string.
      Parameters:
      json - JSON string in WfCommons format
      Returns:
      Workflow object
      Throws:
      IllegalArgumentException - If the JSON is invalid
    • loadFromString

      public static Workflow loadFromString(String json, WfCommonsOptions options)
      Load a workflow from a JSON string with options.
      Parameters:
      json - JSON string in WfCommons format
      options - Loader options
      Returns:
      Workflow object
      Throws:
      IllegalArgumentException - If the JSON is invalid
    • validateFile

      public static boolean validateFile(String jsonFile)
      Validate if a file is a valid WfCommons JSON.
      Parameters:
      jsonFile - Path to the file
      Returns:
      true if valid