Package com.hp.hpl.jena.ontology

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


  @Test
  public void testTransitive2() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "cyclic_transitive.owl" );

    model.prepare();

    String ns = "http://www.example.org/test#";

    OntClass Probe = model.getOntClass( ns + "Probe" );
    Individual Instance1 = model.getIndividual( ns + "Instance1" );
View Full Code Here


    OntClass MyFavoriteColors = model.getOntClass( ns + "MyFavoriteColors" );

    OntClass HasFourPrimaryColors = model.getOntClass( ns + "HasFourPrimaryColors" );

    model.prepare();

    assertTrue( model.contains( red, RDF.type, MyFavoriteColors ) );

    assertTrue( model.contains( HasFourPrimaryColors, RDFS.subClassOf, OWL.Nothing ) );
View Full Code Here

    a.addProperty( p, b );

    d.addRDFType( model.createAllValuesFromRestriction( null, p, OWL.Nothing ) );

    model.prepare();

    assertIteratorValues( a.listDifferentFrom(), new Resource[] { c, d } );

    assertIteratorValues( model.listSubjectsWithProperty( OWL.differentFrom, a ),
        new Resource[] { c, d } );
View Full Code Here

    c.addSameAs( b );

    a.addProperty( q, c );

    model.prepare();

    assertIteratorValues( a.listPropertyValues( p ), new Resource[] { b, c } );

    assertIteratorValues( a.listPropertyValues( q ), new Resource[] { b, c } );
View Full Code Here

  public void testInfiniteChain() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.setStrictMode( false );
    model.read( base + "infiniteChain.owl" );

    model.prepare();

    assertFalse( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    String ns = "http://www.example.org/test#";
    Property prop = model.getBaseModel().getProperty( ns + "ssn" );
View Full Code Here

    OntProperty hasParent = model.getObjectProperty( ns + "hasParent" );
    OntProperty hasFather = model.getObjectProperty( ns + "hasFather" );
    OntProperty hasMother = model.getObjectProperty( ns + "hasMother" );
    OntProperty topObjProp = model.getObjectProperty( OWL2.topObjectProperty.getURI() );

    model.prepare();

    assertTrue( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasParent ), new Resource[] {
        Mom, Dad } );
View Full Code Here

    OntClass Team = model.getOntClass( ns + "Team" );
    OntClass MixedTeam = model.getOntClass( ns + "MixedTeam" );
    OntClass NonSingletonTeam = model.getOntClass( ns + "NonSingletonTeam" );
    OntClass SingletonTeam = model.getOntClass( ns + "SingletonTeam" );

    model.prepare();

    assertTrue( Sam.isDifferentFrom( Chris ) );
    assertTrue( Chris.isDifferentFrom( Sam ) );

    assertTrue( MixedTeam.hasSuperClass( Team ) );
View Full Code Here

  @Test
  public void testTransitive1() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "agencies.owl" );

    model.prepare();

    String ns = "http://www.owl-ontologies.com/unnamed.owl#";
    Individual Forest_Service = model.getIndividual( ns + "Forest_Service" );
    ObjectProperty comprises = model.getObjectProperty( ns + "comprises" );
    Individual Executive = model.getIndividual( ns + "Executive" );
View Full Code Here

    assertIteratorValues( model.listIndividuals(), new Resource[] { i1, i2, i3, i4 } );

    i4.addRDFType( model.createCardinalityRestriction( null, p, 1 ) );
    graph.getKB().timers.getTimer( "isIncConsistent" ).reset();

    model.prepare();

    // check that incremental consistency was not used
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 0 );

    i4.addRDFType( E );
View Full Code Here

    i4.removeRDFType( E );

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

    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

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.