Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.InfModel.validate()


    try {
      Model m = ModelFactory.createDefaultModel();
      m.add(ont);
      m.read(new FileInputStream(rdf),currentBase);
      InfModel inf = ModelFactory.createInfModel(reasoner,m);
      assertTrue(inf.validate().isValid());
    }
    catch (Exception e) {
      fail(e.getMessage());     
    }
  }
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
        Resource c = model.getResource( ns + "MaleStudentWith3Daughters" );        
        printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName());
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());
View Full Code Here

        // Work around non-deterministic bug in bindSchema
        //        Reasoner r = rf.create(null).bindSchema(t);
        Reasoner r = rf.create(null);
        a.add(t);
        InfModel im = ModelFactory.createInfModel(r, a);
        return im.validate();
    }

    @Override
    public void runTest() {
        ValidityReport report = testResults();
View Full Code Here

        // Work around non-deterministic bug in bindSchema
        //        Reasoner r = rf.create(null).bindSchema(t);
        Reasoner r = rf.create(null);
        a.add(t);
        InfModel im = ModelFactory.createInfModel(r, a);
        return im.validate();
    }

    /**
     * Run the consistency check and validate the result against expectations.
     *
 
View Full Code Here

    public void testLiteralBug() {
        Model model = FileManager.get().loadModel("file:testing/reasoners/bugs/dtValidation.owl");
//        Model m = ModelFactory.createDefaultModel();
        Reasoner r = ReasonerRegistry.getOWLReasoner();
        InfModel infmodel = ModelFactory.createInfModel(r, model);
        ValidityReport validity = infmodel.validate();
        assertTrue (validity.isValid());
    }

    /**
     * Report of problems with cardinality v. maxCardinality usage in classification,
View Full Code Here

        Reasoner reasoner = ReasonerRegistry.getOWLReasoner().bindSchema(tbox.getGraph());
        Model abox = FileManager.get().loadModel("data/inference/abox.owl", null, "RDF/XML"); // http://en.wikipedia.org/wiki/Abox

        InfModel inf = ModelFactory.createInfModel(reasoner, abox);

        ValidityReport validityReport = inf.validate();

        if ( !validityReport.isValid() ) {
          System.out.println("Inconsistent");
            Iterator<Report> iter = validityReport.getReports();
            while ( iter.hasNext() ) {
View Full Code Here

        // Work around non-deterministic bug in bindSchema
        //        Reasoner r = rf.create(null).bindSchema(t);
        Reasoner r = rf.create(null);
        a.add(t);
        InfModel im = ModelFactory.createInfModel(r, a);
        return im.validate();
    }

    /**
     * Run the consistency check and validate the result against expectations.
     *
 
View Full Code Here

            schema.read(schemaURL);
            Reasoner reasoner = ReasonerRegistry.getRDFSSimpleReasoner().bindSchema(schema);
            InfModel inf = ModelFactory.createInfModel(reasoner, config);

            // If we do inferencing, we can easily check for consistency.
            ValidityReport reports = inf.validate();
            if (!reports.isValid())
            {
                StringBuilder sb = new StringBuilder();
                sb.append("The configuration of the MetadataConverterPlugin is ");
                sb.append("not valid regarding the schema (");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.