Community
Participate
Working Groups
Validate the model after reading (GET) and before creating/updating (PUT/POST). For example: protected void validateModel(Model model) throws Exception { InfModel infmodel = ModelFactory.createRDFSModel(model); ValidityReport validityReport = infmodel.validate(); if (!validityReport.isClean()) { StringBuffer errorMessage = new StringBuffer(); errorMessage.append("Invalid model:"); //$NON-NLS-1$ Iterator<ValidityReport.Report> reports = validityReport.getReports(); while(reports.hasNext()){ errorMessage.append('\n'); errorMessage.append(reports.next().toString()); } Assert.fail(errorMessage.toString()); } }
Resolved by the following commit: http://git.eclipse.org/c/lyo/org.eclipse.lyo.testsuite.git/commit/?id=7bd2bda5d1fd74d33f7327763d9031f811054b41
Thanks Mike. Closing.