Skip to content

Commit 0608f46

Browse files
committed
use file:/// URIs in rdf search-replace
1 parent 0b1fdad commit 0608f46

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/org/commonwl/view/cwl/CWLService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ public Workflow parseWorkflowWithCwltool(Workflow basicModel,
250250

251251
// Get paths to workflow
252252
String url = basicModel.getIdentifier();
253-
String workflowFileURI = workflowFile.toUri().toString();
253+
String workflowFileURI = workflowFile.toAbsolutePath().toUri().toString();
254+
String workTreeUri = workTree.toAbsolutePath().toUri().toString();
254255
String localPath = workflowFileURI;
255256
String gitPath = gitDetails.getPath();
256257
if (packedWorkflowID != null) {
@@ -265,8 +266,10 @@ public Workflow parseWorkflowWithCwltool(Workflow basicModel,
265266
// Get RDF representation from cwltool
266267
if (!rdfService.graphExists(url)) {
267268
String rdf = cwlTool.getRDF(localPath);
268-
rdf = rdf.replace(workflowFileURI,
269-
"https://w3id.org/cwl/view/git/" + latestCommit);
269+
// Replace /tmp/123123 with permalink base
270+
// NOTE: We do not just replace workflowFileURI, all referenced files will also get rewritten
271+
rdf = rdf.replace(workTreeUri,
272+
"https://w3id.org/cwl/view/git/" + latestCommit + "/");
270273
// Workaround for common-workflow-language/cwltool#427
271274
rdf = rdf.replace("<rdfs:>", "<http://www.w3.org/2000/01/rdf-schema#>");
272275

0 commit comments

Comments
 (0)