use of com.hp.hpl.jena.reasoner.ValidityReport in project stanbol by apache.
the class JenaOWLReasoningServiceTest method testDisjointness.
/**
* Tests the owl:disjointWith inferences
*/
@Test
public void testDisjointness() {
log.info("Testing owl:disjointWith inferences with OWL reasoner");
// We assure everything is clean
TestData.alexdma.removeProperties();
TestData.alexdma.addProperty(RDF.type, TestData.foaf_Organization);
TestData.alexdma.addProperty(RDF.type, TestData.foaf_Person);
// Setup input for the reasoner
Model input = ModelFactory.createUnion(TestData.foaf, TestData.alexdma.getModel());
// Can I be a foaf:Organization and a foaf:Person at the same time?
log.info("Instantiating the OWL reasoner");
// Run the reasoner
InfModel inferred = reasoningService.run(input);
// log.info("Statements: {}",
// TestUtils.printStatements(inferred, TestData.alexdma, RDF.type));
ValidityReport validity = inferred.validate();
log.info("Can I be a foaf:Organization and a foaf:Person at the same time...? {}", validity.isValid());
assertTrue(!validity.isValid());
// Clean shared resource
TestData.alexdma.removeProperties();
}
Aggregations