Skip to content

Feat workflow alternative generation#102

Draft
eladrion wants to merge 21 commits into
mainfrom
feat_workflow_alternative_generation
Draft

Feat workflow alternative generation#102
eladrion wants to merge 21 commits into
mainfrom
feat_workflow_alternative_generation

Conversation

@eladrion

@eladrion eladrion commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Pull Request Overview

This PR (by Aaron Strachardt) adds the backend logic for the "generate alternatives" prototype component. It basically introduces a new /alternatives/parse endpoint, a CWLParser class, and some helper logic to process the workflows.

Related Issue

No related issue yet.

Changes Introduced

  • Added snakeyaml dependency for lightweight CWL parsing.
  • Added CWLParser class to extract tools and connections from the CWL file.
  • Created new endpoint POST /alternatives/parse for the file uploads.
  • Added logic for lazy-loading and inverting the edam_labels.json to map URIs to readable labels.
  • Added basic error handling for the new endpoint (returning proper 400/500 status codes).
  • Introduced unit and integration tests for all new features.

How Has This Been Tested?

The code has been tested with the added unit tests (e.g., CwlParserTest, EdamLabelsTest). I also tested the whole flow manually on my local machine by connecting it to the corresponding frontend branch.

Checklist

  • I have referenced a related issue.
  • I have followed the project’s style guidelines.
  • My changes include tests, if applicable.
  • All tests pass locally.
  • I have added myself to the CITATION.cff file, if not already present.

aaronstrachardt and others added 21 commits June 29, 2026 16:00
Lombok annotation processing failed on JDK 21+ causing compilation
errors. Replaced @Getter, @Setter, @DaTa, @slf4j, @NoArgsConstructor,
@AllArgsConstructor, and @requiredargsconstructor with explicit
constructors, getters, setters, and SLF4J logger declarations.

# Conflicts:
#	src/main/java/nl/esciencecenter/controller/dto/WorkflowsZip.java
Adds GraphNode, GraphEdge, ApeTaxTuple, and ParseResponse DTOs used
by the /alternatives/parse endpoint. All fields have explicit getters
for Jackson serialization.
Loads the EDAM OWL ontology asynchronously at startup and builds an
inverted URI-to-label map for O(1) lookup. Falls back to the short-form
URI fragment while loading. Used to resolve format URIs in CWL
inputs/outputs to human-readable EDAM class names.
Parses a CWL v1.2 Workflow document using snakeyaml and produces a
graph-optimised ParseResponse: tool nodes, input/output data nodes,
directed data-flow edges, and EDAM I/O tuples for APE synthesis
constraints. EDAM format URIs are resolved via an injected label
resolver function.
Accepts a CWL v1.2 workflow as multipart/form-data, delegates to
CwlParser with EDAM label resolution, and returns a ParseResponse
with nodes, edges, and I/O EDAM tuples for the frontend graph view.
Reverts a051be8. Lombok 1.18.30 works correctly with Java 17; the
annotation-processing issues only affect JDK 21+. Project is now
pinned to java.version=17 via spring-boot-starter-parent.
Remove EDAMTaxonomyService (OWL API, async loading, AtomicReference fallback).
Bundle pre-built edam_labels.json (3471 entries, 227 KB) as classpath resource.
EdamLabels loads it synchronously at startup via Jackson — no network access,
no startup delay, no fallback labels.
Replace bundled edam_labels.json with live OWL fetch via EdamLabels.
ensureLoaded() blocks synchronously on first call (double-checked lock),
subsequent calls return immediately. Add GET /alternatives/warm so the
frontend can trigger loading on page mount before the first upload.
EDAM loading is triggered implicitly by the first /parse call.
A dedicated warm endpoint adds no value without a frontend consumer.
EdamLabels now reads the pre-generated edam_labels.json classpath resource
instead of fetching and indexing the EDAM OWL ontology at runtime. This makes
label resolution O(1), removes the runtime network dependency, and matches the
documented design. The required resource was previously untracked.
…e.java and ParseResponse.java and replace GraphNode's string type with a enum, as suggested in review.
Merge contribution to generate alternative workflows by @aaronstrachardt
chore: add Aaron Strachardt to authors in citation.cff
@eladrion eladrion marked this pull request as draft July 3, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants