@@ -119,24 +119,21 @@ public boolean ontPropertyExists(String ontUri) {
119
119
120
120
/**
121
121
* Get the label and doc strings for a workflow resource
122
- * @param path The path within the Git repository to the workflow
123
122
* @param workflowURI The URI of the workflow
124
123
* @return Result set with label and doc strings
125
124
*/
126
- public ResultSet getLabelAndDoc (String path , String workflowURI ) {
125
+ public ResultSet getLabelAndDoc (String workflowURI ) {
127
126
ParameterizedSparqlString labelQuery = new ParameterizedSparqlString ();
128
127
labelQuery .setCommandText (queryCtx +
129
128
"SELECT ?label ?doc\n " +
130
129
"WHERE {\n " +
131
- " GRAPH ?graphName {" +
130
+ " GRAPH ?wf {" +
132
131
" ?wf rdf:type ?type .\n " +
133
132
" OPTIONAL { ?wf sld:label|rdfs:label ?label }\n " +
134
133
" OPTIONAL { ?wf sld:doc|rdfs:comment ?doc }\n " +
135
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
136
134
" }" +
137
135
"}" );
138
- labelQuery .setLiteral ("wfFilter" , path + "$" );
139
- labelQuery .setIri ("graphName" , workflowURI );
136
+ labelQuery .setIri ("wf" , workflowURI );
140
137
return runQuery (labelQuery );
141
138
}
142
139
@@ -166,16 +163,15 @@ public String getOntLabel(String ontologyURI) {
166
163
167
164
/**
168
165
* Get the inputs for the workflow in the model
169
- * @param path The path within the Git repository to the workflow
170
166
* @param workflowURI URI of the workflow
171
167
* @return The result set of inputs
172
168
*/
173
- public ResultSet getInputs (String path , String workflowURI ) {
169
+ public ResultSet getInputs (String workflowURI ) {
174
170
ParameterizedSparqlString inputsQuery = new ParameterizedSparqlString ();
175
171
inputsQuery .setCommandText (queryCtx +
176
172
"SELECT ?name ?type ?items ?null ?format ?label ?doc\n " +
177
173
"WHERE {\n " +
178
- " GRAPH ?graphName {" +
174
+ " GRAPH ?wf {" +
179
175
" ?wf rdf:type cwl:Workflow .\n " +
180
176
" ?wf cwl:inputs ?name .\n " +
181
177
" OPTIONAL {\n " +
@@ -196,26 +192,23 @@ public ResultSet getInputs(String path, String workflowURI) {
196
192
" OPTIONAL { ?name cwl:format ?format }\n " +
197
193
" OPTIONAL { ?name sld:label|rdfs:label ?label }\n " +
198
194
" OPTIONAL { ?name sld:doc|rdfs:comment ?doc }" +
199
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
200
195
" }" +
201
196
"}" );
202
- inputsQuery .setLiteral ("wfFilter" , path + "$" );
203
- inputsQuery .setIri ("graphName" , workflowURI );
197
+ inputsQuery .setIri ("wf" , workflowURI );
204
198
return runQuery (inputsQuery );
205
199
}
206
200
207
201
/**
208
202
* Get the outputs for the workflow in the model
209
- * @param path The path within the Git repository to the workflow
210
203
* @param workflowURI URI of the workflow
211
204
* @return The result set of outputs
212
205
*/
213
- public ResultSet getOutputs (String path , String workflowURI ) {
206
+ public ResultSet getOutputs (String workflowURI ) {
214
207
ParameterizedSparqlString outputsQuery = new ParameterizedSparqlString ();
215
208
outputsQuery .setCommandText (queryCtx +
216
209
"SELECT ?name ?type ?items ?null ?format ?label ?doc\n " +
217
210
"WHERE {\n " +
218
- " GRAPH ?graphName {" +
211
+ " GRAPH ?wf {" +
219
212
" ?wf rdf:type cwl:Workflow .\n " +
220
213
" ?wf cwl:outputs ?name .\n " +
221
214
" OPTIONAL {\n " +
@@ -236,26 +229,23 @@ public ResultSet getOutputs(String path, String workflowURI) {
236
229
" OPTIONAL { ?name cwl:format ?format }\n " +
237
230
" OPTIONAL { ?name sld:label|rdfs:label ?label }\n " +
238
231
" OPTIONAL { ?name sld:doc|rdfs:comment ?doc }" +
239
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
240
232
" }" +
241
233
"}" );
242
- outputsQuery .setLiteral ("wfFilter" , path + "$" );
243
- outputsQuery .setIri ("graphName" , workflowURI );
234
+ outputsQuery .setIri ("wf" , workflowURI );
244
235
return runQuery (outputsQuery );
245
236
}
246
237
247
238
/**
248
239
* Get the steps for the workflow in the model
249
- * @param path The path within the Git repository to the workflow
250
240
* @param workflowURI URI of the workflow
251
241
* @return The result set of steps
252
242
*/
253
- public ResultSet getSteps (String path , String workflowURI ) {
243
+ public ResultSet getSteps (String workflowURI ) {
254
244
ParameterizedSparqlString stepQuery = new ParameterizedSparqlString ();
255
245
stepQuery .setCommandText (queryCtx +
256
- "SELECT ?wf ? step ?run ?runtype ?label ?doc ?stepinput ?default ?src\n " +
246
+ "SELECT ?step ?run ?runtype ?label ?doc ?stepinput ?default ?src\n " +
257
247
"WHERE {\n " +
258
- " GRAPH ?graphName {" +
248
+ " GRAPH ?wf {" +
259
249
" ?wf Workflow:steps ?step .\n " +
260
250
" ?step cwl:run ?run .\n " +
261
251
" ?run rdf:type ?runtype .\n " +
@@ -265,11 +255,9 @@ public ResultSet getSteps(String path, String workflowURI) {
265
255
" }\n " +
266
256
" OPTIONAL { ?run sld:label|rdfs:label ?label }\n " +
267
257
" OPTIONAL { ?run sld:doc|rdfs:comment ?doc }\n " +
268
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
269
258
" }" +
270
259
"}" );
271
- stepQuery .setLiteral ("wfFilter" , path + "$" );
272
- stepQuery .setIri ("graphName" , workflowURI );
260
+ stepQuery .setIri ("wf" , workflowURI );
273
261
return runQuery (stepQuery );
274
262
}
275
263
@@ -278,20 +266,18 @@ public ResultSet getSteps(String path, String workflowURI) {
278
266
* @param workflowURI URI of the workflow
279
267
* @return The result set of step links
280
268
*/
281
- public ResultSet getStepLinks (String path , String workflowURI ) {
269
+ public ResultSet getStepLinks (String workflowURI ) {
282
270
ParameterizedSparqlString linkQuery = new ParameterizedSparqlString ();
283
271
linkQuery .setCommandText (queryCtx +
284
- "SELECT ?wf ? src ?dest ?default\n " +
272
+ "SELECT ?src ?dest ?default\n " +
285
273
"WHERE {\n " +
286
- " GRAPH ?graphName {" +
274
+ " GRAPH ?wf {" +
287
275
" ?wf Workflow:steps ?step .\n " +
288
276
" ?step cwl:in ?dest .\n " +
289
277
" { ?dest cwl:source ?src } UNION { ?dest cwl:default ?default }\n " +
290
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
291
278
" }" +
292
279
"}" );
293
- linkQuery .setLiteral ("wfFilter" , path + "$" );
294
- linkQuery .setIri ("graphName" , workflowURI );
280
+ linkQuery .setIri ("wf" , workflowURI );
295
281
return runQuery (linkQuery );
296
282
}
297
283
@@ -300,44 +286,39 @@ public ResultSet getStepLinks(String path, String workflowURI) {
300
286
* @param workflowURI URI of the workflow
301
287
* @return The result set of steps
302
288
*/
303
- public ResultSet getOutputLinks (String path , String workflowURI ) {
289
+ public ResultSet getOutputLinks (String workflowURI ) {
304
290
ParameterizedSparqlString linkQuery = new ParameterizedSparqlString ();
305
291
linkQuery .setCommandText (queryCtx +
306
292
"SELECT ?src ?dest\n " +
307
293
"WHERE {\n " +
308
- " GRAPH ?graphName {" +
294
+ " GRAPH ?wf {" +
309
295
" ?wf rdf:type cwl:Workflow .\n " +
310
296
" ?wf cwl:outputs ?dest .\n " +
311
297
" ?dest cwl:outputSource ?src\n " +
312
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
313
298
" }" +
314
299
"}" );
315
- linkQuery .setLiteral ("wfFilter" , path + "$" );
316
- linkQuery .setIri ("graphName" , workflowURI );
300
+ linkQuery .setIri ("wf" , workflowURI );
317
301
return runQuery (linkQuery );
318
302
}
319
303
320
304
/**
321
305
* Gets the docker requirement and pull link for a workflow
322
- * @param path The path within the Git repository to the workflow
323
306
* @param workflowURI URI of the workflow
324
307
* @return Result set of docker hint and pull link
325
308
*/
326
- public ResultSet getDockerLink (String path , String workflowURI ) {
309
+ public ResultSet getDockerLink (String workflowURI ) {
327
310
ParameterizedSparqlString dockerQuery = new ParameterizedSparqlString ();
328
311
dockerQuery .setCommandText (queryCtx +
329
312
"SELECT ?docker ?pull\n " +
330
313
"WHERE {\n " +
331
- " GRAPH ?graphName {" +
314
+ " GRAPH ?wf {" +
332
315
" ?wf rdf:type cwl:Workflow .\n " +
333
316
" { ?wf cwl:requirements ?docker } UNION { ?wf cwl:hints ?docker} .\n " +
334
317
" ?docker rdf:type cwl:DockerRequirement\n " +
335
318
" OPTIONAL { ?docker DockerRequirement:dockerPull ?pull }\n " +
336
- " FILTER(regex(str(?wf), ?wfFilter, \" i\" ))" +
337
319
" }" +
338
320
"}" );
339
- dockerQuery .setLiteral ("wfFilter" , path + "$" );
340
- dockerQuery .setIri ("graphName" , workflowURI );
321
+ dockerQuery .setIri ("wf" , workflowURI );
341
322
return runQuery (dockerQuery );
342
323
}
343
324
0 commit comments