/** * Add a new error report * @param error true if the report is an error, false if it is just a warning * @param type a string giving a reasoner-dependent classification for the report * @param description a textual description of the problem */ public void add(boolean error, String type, String description) { add(error, type, description, null); }
/** * Add a new error report * @param error true if the report is an error, false if it is just a warning * @param type a string giving a reasoner-dependent classification for the report * @param description a textual description of the problem */ public void add(boolean error, String type, String description) { add(error, type, description, null); }
/** * Run a datatype range check on all literal values of all properties with a range declaration. * @param report */ protected void performDatatypeRangeValidation(StandardValidityReport report) { HashMap<Node, List<RDFDatatype>> dtRange = getDTRange(); for ( Node prop : dtRange.keySet() ) { for ( Iterator<Triple> i = find( null, prop, null ); i.hasNext(); ) { Triple triple = i.next(); report.add( checkLiteral( prop, triple ) ); } } }
/** * Run a datatype range check on all literal values of all properties with a range declaration. * @param report */ protected void performDatatypeRangeValidation(StandardValidityReport report) { HashMap<Node, List<RDFDatatype>> dtRange = getDTRange(); for ( Node prop : dtRange.keySet() ) { for ( Iterator<Triple> i = find( null, prop, null ); i.hasNext(); ) { Triple triple = i.next(); report.add( checkLiteral( prop, triple ) ); } } }
/** * Check validity report implementation, there had been a stupid bug here. */ public void testValidityReport() { StandardValidityReport report = new StandardValidityReport(); report.add(false, "dummy", "dummy1"); report.add(false, "dummy", "dummy3"); assertTrue(report.isValid()); report.add(true, "dummy", "dummy2"); assertTrue( ! report.isValid()); report = new StandardValidityReport(); report.add(false, "dummy", "dummy1"); report.add(true, "dummy", "dummy2"); report.add(false, "dummy", "dummy3"); assertTrue( ! report.isValid()); report = new StandardValidityReport(); report.add(new ValidityReport.Report(false, "dummy", "dummy1")); report.add(new ValidityReport.Report(true, "dummy", "dummy2")); report.add(new ValidityReport.Report(false, "dummy", "dummy3")); assertTrue( ! report.isValid()); }
/** * Check validity report implementation, there had been a stupid bug here. */ public void testValidityReport() { StandardValidityReport report = new StandardValidityReport(); report.add(false, "dummy", "dummy1"); report.add(false, "dummy", "dummy3"); assertTrue(report.isValid()); report.add(true, "dummy", "dummy2"); assertTrue( ! report.isValid()); report = new StandardValidityReport(); report.add(false, "dummy", "dummy1"); report.add(true, "dummy", "dummy2"); report.add(false, "dummy", "dummy3"); assertTrue( ! report.isValid()); report = new StandardValidityReport(); report.add(new ValidityReport.Report(false, "dummy", "dummy1")); report.add(new ValidityReport.Report(true, "dummy", "dummy2")); report.add(new ValidityReport.Report(false, "dummy", "dummy3")); assertTrue( ! report.isValid()); }
/** * <p> * Test the consistency of the model. This looks for overall inconsistency, and for any unsatisfiable classes. * </p> * * @return a ValidityReport structure */ @Override public ValidityReport validate() { checkOpen(); prepare(); final StandardValidityReport report = new StandardValidityReport(); _kb.setDoExplanation(true); final boolean consistent = _kb.isConsistent(); _kb.setDoExplanation(false); if (!consistent) report.add(true, "KB is inconsistent!", _kb.getExplanation()); else for (final ATermAppl c : _kb.getUnsatisfiableClasses()) { final String name = JenaUtils.makeGraphNode(c).toString(); report.add(false, "Unsatisfiable class", name); } return report; }
/** * <p> * Test the consistency of the model. This looks for overall inconsistency, and for any unsatisfiable classes. * </p> * * @return a ValidityReport structure */ @Override public ValidityReport validate() { checkOpen(); prepare(); final StandardValidityReport report = new StandardValidityReport(); _kb.setDoExplanation(true); final boolean consistent = _kb.isConsistent(); _kb.setDoExplanation(false); if (!consistent) report.add(true, "KB is inconsistent!", _kb.getExplanation()); else for (final ATermAppl c : _kb.getUnsatisfiableClasses()) { final String name = JenaUtils.makeGraphNode(c).toString(); report.add(false, "Unsatisfiable class", name); } return report; }
/** * <p> * Test the consistency of the model. This looks for overall inconsistency, and for any unsatisfiable classes. * </p> * * @return a ValidityReport structure */ @Override public ValidityReport validate() { checkOpen(); prepare(); final StandardValidityReport report = new StandardValidityReport(); _kb.setDoExplanation(true); final boolean consistent = _kb.isConsistent(); _kb.setDoExplanation(false); if (!consistent) report.add(true, "KB is inconsistent!", _kb.getExplanation()); else for (final ATermAppl c : _kb.getUnsatisfiableClasses()) { final String name = JenaUtils.makeGraphNode(c).toString(); report.add(false, "Unsatisfiable class", name); } return report; }
report.add(nature.equalsIgnoreCase("error"), type, description.toString(), culprit);
report.add(nature.equalsIgnoreCase("error"), type, description.toString(), culprit);