Search in sources :

Example 1 with ValidityReport

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();
}
Also used : ValidityReport(com.hp.hpl.jena.reasoner.ValidityReport) InfModel(com.hp.hpl.jena.rdf.model.InfModel) Model(com.hp.hpl.jena.rdf.model.Model) InfModel(com.hp.hpl.jena.rdf.model.InfModel) Test(org.junit.Test)

Aggregations

InfModel (com.hp.hpl.jena.rdf.model.InfModel)1 Model (com.hp.hpl.jena.rdf.model.Model)1 ValidityReport (com.hp.hpl.jena.reasoner.ValidityReport)1 Test (org.junit.Test)1