Examples of createIndividual()


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

    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

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

  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

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

    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" );
    a.addProperty( p, b );
View Full Code Here

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

    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" );
    a.addProperty( p, b );
View Full Code Here

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

    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" );
    a.addProperty( p, b );

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

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

    String ns = "urn:test:";
    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( spec, null );
    OntClass HomeOwner = model.createClass( ns + "HomeOwner" );
    Individual bob = model.createIndividual( ns + "bob", HomeOwner );
    ObjectProperty hasNeighbor = model.createObjectProperty( ns + "hasNeighbor" );
    OntClass NeighborOfBob = model.createClass( ns + "NeighborOfBob" );
    NeighborOfBob
        .addEquivalentClass( model.createHasValueRestriction( null, hasNeighbor, bob ) );
    Individual susan = model.createIndividual( ns + "susan", HomeOwner );
View Full Code Here

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

    Individual bob = model.createIndividual( ns + "bob", HomeOwner );
    ObjectProperty hasNeighbor = model.createObjectProperty( ns + "hasNeighbor" );
    OntClass NeighborOfBob = model.createClass( ns + "NeighborOfBob" );
    NeighborOfBob
        .addEquivalentClass( model.createHasValueRestriction( null, hasNeighbor, bob ) );
    Individual susan = model.createIndividual( ns + "susan", HomeOwner );
    susan.setPropertyValue( hasNeighbor, bob );
    // model.write(System.out, "RDF/XML-ABBREV");

    assertTrue( "susan is not a NeighborOfBob", susan.hasRDFType( NeighborOfBob ) );
  }
View Full Code Here

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

    OntProperty hasFather = model.createObjectProperty( ns + "hasFather" );
    OntProperty hasBioFather = model.createObjectProperty( ns + "hasBioFather", true );
    hasBioFather.addSuperProperty( hasFather );
    Person.addSuperClass( model.createMinCardinalityRestriction( null, hasBioFather, 1 ) );

    Individual Bob = model.createIndividual( ns + "Bob", Person );
    Individual Dad = model.createIndividual( ns + "Dad", Person );
    Bob.addProperty( hasBioFather, Dad );
    Bob.addRDFType( model.createCardinalityRestriction( null, hasFather, 1 ) );

    model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, model );
View Full Code Here

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

    OntProperty hasBioFather = model.createObjectProperty( ns + "hasBioFather", true );
    hasBioFather.addSuperProperty( hasFather );
    Person.addSuperClass( model.createMinCardinalityRestriction( null, hasBioFather, 1 ) );

    Individual Bob = model.createIndividual( ns + "Bob", Person );
    Individual Dad = model.createIndividual( ns + "Dad", Person );
    Bob.addProperty( hasBioFather, Dad );
    Bob.addRDFType( model.createCardinalityRestriction( null, hasFather, 1 ) );

    model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, model );
View Full Code Here

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

    DatatypeProperty dp = model.createDatatypeProperty( ns + "dp" );

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

    OntClass C = model.createClass( ns + "C" );
    Individual a = model.createIndividual( ns + "a", C );
    Individual b = model.createIndividual( ns + "b", C );

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );
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.