Package com.hp.hpl.jena.ontology

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


    OntModel ont = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    ObjectProperty p = ont.createObjectProperty( ns + "p", /* functional = */true );

    Individual s = ont.createIndividual( ns + "s", OWL.Thing );
    Individual o1 = ont.createIndividual( ns + "o1", OWL.Thing );
    Individual o2 = ont.createIndividual( ns + "o2", OWL.Thing );
    s.addProperty( p, o1 );
    s.addProperty( p, o2 );

    ont.prepare();
View Full Code Here


    ObjectProperty p = ont.createObjectProperty( ns + "p", /* functional = */true );

    Individual s = ont.createIndividual( ns + "s", OWL.Thing );
    Individual o1 = ont.createIndividual( ns + "o1", OWL.Thing );
    Individual o2 = ont.createIndividual( ns + "o2", OWL.Thing );
    s.addProperty( p, o1 );
    s.addProperty( p, o2 );

    ont.prepare();

View Full Code Here

  public void testAnonTypes() {
    String ns = "urn:test:";
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    OntClass c = model.createClass( ns + "C" );

    Individual anon = model.createIndividual( c );
    Individual x = model.createIndividual( ns + "x", c );

    model.contains( OWL.Nothing, RDF.type, OWL.Class );
   
    assertIteratorValues( model.listStatements( x, RDF.type, (Resource) null ), new Object[] {
View Full Code Here

    String ns = "urn:test:";
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    OntClass c = model.createClass( ns + "C" );

    Individual anon = model.createIndividual( c );
    Individual x = model.createIndividual( ns + "x", c );

    model.contains( OWL.Nothing, RDF.type, OWL.Class );
   
    assertIteratorValues( model.listStatements( x, RDF.type, (Resource) null ), new Object[] {
      model.createStatement( x, RDF.type, OWL.Thing ),
View Full Code Here

    OntClass class1 = ontmodel.createClass( nc + "C1" );
    OntClass class2 = ontmodel.createClass( nc + "C2" );

    Individual[] inds = new Individual[6];
    for( int j = 0; j < 6; j++ ) {
      inds[j] = ontmodel.createIndividual( nc + "Ind" + j, OWL.Thing );
    }

    inds[0].addRDFType( class1 );
    inds[1].addRDFType( class1 );
    inds[2].addRDFType( class1 );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel();

    OntClass A = model.createClass( ns + "A" );
    ObjectProperty P = model.createObjectProperty( ns + "P" );
    P.addDomain( A );
    Individual x = model.createIndividual( ns + "x", OWL.Thing );
    Individual y = model.createIndividual( ns + "y", OWL.Thing );
    x.addProperty( P, y );

    assertTrue( x.hasRDFType( A ) );
View Full Code Here

    OntClass A = model.createClass( ns + "A" );
    ObjectProperty P = model.createObjectProperty( ns + "P" );
    P.addDomain( A );
    Individual x = model.createIndividual( ns + "x", OWL.Thing );
    Individual y = model.createIndividual( ns + "y", OWL.Thing );
    x.addProperty( P, y );

    assertTrue( x.hasRDFType( A ) );

    x.removeRDFType( A );
View Full Code Here

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

    OntClass C = model.createClass( ns + "C" );
    OntClass D = model.createClass( ns + "D" );

    Individual a = model.createIndividual( ns + "a", C );
    Individual b = model.createIndividual( ns + "b", C );
    Individual c = model.createIndividual( ns + "c", D );
    Individual d = model.createIndividual( ns + "d", OWL.Thing );

    ObjectProperty p = model.createObjectProperty( ns + "p" );
View Full Code Here

    OntClass C = model.createClass( ns + "C" );
    OntClass D = model.createClass( ns + "D" );

    Individual a = model.createIndividual( ns + "a", C );
    Individual b = model.createIndividual( ns + "b", C );
    Individual c = model.createIndividual( ns + "c", D );
    Individual d = model.createIndividual( ns + "d", OWL.Thing );

    ObjectProperty p = model.createObjectProperty( ns + "p" );
View Full Code Here

    OntClass C = model.createClass( ns + "C" );
    OntClass D = model.createClass( ns + "D" );

    Individual a = model.createIndividual( ns + "a", C );
    Individual b = model.createIndividual( ns + "b", C );
    Individual c = model.createIndividual( ns + "c", D );
    Individual d = model.createIndividual( ns + "d", OWL.Thing );

    ObjectProperty p = model.createObjectProperty( ns + "p" );

    C.addDisjointWith( D );
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.