Package org.mindswap.pellet.utils.progress

Examples of org.mindswap.pellet.utils.progress.ProgressMonitor


  // This tests ticket 148
  // Canceling realization with REALIZE_BY_INDIVIDUAL=false throws an NPE
  public void testRealizeByIndividualsNPE() throws Exception {
    PelletOptions.REALIZE_INDIVIDUAL_AT_A_TIME = false;

    ProgressMonitor monitor = new TimedProgressMonitor( 1 );

    Reasoner pellet = new Reasoner( OWL.manager );
    KnowledgeBase kb = pellet.getKB();

    OWLOntology ont = loadOntology( base + "food.owl" );
View Full Code Here


    int axiomCount = 0;
    Collection<OWLOntology> toBeLoaded = new LinkedHashSet<OWLOntology>();
    for( OWLOntology ontology : ontologies )
      axiomCount += load( ontology, false, toBeLoaded );

    ProgressMonitor monitor = new SilentProgressMonitor();
    monitor.setProgressTitle( "Loading" );
    monitor.setProgressLength( axiomCount );
    monitor.taskStarted();

    visitor.reset();
    visitor.setAddAxiom( true );
    visitor.setMonitor( monitor );

    for( OWLOntology ontology : toBeLoaded )
      ontology.accept( visitor );
   
    visitor.verify();

    monitor.taskFinished();

    timer.stop();
  }
View Full Code Here

   */
  protected void extractModuleSignatures(Set<? extends OWLEntity> entities) {

    log.fine( "Extract module for " + entities );

    ProgressMonitor monitor = new ConsoleProgressMonitor();
    monitor.setProgressTitle( "Extracting" );
    monitor.setProgressLength( entities.size() );
    monitor.taskStarted();
   
    Set<OWLEntity> nonLocalModule = new HashSet<OWLEntity>();
    for( OWLAxiom axiom : getAxioms() ) {
      if( !isLocal( axiom, Collections.<OWLEntity> emptySet() ) )
        nonLocalModule.addAll( OntologyUtils.getSignature( axiom ) );
    }

    // iterate over classes passed in, and extract all their modules
    for( OWLEntity ent : entities ) {
      monitor.incrementProgress();

      if( log.isLoggable( Level.FINE ) )
        log.fine( "Class: " + ent );

      if( !modules.containsKey( ent ) )
        if( optimizeForSharedModules )
          extractModuleSignature( ent, new HashSet<OWLEntity>(),
              new ArrayList<OWLEntity>(), new HashSet<OWLEntity>( nonLocalModule ) );
        else
          extractModuleSignature( ent, new DisjointSet<OWLEntity>(),
              new ArrayList<OWLEntity>(), new HashSet<OWLEntity>( nonLocalModule ) );
    }

    monitor.taskFinished();

    if( log.isLoggable( Level.FINE ) )
      log.fine( modules.toString() );
  }
View Full Code Here

  public void testRealizeByIndividualsNPE() throws Exception {
    Properties newOptions = PropertiesBuilder.singleton( "REALIZE_INDIVIDUAL_AT_A_TIME", "true" );
    Properties savedOptions = PelletOptions.setOptions( newOptions );
   
    try {
      ProgressMonitor monitor = new TimedProgressMonitor( 1 );
 
      OWLOntology ont = loadOntology( base + "food.owl" );
     
      PelletReasoner pellet = PelletReasonerFactory.getInstance().createReasoner( ont );
      KnowledgeBase kb = pellet.getKB();
View Full Code Here

      throw new PelletCmdException( "Ontology is inconsistent, run \"pellet explain\" to get the reason" );

    QNameProvider qnames = new QNameProvider();
    Set<String> unsatisfiableClasses = new TreeSet<String>( Comparators.stringComparator );
   
    ProgressMonitor monitor = PelletOptions.USE_CLASSIFICATION_MONITOR.create();
    monitor.setProgressTitle( "Finding unsatisfiable" );
    monitor.setProgressLength( kb.getClasses().size() );
   
    startTask( "find unsatisfiable" );
    monitor.taskStarted();
   
    Iterator<ATermAppl> i = kb.getClasses().iterator();
    while( i.hasNext() ) {
      monitor.incrementProgress();
      ATermAppl c = i.next();
      if( !kb.isSatisfiable( c ) ) {
        unsatisfiableClasses.add( qnames.shortForm( c.getName() ) );
      }
    }
   
    monitor.taskFinished();
    finishTask( "find unsatisfiable" );
   
    output("");
    if( unsatisfiableClasses.isEmpty() ) {
      output( "Found no unsatisfiable concepts." );     
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.utils.progress.ProgressMonitor

Copyright © 2018 www.massapicom. 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.