Package com.hp.hpl.jena.ontology

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


    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


  public void testSameAs1() {
    String ns = "urn:test:";

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

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

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

    String ns = "urn:test:";

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

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

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

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

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

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

    a.addProperty( p, c );
View Full Code Here

  @Test
  public void testSameAs2() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    Property prop = model.createProperty( "http://test#prop" );
    i1.addProperty( prop, "test" );
    i1.addSameAs( i2 );
View Full Code Here

  public void testSameAs2() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    Property prop = model.createProperty( "http://test#prop" );
    i1.addProperty( prop, "test" );
    i1.addSameAs( i2 );

    // confirm that sameAs was created
View Full Code Here

  @Test
  public void testSameAs3() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    OntClass c = model.createEnumeratedClass( "http://test#C", model.createList( new RDFNode[] {
        i1, i2 } ) );
    Individual i3 = model.createIndividual( "http://test#i3", c );
View Full Code Here

  public void testSameAs3() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    OntClass c = model.createEnumeratedClass( "http://test#C", model.createList( new RDFNode[] {
        i1, i2 } ) );
    Individual i3 = model.createIndividual( "http://test#i3", c );

    assertTrue( !i1.isSameAs( i2 ) );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    OntClass c = model.createEnumeratedClass( "http://test#C", model.createList( new RDFNode[] {
        i1, i2 } ) );
    Individual i3 = model.createIndividual( "http://test#i3", c );

    assertTrue( !i1.isSameAs( i2 ) );
    assertTrue( !i1.isSameAs( i3 ) );
    assertIteratorValues( i1.listSameAs(), new Resource[] { i1 } );
View Full Code Here

  public void testFuncProp() {
    String ns = "urn:test:";

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

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

    ObjectProperty p = model.createObjectProperty( ns + "p" );
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.