use of org.apache.jena.reasoner.ValidityReport.Report in project jena by apache.
the class OWLConsistencyTest method runTest.
@Override
public void runTest() {
ValidityReport report = testResults();
switch(expected) {
case INCONSISTENT:
assertTrue("expected inconsistent", !report.isValid());
break;
case WARNINGS:
assertTrue("expected just warnings but reports not valid", report.isValid());
assertFalse("expected warnings but reports clean", report.isClean());
break;
case CLEAN:
assertTrue("expected clean", report.isClean());
}
if (culprit != null) {
boolean foundit = false;
for (Iterator<Report> i = report.getReports(); i.hasNext(); ) {
ValidityReport.Report r = i.next();
if (r.getExtension() != null && r.getExtension().equals(culprit)) {
foundit = true;
break;
}
}
if (!foundit) {
assertTrue("Expcted to find a culprint " + culprit, false);
}
}
}
use of org.apache.jena.reasoner.ValidityReport.Report in project jena by apache.
the class ManualExample method test2.
/** illustrate validation */
public void test2(String fname) {
System.out.println("Testing " + fname);
Model data = FileManager.get().loadModel(fname);
InfModel infmodel = ModelFactory.createRDFSModel(data);
ValidityReport validity = infmodel.validate();
if (validity.isValid()) {
System.out.println("OK");
} else {
System.out.println("Conflicts");
for (Iterator<Report> i = validity.getReports(); i.hasNext(); ) {
ValidityReport.Report report = i.next();
System.out.println(" - " + report);
// System.out.println(" - " + i.next());
}
}
}
Aggregations