Package com.hp.hpl.jena.ontology

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


    OntClass A = model.createClass( ns + "A" );
    OntClass B = model.createClass( ns + "B" );
    OntClass notA = model.createComplementClass( null, A );
    OntClass notB = model.createComplementClass( null, B );
    OntClass AorB = model.createUnionClass( null, model.createList( new OntClass[] { A, B } ) );
    OntClass AorNotB = model.createUnionClass( null, model
        .createList( new OntClass[] { A, notB } ) );
    OntClass notAorB = model.createUnionClass( null, model
        .createList( new OntClass[] { notA, B } ) );

    Individual x = model.createIndividual( ns + "x", OWL.Thing );
View Full Code Here


    OntClass notA = model.createComplementClass( null, A );
    OntClass notB = model.createComplementClass( null, B );
    OntClass AorB = model.createUnionClass( null, model.createList( new OntClass[] { A, B } ) );
    OntClass AorNotB = model.createUnionClass( null, model
        .createList( new OntClass[] { A, notB } ) );
    OntClass notAorB = model.createUnionClass( null, model
        .createList( new OntClass[] { notA, B } ) );

    Individual x = model.createIndividual( ns + "x", OWL.Thing );
    x.addRDFType( AorB );
    x.addRDFType( AorNotB );
View Full Code Here

    OntClass C = ont.createClass( "C" );

    ObjectProperty p1 = ont.createObjectProperty( "p1" );
    ObjectProperty p2 = ont.createObjectProperty( "p2" );

    RDFList pChain = ont.createList( new RDFNode[] { p1, p2 } );
    ont.add( p1, OWL2.propertyChainAxiom, pChain );

    Individual x = ont.createIndividual( OWL.Thing );
    Individual y = ont.createIndividual( OWL.Thing );
    Individual z = ont.createIndividual( OWL.Thing );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( spec, null );

    OntClass X = model.createClass( ns + "X" );
    ObjectProperty hasX = model.createObjectProperty( ns + "hasX" );
    OntClass AllX = model.createAllValuesFromRestriction( null, hasX, X );
    OntClass Y = model.createIntersectionClass( ns + "Y", model.createList( new RDFNode[] {
        X, AllX } ) );

    assertTrue( "AllX is not a superclass of Y", Y.hasSuperClass( AllX ) );
  }
View Full Code Here

        inds[0], inds[1], inds[2], inds[3] } );

    assertIteratorValues( class2.listInstances(), new Resource[] {
        inds[2], inds[3], inds[4], inds[5] } );

    RDFList list = ontmodel.createList( new RDFNode[] { class1, class2 } );

    IntersectionClass class3 = ontmodel.createIntersectionClass( null, list );

    UnionClass class4 = ontmodel.createUnionClass( null, list );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( spec, null );

    OntClass A = model.createClass( ns + "A" );
    OntClass B = model.createClass( ns + "B" );
    ObjectProperty P = model.createObjectProperty( ns + "P" );
    P.addDomain( model.createUnionClass( null, model.createList( new RDFNode[] { A, B } ) ) );

    OntClass oc = model.getOntClass( ns + "B" );

    assertIteratorValues( oc.listDeclaredProperties(), new Resource[] { P } );
  }
View Full Code Here

    OntClass C = ont.createClass( "C" );

    ObjectProperty p1 = ont.createObjectProperty( "p1" );
    ObjectProperty p2 = ont.createObjectProperty( "p2" );

    RDFList pChain = ont.createList( new RDFNode[] { p1, p2 } );
    ont.add( p1, OWL2.propertyChainAxiom, pChain );

    Individual x = ont.createIndividual( OWL.Thing );
    Individual y = ont.createIndividual( OWL.Thing );
    Individual z = ont.createIndividual( OWL.Thing );
View Full Code Here

    Individual[] inds = new Individual[6];
    for( int j = 0; j < 6; j++ ) {
      inds[j] = ontmodel.createIndividual( nc + "Ind" + j, OWL.Thing );
    }
   
    ontmodel.add( class1, RDFS.subClassOf, ontmodel.createEnumeratedClass( null, ontmodel.createList( inds ) ) );
   
    Query query = QueryFactory.create( "PREFIX rdf:<" + RDF.getURI() + ">\n" +
        "SELECT * WHERE {\n" +
        "  ?x rdf:first ?y .\n" +
        "}" );
View Full Code Here

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

    RDFList conj = model.createList( new RDFNode[] { D, C } );
    OntClass CONJ = model.createIntersectionClass( null, conj );

    Individual i1 = model.createIndividual( ns + "i1", C );
    i1.addRDFType( D );
    Individual i2 = model.createIndividual( ns + "i2", C );
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.