Package com.hp.hpl.jena.ontology

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


  public void testInfiniteChain() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.setStrictMode( false );
    model.read( base + "infiniteChain.owl" );

    model.prepare();

    assertFalse( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    String ns = "http://www.example.org/test#";
    Property prop = model.getBaseModel().getProperty( ns + "ssn" );
View Full Code Here


    OntProperty hasParent = model.getObjectProperty( ns + "hasParent" );
    OntProperty hasFather = model.getObjectProperty( ns + "hasFather" );
    OntProperty hasMother = model.getObjectProperty( ns + "hasMother" );
    OntProperty topObjProp = model.getObjectProperty( OWL2.topObjectProperty.getURI() );

    model.prepare();

    assertTrue( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasParent ), new Resource[] {
        Mom, Dad } );
View Full Code Here

    OntClass Team = model.getOntClass( ns + "Team" );
    OntClass MixedTeam = model.getOntClass( ns + "MixedTeam" );
    OntClass NonSingletonTeam = model.getOntClass( ns + "NonSingletonTeam" );
    OntClass SingletonTeam = model.getOntClass( ns + "SingletonTeam" );

    model.prepare();

    assertTrue( Sam.isDifferentFrom( Chris ) );
    assertTrue( Chris.isDifferentFrom( Sam ) );

    assertTrue( MixedTeam.hasSuperClass( Team ) );
View Full Code Here

  @Test
  public void testTransitive1() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "agencies.owl" );

    model.prepare();

    String ns = "http://www.owl-ontologies.com/unnamed.owl#";
    Individual Forest_Service = model.getIndividual( ns + "Forest_Service" );
    ObjectProperty comprises = model.getObjectProperty( ns + "comprises" );
    Individual Executive = model.getIndividual( ns + "Executive" );
View Full Code Here

  @Test
  public void testPropertyChainInvalid() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "propertyChainInvalid.owl" );
 
    model.prepare();
 
    KnowledgeBase kb = ((PelletInfGraph) model.getGraph()).getKB();
 
    for( Role r : kb.getRBox().getRoles() ) {
      if( !ATermUtils.isBuiltinProperty( r.getName() ) ) {
View Full Code Here

    p.addRange( XSD.xboolean );

    C1.addSuperClass( model.createMinCardinalityRestriction( null, p, 2 ) );
    C2.addSuperClass( model.createMinCardinalityRestriction( null, p, 3 ) );

    model.prepare();

    assertTrue( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    assertTrue( !model.contains( C1, RDFS.subClassOf, OWL.Nothing ) );
    assertTrue( model.contains( C2, RDFS.subClassOf, OWL.Nothing ) );
View Full Code Here

    Literal one = model.createTypedLiteral( Integer.valueOf( 1 ) );
    a.addProperty( dp, one );
    b.addProperty( dp, one );

    model.prepare();

    assertTrue( a.isSameAs( b ) );
    assertIteratorValues( a.listSameAs(), new Resource[] { a, b } );

    assertTrue( b.hasProperty( op, c ) );
View Full Code Here

    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 ) );
    assertIteratorValues( i1.listSameAs(), new Resource[] { i1, i2 } );

    assertTrue( !i1.isSameAs( i3 ) );
View Full Code Here

    b.addRDFType( model.createAllValuesFromRestriction( null, dp, XSD.nonPositiveInteger ) );

    Literal one = model.createTypedLiteral( Integer.valueOf( 1 ) );
    c.addProperty( dp, one );

    model.prepare();

    assertTrue( a.isSameAs( b ) );
    assertTrue( b.isSameAs( a ) );
    assertIteratorValues( a.listSameAs(), new Resource[] { a, b } );
    assertIteratorValues( b.listSameAs(), new Resource[] { a, b } );
View Full Code Here

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

    model.prepare();

    Literal oneDecimal = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.decimal.getURI() ) );
   
    assertIteratorValues( a.listPropertyValues( dp ), new Literal[] { one } );
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.