Package com.hp.hpl.jena.ontology

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


    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

    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

    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

    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

    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

    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

  public void testIFDP1() {
    String ns = "http://www.example.org/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 op = model.createObjectProperty( ns + "op" );
    DatatypeProperty dp = model.createDatatypeProperty( ns + "dp" );
View Full Code Here

    String ns = "http://www.example.org/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 op = model.createObjectProperty( ns + "op" );
    DatatypeProperty dp = model.createDatatypeProperty( ns + "dp" );
    dp.convertToInverseFunctionalProperty();
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 op = model.createObjectProperty( ns + "op" );
    DatatypeProperty dp = model.createDatatypeProperty( ns + "dp" );
    dp.convertToInverseFunctionalProperty();
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.