Package com.hp.hpl.jena.ontology

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


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

    Individual i1 = model.createIndividual( ns + "i1", C );
    i1.addRDFType( D );
    Individual i2 = model.createIndividual( ns + "i2", C );
    i2.addRDFType( D );
    Individual i3 = model.createIndividual( ns + "i3", C );
    i3.addRDFType( E );
View Full Code Here


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

    Individual i1 = model.createIndividual( ns + "i1", C );
    i1.addRDFType( D );
    Individual i2 = model.createIndividual( ns + "i2", C );
    i2.addRDFType( D );
    Individual i3 = model.createIndividual( ns + "i3", C );
    i3.addRDFType( E );

    model.prepare();
View Full Code Here

    Individual i1 = model.createIndividual( ns + "i1", C );
    i1.addRDFType( D );
    Individual i2 = model.createIndividual( ns + "i2", C );
    i2.addRDFType( D );
    Individual i3 = model.createIndividual( ns + "i3", C );
    i3.addRDFType( E );

    model.prepare();

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

    dp.convertToInverseFunctionalProperty();

    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createMinCardinalityRestriction( null, dp, 1 ) );

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

    Literal zero = model.createTypedLiteral( Integer.valueOf( 0 ) );
    a.addProperty( dp, zero );
View Full Code Here

    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createMinCardinalityRestriction( null, dp, 1 ) );

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

    Literal zero = model.createTypedLiteral( Integer.valueOf( 0 ) );
    a.addProperty( dp, zero );
View Full Code Here

    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createMinCardinalityRestriction( null, dp, 1 ) );

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

    Literal zero = model.createTypedLiteral( Integer.valueOf( 0 ) );
    a.addProperty( dp, zero );

    b.addRDFType( model.createAllValuesFromRestriction( null, dp, XSD.nonPositiveInteger ) );
View Full Code Here

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

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

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

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );
View Full Code Here

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

    Individual s1 = ont.createIndividual( ns + "s1", OWL.Thing );
    Individual s2 = ont.createIndividual( ns + "s2", OWL.Thing );
    s1.addDifferentFrom( s2 );
    Individual o1 = ont.createIndividual( ns + "o1", OWL.Thing );
    Individual o2 = ont.createIndividual( ns + "o2", OWL.Thing );
    s1.addProperty( p, o1 );
View Full Code Here

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

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    OntClass Person = model.createClass( ns + "Person" );
    Individual john = model.createIndividual( ns + "JohnDoe", Person );
    DatatypeProperty email = model.createDatatypeProperty( ns + "email", false );

    john.addProperty( email, "john.doe@unknown.org" );
    john.addProperty( email, "jdoe@unknown.org" );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    DatatypeProperty prop = model.createDatatypeProperty( ns + "prop" );
    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );
    x.addProperty( prop, "literal" );

    model.prepare();

    assertTrue( ((PelletInfGraph) model.getGraph()).isConsistent() );
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.