/** * Create a Profile for the composite service. We only set the input and output of the profile * based on the process. */ Profile createProfile(final Profile profile, final Process process) { for (Input input : process.getInputs()) { profile.addInput(input); } for (Output output : process.getOutputs()) { profile.addOutput(output); } return profile; }
public void runFrenchDictionary() throws Exception { OWLKnowledgeBase kb = OWLFactory.createKB(); // we need a reasoner that can evaluate the precondition of the translator kb.setReasoner("Pellet"); service = kb.readService("http://www.mindswap.org/2004/owl-s/1.1/FrenchDictionary.owl"); process = service.getProcess(); // initialize the input values to be empty values = new ValueMap(); inValue = "mere"; values.setDataValue(process.getInput("InputString"), inValue); values = exec.execute(process, values); // get the output using local name outValue = values.getValue(process.getOutputs().getParameter("OutputString")).toString(); // display the results System.out.println("Executed service " + service); System.out.println("Input = " + inValue); System.out.println("Output = " + outValue); System.out.println(); }