OWLSValidator.java revision 2
7161N/A// Copyright (c) 2004 Evren Sirin 7161N/A// Permission is hereby granted, free of charge, to any person obtaining a copy 7161N/A// of this software and associated documentation files (the "Software"), to 7161N/A// deal in the Software without restriction, including without limitation the 7161N/A// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7161N/A// sell copies of the Software, and to permit persons to whom the Software is 7161N/A// furnished to do so, subject to the following conditions: 7161N/A// The above copyright notice and this permission notice shall be included in 7161N/A// all copies or substantial portions of the Software. 7161N/A// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 7161N/A// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 7161N/A// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * Created on Jan 23, 2004 * Validate OWL-S service descriptions to find errors such as flaws in the data flow specification, * grounding description and so on. Validator will catch common RDF errors and print them. // out.print(" (Version: ").print(service.getOWLSVersion()).print(")").println(); // FIXME return value for validation // return services.size() > 0 && errors.isEmpty(); // return str.replaceAll("\n", "<br>").replaceAll(" ", " "); // StringBuffer buffer = new StringBuffer(); // int start = 0, finish; // int index = str.indexOf("http://"); // buffer.append(str.substring(start, index)); // finish = Math.min(str.indexOf(' ', index), str.indexOf('\n', index)); // if(finish > str.indexOf('<', index)) finish = str.indexOf('\n', index); // if(finish == -1) finish = str.length(); // link = str.substring(index, finish); // buffer.append("<a href=\"").append(link).append("\">"); // buffer.append(link).append("</a>"); // start = index + link.length(); // index = str.indexOf("http://", start); // buffer.append(str.substring(start)); // return buffer.toString().replaceAll("\n", "<br>"); * @see org.mindswap.owls.io.OWLSReaderListener#startService(java.lang.String) * @see org.mindswap.owls.io.OWLSReaderListener#finishService(java.lang.String) * @see org.mindswap.owls.io.OWLSReaderListener#warning(java.lang.String) * @see org.mindswap.owls.io.OWLSReaderListener#error(java.lang.String) * @see org.mindswap.owls.io.OWLSReaderListener#startParseRDF() * @see org.mindswap.owls.io.OWLSReaderListener#finishParseRDF()