Package com.hp.hpl.jena.ontology

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


    model.add( i, RDF.type, C );
    model.add( i, p, k );
    model.add( j, RDF.type, C );
    model.add( j, p, k );

    model.prepare();

    assertTrue( model.contains( i, OWL.sameAs, j ) );
    assertTrue( model.contains( j, OWL.sameAs, i ) );
  }
View Full Code Here


    model.add( i, RDF.type, OWL.Thing );
    model.add( i, p, k );
    model.add( j, RDF.type, OWL.Thing );
    model.add( j, p, k );

    model.prepare();

    assertTrue( model.contains( i, OWL.sameAs, j ) );
    assertTrue( model.contains( j, OWL.sameAs, i ) );
  }
View Full Code Here

  @Test
  public void testCardinalityParsing() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "cardinality_parsing.owl" );
    model.prepare();
   
    assertTrue( ((PelletInfGraph) model.getGraph()).getLoader().getUnpportedFeatures().isEmpty() );
  }
 
View Full Code Here

  public void testAnnotationPropertyQuery() {
    String ns = "http://www.example.org#";
   
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    Property p = model.createAnnotationProperty( ns + "p" );
    model.prepare();

    assertTrue(model.contains(p, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( p, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( p, null ), OWL.AnnotationProperty );
View Full Code Here

      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
    for( int i = 0; i < stats.length; i++ ) {     
      model.add( stats[i] );
      model.prepare();
      assertEquals( i < 2, ((PelletInfGraph) model.getGraph()).isConsistent() );
      model.remove( stats[i] );
    }       
  }
 
View Full Code Here

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

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "/float_intervals.ttl" , "TTL");
    model.prepare();

    Resource C1 = model.getResource( ns + "46-60" );
    Resource C2 = model.getResource( ns + "76-80" );
   
    Resource i1 = model.getResource( ns + "mark1" );
View Full Code Here

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

  @Test
View Full Code Here

    Individual Abel = model.getIndividual( ont + "#Abel" );
    Individual Cain = model.getIndividual( ont + "#Cain" );
    Individual Remus = model.getIndividual( ont + "#Remus" );
    Individual Romulus = model.getIndividual( ont + "#Romulus" );

    model.prepare();

    // Cain has sibling Abel due to SiblingRule
    printPropertyValues( Cain, sibling );
    // Abel has sibling Cain due to SiblingRule and rule works symmetric
    printPropertyValues( Abel, sibling );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.getDocumentManager().setProcessImports( false );

    model.read( base + "ESG1.1.owl" );

    model.prepare();

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

    Individual jdl62 = model.getIndividual( ns + "JDL_00062" );
    Individual jdl63 = model.getIndividual( ns + "JDL_00063" );
View Full Code Here

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

    model.prepare();

    Iterator<?> i = model.listDatatypeProperties();
    while( i.hasNext() ) {
      DatatypeProperty p = (DatatypeProperty) i.next();
      Iterator<?> j = p.listRange();
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.