Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntModel.validate()


    model.prepare();
    long e = System.currentTimeMillis();
   
    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );

    // perform ABox addition which results in a consistent KB
    Resource concept = model.getResource( mindswap + "GraduateStudent" );
    Individual individual = model.createIndividual( mindswappers + "JohnDoe", concept );
View Full Code Here


    model.prepare();
    e = System.currentTimeMillis();

    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );

    // perform ABox addition which results in an inconsistent KB
    Property role = model.getProperty( foaf + "mbox" );
    individual = model.getIndividual( mindswappers + "Christian.Halaschek" );
    RDFNode mbox = model.getIndividual( "mailto:kolovski@cs.umd.edu" );
View Full Code Here

    model.prepare();
    e = System.currentTimeMillis();

    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );
  }

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

       
        ont.createResource(NS + "a").addProperty(hasValue, "15", over12Type);
        ont.createResource(NS + "b").addProperty(hasValue, "16", XSDDatatype.XSDinteger);
        ont.createResource(NS + "c").addProperty(hasValue, "10", XSDDatatype.XSDinteger);
       
        ValidityReport validity = ont.validate();
        assertTrue (! validity.isValid());
       
        // Check culprit reporting
        ValidityReport.Report report = (validity.getReports().next());
        Triple culprit = (Triple)report.getExtension();
View Full Code Here

       
        ont.createResource(NS + "a").addProperty(hasValue, "15", over12Type);
        ont.createResource(NS + "b").addProperty(hasValue, "16", XSDDatatype.XSDinteger);
        ont.createResource(NS + "c").addProperty(hasValue, "10", XSDDatatype.XSDinteger);
       
        ValidityReport validity = ont.validate();
        assertTrue (! validity.isValid());
       
        // Check culprit reporting
        ValidityReport.Report report = (validity.getReports().next());
        Triple culprit = (Triple)report.getExtension();
View Full Code Here

    DatatypeProperty name1 = model.createDatatypeProperty( ns + "name1", true );

    john.addProperty( name1, "Name", "en" );
    john.addProperty( name1, "Nom", "fr" );

    assertTrue( model.validate().isValid() );

    DatatypeProperty name2 = model.createDatatypeProperty( ns + "name2", true );

    john.addProperty( name2, "Name" );
    john.addProperty( name2, "Nom" );
View Full Code Here

    DatatypeProperty name2 = model.createDatatypeProperty( ns + "name2", true );

    john.addProperty( name2, "Name" );
    john.addProperty( name2, "Nom" );

    assertTrue( !model.validate().isValid() );
  }

  @Test
  public void testDatatypeHierarchy() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
View Full Code Here

    Individual x = model.createIndividual( ns + "x", C );
    x.addProperty( prop, "literal1" );
    x.addProperty( prop, "literal2" );
    x.addProperty( prop, "literal3" );

    assertTrue( !model.validate().isValid() );
  }

  @Test
  public void testSubDataPropCard() {
    String ns = "urn:test:";
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.