Feat workflow alternative generation#102
Draft
eladrion wants to merge 21 commits into
Draft
Conversation
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.
…le consistency
…rnativesControllerTest
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.
…a as suggested in the review
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This PR (by Aaron Strachardt) adds the backend logic for the "generate alternatives" prototype component. It basically introduces a new
/alternatives/parseendpoint, aCWLParserclass, and some helper logic to process the workflows.Related Issue
No related issue yet.
Changes Introduced
snakeyamldependency for lightweight CWL parsing.CWLParserclass to extract tools and connections from the CWL file.POST /alternatives/parsefor the file uploads.edam_labels.jsonto map URIs to readable labels.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