Package com.hp.hpl.jena.ontology

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


    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );

    Literal val1 = model.createLiteral( "val1" );
    x.addProperty( prop, val1 );
    Literal val2 = model.createLiteral( "val2" );
    x.addProperty( sub, val2 );

    assertTrue( model.validate().isValid() );
View Full Code Here


    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );

    Literal val1 = model.createLiteral( "val1" );
    x.addProperty( prop, val1 );
    Literal val2 = model.createLiteral( "val2" );
    x.addProperty( sub, val2 );

    assertTrue( model.validate().isValid() );

    assertPropertyValues( model, x, prop, val1, val2 );
View Full Code Here

    Resource d = ResourceFactory.createResource();

    model.add( a, p, b );
    model.add( d, p, b );
    model.add( a, p, c );
    model.add( a, q, model.createLiteral( "l" ) );

    model.add( a, t, bnode1 );
    model.add( bnode1, t, bnode2 );

    assertTrue( model.contains( a, t, bnode2 ) );
View Full Code Here

    assertTrue( model.contains( a, t, bnode2 ) );

    model.prepare();

    model.add( a, r, model.createLiteral( "l" ) );
    model.add( a, r, model.createResource() );

    assertTrue( model.validate().isValid() );

    model.prepare();
View Full Code Here

    Resource d = ResourceFactory.createResource();

    model.add( a, p, b );
    model.add( d, p, b );
    model.add( a, p, c );
    model.add( a, q, model.createLiteral( "l" ) );

    model.add( a, t, bnode1 );
    model.add( bnode1, t, bnode2 );

    assertTrue( model.contains( a, t, bnode2 ) );
View Full Code Here

    assertTrue( model.contains( a, t, bnode2 ) );

    model.prepare();

    model.add( a, r, model.createLiteral( "l" ) );
    model.add( a, r, model.createResource() );

    assertTrue( model.validate().isValid() );

    model.prepare();
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.