Package com.hp.hpl.jena.ontology

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


    Resource C = model.createClass( ns + "C" );
    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Resource k = model.createResource( ns + "k" );
    Property p = model.createObjectProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
    model.add( i, p, k );
    model.add( j, RDF.type, C );
View Full Code Here


    Resource j = model.createResource( ns + "j" );
    Resource k = model.createResource( ns + "k" );
    Resource l = model.createResource( ns + "l" );
    Property p1 = model.createObjectProperty( ns + "p1" );
    Property p2 = model.createObjectProperty( ns + "p2" );
    RDFList list = model.createList( new RDFNode[] { p1, p2 } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
    model.add( i, p1, k );
    model.add( i, p2, l );
View Full Code Here

    Resource C = model.createClass( ns + "C" );
    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Literal k = model.createLiteral( "k" );
    Property p = model.createDatatypeProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
    model.add( i, p, k );
    model.add( j, RDF.type, C );
View Full Code Here

    Resource D = model.createClass( ns + "D" );
    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Resource k = model.createResource( ns + "k" );
    Property p = model.createObjectProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
    model.add( i, p, k );
    model.add( j, RDF.type, D );
View Full Code Here

    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Resource k = model.createResource( ns + "k" );
    Resource l = model.createResource( ns + "l" );
    Property p = model.createObjectProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
    model.add( i, p, k );
    model.add( j, RDF.type, C );
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

    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 ) );
    assertTrue( !i1.isSameAs( i3 ) );
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

    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 } ) );
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.