Package jline.io
Class WfCommonsLoader
java.lang.Object
jline.io.WfCommonsLoader
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 Summary
Modifier and TypeMethodDescriptionstatic WorkflowLoad a WfCommons JSON file into a Workflow object.static Workflowload(String jsonFile, WfCommonsOptions options) Load a WfCommons JSON file with options.static WorkflowloadFromString(String json) Load a workflow from a JSON string.static WorkflowloadFromString(String json, WfCommonsOptions options) Load a workflow from a JSON string with options.static WorkflowloadFromUrl(String urlString) Load a WfCommons JSON file from a URL.static WorkflowloadFromUrl(String urlString, WfCommonsOptions options) Load a WfCommons JSON file from a URL with options.static booleanvalidateFile(String jsonFile) Validate if a file is a valid WfCommons JSON.
-
Method Details
-
load
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 readIllegalArgumentException- If the JSON is invalid
-
load
Load a WfCommons JSON file with options.- Parameters:
jsonFile- Path to the WfCommons JSON fileoptions- Loader options- Returns:
- Workflow object
- Throws:
IOException- If the file cannot be readIllegalArgumentException- If the JSON is invalid
-
loadFromUrl
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 readIllegalArgumentException- If the JSON is invalid
-
loadFromUrl
Load a WfCommons JSON file from a URL with options.- Parameters:
urlString- URL pointing to a WfCommons JSON fileoptions- Loader options- Returns:
- Workflow object
- Throws:
IOException- If the URL cannot be readIllegalArgumentException- If the JSON is invalid
-
loadFromString
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
Load a workflow from a JSON string with options.- Parameters:
json- JSON string in WfCommons formatoptions- Loader options- Returns:
- Workflow object
- Throws:
IllegalArgumentException- If the JSON is invalid
-
validateFile
Validate if a file is a valid WfCommons JSON.- Parameters:
jsonFile- Path to the file- Returns:
- true if valid
-