Package com.hp.hpl.jena.ontology

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


    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createMinCardinalityRestriction( null, f, 5 ) );
    C.addSuperClass( model.createMinCardinalityRestriction( null, d, 5 ) );

    model.prepare();

    assertFalse( C.hasSuperClass( OWL.Nothing ) );
  }

  @Test
View Full Code Here


        // load the ontology with its imports and no reasoning
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( ont );

    // load the model to the reasoner
    model.prepare();
   
    // create property and resources to query the reasoner
    OntClass Person = model.getOntClass("http://xmlns.com/foaf/0.1/Person");
    Property workHomepage = model.getProperty("http://xmlns.com/foaf/0.1/workInfoHomepage");
    Property foafName = model.getProperty("http://xmlns.com/foaf/0.1/name");
View Full Code Here

    String ns = "http://www.lancs.ac.uk/ug/dobsong/owl/float_test.owl#";

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

    model.prepare();

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

    OntClass ThingWithFloatValue = model.getOntClass( ns + "ThingWithFloatValue" );
    OntClass ThingWithFloatProbability = model.getOntClass( ns + "ThingWithProbabilityValue" );
View Full Code Here

    String ns = "http://www.lancs.ac.uk/ug/dobsong/owl/decimal_test.owl#";

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

    model.prepare();

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

    OntClass ThingWithDecimalValue = model.getOntClass( ns + "ThingWithDecimalValue" );
    OntClass ThingWithDecimalProbability = model.getOntClass( ns
View Full Code Here

        ind.addProperty( p, value );
        i++;
      }
    }

    model.prepare();

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

  @Test
View Full Code Here

        ? 2
        : 10;
      C.addSuperClass( model.createCardinalityRestriction( null, prop, cardinality ) );
      model.createIndividual( ns + "x", C );

      model.prepare();

      assertTrue( ((PelletInfGraph) model.getGraph()).isConsistent() );
    }
  }
View Full Code Here

        c.addEquivalentClass( model.createHasValueRestriction( null, p, value ) );

        i++;
      }

      model.prepare();

      for( int j = start; j < i; j++ ) {
        assertTrue( datatype.getLocalName() + " " + datatypes[j], model.getIndividual(
            ns + "testInd" + j ).hasRDFType( model.getIndividual( ns + "testCls" + j ) ) );
      }
View Full Code Here

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

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "/datatypeDefinition.ttl" , "TTL");
    model.prepare();

    Resource a = model.getResource( ns + "a" );
    Resource b = model.getResource( ns + "b" );
   
    Resource A = model.getResource( ns + "A" );
View Full Code Here

   */
  @Test
  public void testListStatementsWithNullPredicate() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
   
    model.prepare();
   
    String ns = "urn:test:"

    Resource c = model.createResource(ns+"C")
    Property p1 = model.createProperty(ns+"P1");
View Full Code Here

      model.add(i1, RDF.type, C);
      model.add(i1, p, i2);

      // check consistency
      model.prepare();

      model.remove(i1, p, i2);

      assertTrue(model.contains(i1, RDF.type, OWL.Thing));
      assertFalse(model.contains(i2, RDF.type, OWL.Thing));
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.