Package com.hp.hpl.jena.reasoner

Examples of com.hp.hpl.jena.reasoner.ValidityReport


           
        // read the file
        model.read( ont );
       
        // print validation report
        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );
       
        // print superclasses
        Resource c = model.getResource( ns + "MaleStudentWith3Daughters" );        
        printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName());
       
View Full Code Here


           
        // read the file
        model.read( ont );
       
        // print validation report
        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );
       
        // print superclasses using the utility function
        OntClass c = model.getOntClass( ns + "MaleStudentWith3Daughters" );        
        printIterator(c.listSuperClasses(), "All super classes of " + c.getLocalName());
        // OntClass provides function to print *only* the direct subclasses
View Full Code Here

           
        // read the file
        model.read( ont );
       
        // print validation report
        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );
       
        // print superclasses
        Resource c = model.getResource( ns + "MaleStudentWith3Daughters" );        
        printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName());
       
View Full Code Here

           
        // read the file
        model.read( ont );
       
        // print validation report
        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );
       
        // print superclasses using the utility function
        OntClass c = model.getOntClass( ns + "MaleStudentWith3Daughters" );        
        printIterator(c.listSuperClasses(), "All super classes of " + c.getLocalName());
        // OntClass provides function to print *only* the direct subclasses
View Full Code Here

    // 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();
  }
View Full Code Here

        return im.validate();
    }

    @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;
View Full Code Here

        Model schema = FileManager.get().loadModel("file:testing/reasoners/bugs/sbug.owl");
        Model data = FileManager.get().loadModel("file:testing/reasoners/bugs/sbug.rdf");

        // Union version
        InfModel infu = ModelFactory.createInfModel(reasoner, data.union(schema));
        ValidityReport validity = infu.validate();
        assertTrue( ! validity.isValid());
        // debug print
//        for (Iterator i = validity.getReports(); i.hasNext(); ) {
//            System.out.println(" - " + i.next());
//        }

        // bindSchema version
        InfModel inf = ModelFactory.createInfModel(reasoner.bindSchema(schema), data);
        validity = inf.validate();
        assertTrue( ! validity.isValid());
    }
View Full Code Here

    }

    private RDFNode doTestLiteralsInErrorReports(String rules) {
        GenericRuleReasoner reasoner = new GenericRuleReasoner( Rule.parseRules(rules) );
        InfModel im = ModelFactory.createInfModel(reasoner, ModelFactory.createDefaultModel());
        ValidityReport validity = im.validate();
        assertTrue (! validity.isValid());
        ValidityReport.Report report = (validity.getReports().next());
        assertTrue( report.getExtension() instanceof RDFNode);
        return (RDFNode)report.getExtension();
    }
View Full Code Here

        Model ont = FileManager.get().loadModel("testing/reasoners/bugs/layeredValidation.owl");
        InfModel infModel =
            ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), ont);
        OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RULE_INF,
            infModel);
        ValidityReport validity = model.validate();
        assertTrue(validity.isClean());
    }
View Full Code Here

     * @param rf
     *            The factory for the reasoner to test
     */
    @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;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.reasoner.ValidityReport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.