Package com.hp.hpl.jena.ontology

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


    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

    model.read( base + "ClosedUniverse.owl" );

    model.prepare();

    // OntClass Sat = model.getOntClass( ns + "Sat" );
    OntClass Unsat = model.getOntClass( ns + "Unsat" );

    // assertTrue( !Sat.hasSuperClass( OWL.Nothing ) );
View Full Code Here


  public void deprecatedSelfRestrictionSyntax() {
    String ns = "http://www.example.org/test#";

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "/deprecatedSelf.owl" );
    model.prepare();
    assertTrue( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    Property knows = model.getProperty( ns + "knows" );
    Individual p1 = model.getIndividual( ns + "P1" );
    Individual p2 = model.getIndividual( ns + "P2" );
View Full Code Here

  public void entityDeclarations() {
    String ns = "http://www.example.org/test#";

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "/entityDeclarations.owl" );
    model.prepare();

    KnowledgeBase kb = ((PelletInfGraph) model.getGraph()).getKB();
    assertTrue( kb.isConsistent() );

    assertTrue( kb.isIndividual( ATermUtils.makeTermAppl( ns + "a" ) ) );
View Full Code Here

    int n = solution.length();

    Individual T = model.getIndividual( ns + "T" );
    Individual F = model.getIndividual( ns + "F" );

    model.prepare();

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

    Individual[] positives = new Individual[n + 1];
    Individual[] negatives = new Individual[n + 1];
View Full Code Here

  @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

    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );
    x.addProperty( prop, "literal" );

    model.prepare();

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

  @Test
View Full Code Here

    Individual daughter = model.getIndividual( ns + "daughter" );
    Individual personX = model.getIndividual( ns + "personX" );
    Individual personY = model.getIndividual( ns + "personY" );
    Individual personZ = model.getIndividual( ns + "personZ" );

    model.prepare();

    KnowledgeBase kb = ((PelletInfGraph) model.getGraph()).getKB();

    for( int test = 0; test < 2; test++ ) {
      if( test != 0 ) {
View Full Code Here

    Individual Cain = model.getIndividual( ns + "Cain" );
    Individual Oedipus = model.getIndividual( ns + "Oedipus" );
    Individual Remus = model.getIndividual( ns + "Remus" );
    Individual Romulus = model.getIndividual( ns + "Romulus" );

    model.prepare();

    KnowledgeBase kb = ((PelletInfGraph) model.getGraph()).getKB();

    for( int test = 0; test < 1; test++ ) {
      if( test != 0 ) {
View Full Code Here

    Individual Alice = model.getIndividual( ns + "Alice" );
    Individual Bob = model.getIndividual( ns + "Bob" );
    Individual Charlie = model.getIndividual( ns + "Charlie" );

    model.prepare();

    KnowledgeBase kb = ((PelletInfGraph) model.getGraph()).getKB();

    for( int test = 0; test < 1; test++ ) {
      if( test != 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.