public String getToolkitThatGeneratesView() { String toolkitURI = null; if (viewURI != null) { for (String serviceURI : this) { if (ts.isImplemenationOfServiceAMapper(serviceURI)) toolkitURI = ResultSetToVector.getVectorFromResultSet(ts.getToolkitOf(serviceURI), "toolkit") .firstElement(); } } return toolkitURI; }
public boolean requiresInputURL() { String firstServiceURI = get(0); Vector<String> params = ResultSetToVector.getVectorFromResultSet( ts.getInputParameters(firstServiceURI), "parameter"); for (String parameterURI : params) { if (parameterURI.contains("url") || parameterURI.contains("URL") || parameterURI.contains("fileLoc")) return true; } return false; }
private boolean hasAllInputParameters(String serviceURI) { String boundedValue; boolean allParamsBounded = true; Vector<String> params = ResultSetToVector.getVectorFromResultSet(ts.getInputParameters(serviceURI), "parameter"); for (String parameterURI : params) { boundedValue = getParameterBindings().get(parameterURI); if (!parameterURI.contains("url") && !parameterURI.contains("URL") && !parameterURI.contains("fileLoc")) { allParameters.add(parameterURI); if (boundedValue == null) { unboundParameters.add(parameterURI); allParamsBounded = false; } } } return allParamsBounded; }
private void setViewerSets(String viewerURI) { viewerSets = ResultSetToVector.getVectorFromResultSet(ts.getViewerSetsOfViewer(viewerURI), "viewerSet"); }
private void setNodesAndLinks(Pipeline pipe, ViskoTripleStore ts) throws JSONException { nodesList = new ArrayList<JSONObject>(); linksList = new ArrayList<JSONObject>(); int nodeCount = 0; int parameterCount = 0; for (String viskoServiceURI : pipe) { // add pipeline operators to list of nodes Vector<String> implOf = ResultSetToVector.getVectorFromResultSet( ts.getImplemenationOf(viskoServiceURI), "operator"); if (implOf != null && ts.isMapper(implOf.firstElement())) nodesList.add( new JSONObject().put("instanceURI", viskoServiceURI).put("viskoType", "Mapper")); else nodesList.add( new JSONObject().put("instanceURI", viskoServiceURI).put("viskoType", "Transformer")); nodeCount++; if (nodeCount > 1) { linksList.add( new JSONObject() .put("source", nodeCount - parameterCount - 2) .put("target", nodeCount - 1) .put("linkType", "nextService")); } Vector<String> params = ResultSetToVector.getVectorFromResultSet( ts.getInputParameters(viskoServiceURI), "parameter"); String boundValue; parameterCount = 0; for (String paramURI : params) { boundValue = pipe.getParameterBindings().get(paramURI); if (!paramURI.contains("url") && !paramURI.contains("URL") && !paramURI.contains("fileLoc")) { if (boundValue != null) { nodesList.add( new JSONObject() .put("instanceURI", paramURI) .put("viskoType", "Parameter") .put("value", boundValue)); } else nodesList.add( new JSONObject() .put("instanceURI", paramURI) .put("viskoType", "Parameter") .put("value", "null")); parameterCount++; linksList.add( new JSONObject() .put("source", nodeCount + parameterCount - 1) .put("target", nodeCount - 1) .put("linkType", "hasInput")); } } nodeCount += parameterCount; } nodesList.add( new JSONObject().put("instanceURI", pipe.getViewerURI()).put("viskoType", "Viewer")); nodeCount++; linksList.add( new JSONObject() .put("target", nodeCount - 1) .put("source", nodeCount - parameterCount - 2) .put("linkType", "nextService")); }