Package de.fzi.herakles.commons.strategy

Examples of de.fzi.herakles.commons.strategy.LoadException


  }
 
  @Override
  public void createNonBufferingReasoner(OWLOntology ontology) {
    if( this.registry == null )
      throw new LoadException( "No registry defined." );
   
    // load only into those reasoners, which are currently idle and have not loaded an ontology yet
    this.paralleliser.setReasoners( registry.getAsSet( true, false ) );
   
    /*
    Class<?> paramTypes = new Class<?>;
    Object params = new Object;
    int index = 0;
    for(OWLOntology ont: ontologies){
      params[index] = ont;
      paramTypes[index++] = OWLOntology.class;
    }*/
   
    Class<?>[] paramTypes = { OWLOntology.class };
    Object[] params = { ontology };
       
    Query query;
        try {
            query = QueryFactory.getQuery( "createNonBufferingReasoner", paramTypes, params );
            if(logger.isInfoEnabled()){
              logger.info( "Executing " + query.getTask() + " ..." );
            }
           
            this.paralleliser.setTask(query);
            try {
                this.paralleliser.parallelise();
                // if some reasoners were unable to load the ontologies, they are not marked as laden
               
                // this exception is thrown if no reasoner succeeds
            } catch( HeraklesException e ) {
                throw new LoadException( "No registered reasoner could load ontologies." );
            }
           
            this.loadedOntology = ontology;
        } catch( IllegalArgumentException e1 ) {
            // TODO Auto-generated catch block
View Full Code Here


  }

  @Override
  public void createNonBufferingReasoner(OWLOntology ontology, OWLReasonerConfiguration conf) throws IllegalConfigurationException {
    if( this.registry == null )
      throw new LoadException( "No registry defined." );
     
    // load only into those reasoners, which are currently idle and have not loaded an ontology yet
   
    Set<ReasonerAdapter> reasoners = registry.getAsSet( true, false );
   
    this.paralleliser.setReasoners( reasoners );
   
//    setProgressor();
//    this.progressor.setReasoners( reasoners );
//    this.progressor.setReasonerProgressMonitor(this.monitor);
       
    /*
    Class<?> paramTypes = new Class<?>;
    Object params = new Object;
    int index = 0;
    for(OWLOntology ont: ontologies){
      params[index] = ont;
      paramTypes[index++] = OWLOntology.class;
    }*/
   
    Class<?>[] paramTypes = { OWLOntology.class , OWLReasonerConfiguration.class};
    Object[] params = { ontology, conf };
       
    Query query;
        try {
            query = QueryFactory.getQuery( "createNonBufferingReasoner", paramTypes, params );
            if(logger.isInfoEnabled()){
              logger.info( "Executing " + query.getTask() + " ..." );
            }
           
            this.paralleliser.setTask(query);
            try {
                this.paralleliser.parallelise();
//              this.progressor.showProgress();
                // if some reasoners were unable to load the ontologies, they are not marked as laden
               
                // this exception is thrown if no reasoner succeeds
            } catch( HeraklesException e ) {
                throw new LoadException( "No registered reasoner could load ontologies." );
            }
           
            this.loadedOntology = ontology;
        } catch( IllegalArgumentException e1 ) {
            // TODO Auto-generated catch block
View Full Code Here

  }

  @Override
  public void createReasoner(OWLOntology ontology) {
    if( this.registry == null )
      throw new LoadException( "No registry defined." );
   
    // load only into those reasoners, which are currently idle and have not loaded an ontology yet
    this.paralleliser.setReasoners( registry.getAsSet( true, false ) );
   
    /*
    Class<?> paramTypes = new Class<?>;
    Object params = new Object;
    int index = 0;
    for(OWLOntology ont: ontologies){
      params[index] = ont;
      paramTypes[index++] = OWLOntology.class;
    }*/
   
    Class<?>[] paramTypes = { OWLOntology.class };
    Object[] params = { ontology };
       
    Query query;
        try {
            query = QueryFactory.getQuery( "createReasoner", paramTypes, params );
            if(logger.isInfoEnabled()){
              logger.info( "Executing " + query.getTask() + " ..." );
            }
           
            this.paralleliser.setTask(query);
            try {
                this.paralleliser.parallelise();
                // if some reasoners were unable to load the ontologies, they are not marked as laden
               
                // this exception is thrown if no reasoner succeeds
            } catch( HeraklesException e ) {
                throw new LoadException( "No registered reasoner could load ontologies." );
            }
           
            this.loadedOntology = ontology;
        } catch( IllegalArgumentException e1 ) {
            // TODO Auto-generated catch block
View Full Code Here

  }
 
  @Override
  public void createReasoner(OWLOntology ontology, OWLReasonerConfiguration conf) throws IllegalConfigurationException {
    if( this.registry == null )
      throw new LoadException( "No registry defined." );
       
    Set<ReasonerAdapter> reasoners = registry.getAsSet( true, false );
   
    this.paralleliser.setReasoners( reasoners );
   
//    setProgressor();
//    this.progressor.setReasoners( reasoners );
//    this.progressor.setReasonerProgressMonitor(this.monitor);
     
    /*
    Class<?> paramTypes = new Class<?>;
    Object params = new Object;
    int index = 0;
    for(OWLOntology ont: ontologies){
      params[index] = ont;
      paramTypes[index++] = OWLOntology.class;
    }*/
   
    Class<?>[] paramTypes = { OWLOntology.class, OWLReasonerConfiguration.class };
    Object[] params = { ontology, conf };
       
    Query query;
        try {
            query = QueryFactory.getQuery( "createReasoner", paramTypes, params );
            if(logger.isInfoEnabled()){
              logger.info( "Executing " + query.getTask() + " ..." );
            }
           
            this.paralleliser.setTask(query);
            try {
                this.paralleliser.parallelise();
//              this.progressor.showProgress();
                // if some reasoners were unable to load the ontologies, they are not marked as laden
               
                // this exception is thrown if no reasoner succeeds
            } catch( HeraklesException e ) {
                throw new LoadException( "No registered reasoner could load ontologies." );
            }
           
            this.loadedOntology = ontology;
        } catch( IllegalArgumentException e1 ) {
            // TODO Auto-generated catch block
View Full Code Here

  }
 
  public void dispose() throws LoadException {

    if( this.registry == null )
      throw new LoadException( "No registry defined." );
   
    this.paralleliser.setReasoners( registry.getAsSet( false ) );
    Class<?>[] paramTypes = {};
    Object[] params = {};
   
    Query query;
        try {
            query = QueryFactory.getQuery( "dispose", paramTypes, params );
            if(logger.isInfoEnabled()){
              logger.info( "Executing " + query.getTask() + " ..." );
            }
           
            this.paralleliser.setTask(query);
            try {
                this.paralleliser.parallelise();
               
            // this exception is thrown if no reasoner succeeds
            } catch( HeraklesException e ) {
                throw new LoadException( "No reasoner was able to dispose itself." );
            }
        } catch( IllegalArgumentException e1 ) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        } catch( ClassCastException e1 ) {
View Full Code Here

TOP

Related Classes of de.fzi.herakles.commons.strategy.LoadException

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.