Package com.hp.hpl.jena.ontology

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


    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 0 );

    ObjectProperty op = model.createObjectProperty( ns + "op" );
    i2.addProperty( op, i4 );

    model.prepare();

    // check that the kb is now inconsistent and that incremental
    // consistency was used
    assertTrue( ((PelletInfGraph) model.getGraph()).isConsistent() );
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 0 );
View Full Code Here


    assertTrue( ((PelletInfGraph) model.getGraph()).isConsistent() );
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 0 );

    i2.addRDFType( CONJ );

    model.prepare();

    // check that the kb is now inconsistent and that incremental
    // consistency was used
    assertTrue( ((PelletInfGraph) model.getGraph()).isConsistent() );
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 0 );
View Full Code Here

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );

    model.prepare();

    PelletInfGraph graph = (PelletInfGraph) model.getGraph();

    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ) == null );
    assertIteratorValues( a.listPropertyValues( dp ), new Literal[] { one } );
View Full Code Here

    assertIteratorValues( a.listPropertyValues( dp ), new Literal[] { one } );

    a.addProperty( op, b );

    // check consistency
    model.prepare();

    assertIteratorValues( a.listPropertyValues( op ), new Resource[] { b } );
    // check that the update occurred and that the incremental consistency
    // was used
    assertTrue( !PelletOptions.USE_INCREMENTAL_CONSISTENCY || graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 1 );
View Full Code Here

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );

    model.prepare();

    PelletInfGraph graph = (PelletInfGraph) model.getGraph();

    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ) == null );
    assertIteratorValues( a.listPropertyValues( dp ), new Literal[] { one } );
View Full Code Here

    assertIteratorValues( a.listPropertyValues( dp ), new Literal[] { one } );

    a.addProperty( op, anon1 );

    // check consistency
    model.prepare();

    assertIteratorValues( a.listPropertyValues( op ), new Resource[] { anon1 } );
    // check that the update occurred and that the incremental consistency
    // was used
    assertTrue( !PelletOptions.USE_INCREMENTAL_CONSISTENCY || graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() > 0 );
View Full Code Here

    Individual anon2 = model.createIndividual( C );
    anon2.addProperty( op, a );

    // check consistency
    model.prepare();

    assertIteratorValues( anon2.listPropertyValues( op ), new Resource[] { a } );
    // check that the update occurred and that the incremental consistency
    // was used
    assertTrue( !PelletOptions.USE_INCREMENTAL_CONSISTENCY || graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 2 );
View Full Code Here

    inds[2].addRDFType( class2 );
    inds[3].addRDFType( class2 );
    inds[4].addRDFType( class2 );
    inds[5].addRDFType( class2 );

    ontmodel.prepare();

    assertIteratorValues( class1.listInstances(), new Resource[] {
        inds[0], inds[1], inds[2], inds[3] } );

    assertIteratorValues( class2.listInstances(), new Resource[] {
View Full Code Here

      0 : graph.getKB().timers.getTimer( "isIncConsistent" ).getCount();
   
    inds[4].addRDFType( class1 );
    inds[5].addRDFType( class1 );

    ontmodel.prepare();

    assertIteratorValues( class1.listInstances(), new Resource[] {
        inds[0], inds[1], inds[2], inds[3], inds[4], inds[5] } );

    assertTrue( prevCount < graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() );
View Full Code Here

    UnionClass class4 = ontmodel.createUnionClass( null, list );

    graph.getKB().timers.getTimer( "isIncConsistent" ).reset();
   
    ontmodel.prepare();

    assertIteratorValues( class3.listInstances(), new Resource[] {
        inds[2], inds[3], inds[4], inds[5] } );

    assertIteratorValues( class4.listInstances(), new Resource[] {
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.