Package de.fzi.herakles.commons.reasoner

Examples of de.fzi.herakles.commons.reasoner.ReasonerAdapter


  /**
   * select and run the suitable variant according to the configurated reasoners
   */
  private void runVariant(){
    ReasonerConfiguration reasonerCfg = HeraklesManager.getReasonerConfiguration();
    ReasonerAdapter positiveSoundReasoner = registry.getReasonerByID(reasonerCfg.getPositiveSoundReasoner());
    ReasonerAdapter negativeSoundReasoner = registry.getReasonerByID(reasonerCfg.getNegativeSoundReasoner());
    ReasonerAdapter completeReasoner = registry.getReasonerByID(reasonerCfg.getCompleteReasoner());
    ReasonerAdapter soundCompleteReasoner = registry.getReasonerByID(reasonerCfg.getSoundCompleteReasoner());
    ReasonerAdapter unsoundIncompleteReasoner = registry.getReasonerByID(reasonerCfg.getUnsoundIncompleteReasoner());
   
    variant(positiveSoundReasoner, negativeSoundReasoner, completeReasoner, soundCompleteReasoner, unsoundIncompleteReasoner);
   
   
   
View Full Code Here


    this.selector.setReasonerPool(registry.getAsSet(true, true));

    ((PropertyConstraintSelector) this.selector).addConstraint("name",
        "ScreechComplete");
    Set<ReasonerAdapter> completeReasoners = this.selector.select();
    ReasonerAdapter screechComplete = completeReasoners.iterator().next();
    screechComplete.getReasonerProperties().setProperty("name",
        "ScreechComplete");

    ((PropertyConstraintSelector) this.selector).clearConstraints();
    ((PropertyConstraintSelector) this.selector).addConstraint("name",
        "ScreechSound");
    Set<ReasonerAdapter> soundReasoners = this.selector.select();
    ReasonerAdapter screechSoundPositive = soundReasoners.iterator().next();
    screechSoundPositive.getReasonerProperties().setProperty("name",
        "ScreechSoundPositive");

    // ReasonerAdapter screechSoundNegative =
    // soundReasoners.iterator().next();
    // screechSoundNegative.getReasonerProperties().setProperty( "name",
View Full Code Here

  @Override
  protected void setSelector() {
    AQAQueryFilter filter = new AQAQueryFilter();
    AoideSelector selector = new AoideSelector();
    ReasonerAdapter reasoner = getReasonerByName("AQA");
    selector.setFilter(reasoner, filter);
    reasoner = getReasonerByName("Pellet");
    QueryFilter complementFilter = new ComplementQueryFilter(filter);
    selector.setFilter(reasoner, complementFilter);
    this.selector = selector;
View Full Code Here

   */
  private ReasonerAdapter getReasonerByName(String reasonerName){
    registry = HeraklesManager.getReasonerRegistry();
    Set<String> ids = registry.getReasonerIDs();
    for(String id: ids){
      ReasonerAdapter adapter = registry.getReasonerByID(id);
      String name = adapter.getReasonerProperties().getProperty("name", "unknown");
      if(name.equals(reasonerName))
        return adapter;
    }
   
    return null;
View Full Code Here

      logger.debug( "Created " + reasonerThreads.length + " thread(s)." );
    }

    for( int i = 0; i < reasonerThreads.length; i++ ) {

      ReasonerAdapter reasoner = reasonerThreads[i].getReasoner();
     
      // get statistic listener and send start task information
      StatisticListener listener = null;
      if(registry.hasStatisticListener(reasoner)){
        listener = registry.getStatisticListener(reasoner);
View Full Code Here

    this.selector.setReasonerPool( registry.getAsSet( true , true) );
   
    ((PropertyConstraintSelector) this.selector).addConstraint( "name", "ScreechComplete" );
    Set<ReasonerAdapter> completeReasoners = this.selector.select();
    ReasonerAdapter screechComplete = completeReasoners.iterator().next();
    screechComplete.getReasonerProperties().setProperty( "name", "ScreechComplete" );
    ((PropertyConstraintSelector) this.selector).clearConstraints();

    ((PropertyConstraintSelector) this.selector).addConstraint( "name", "ScreechSound" );
    Set<ReasonerAdapter> soundReasoners = this.selector.select();
    ReasonerAdapter screechSoundPositive = soundReasoners.iterator().next();
    ReasonerAdapter screechSoundNegative = soundReasoners.iterator().next();
    screechSoundPositive.getReasonerProperties().setProperty( "name", "ScreechSoundPositive" );
    screechSoundNegative.getReasonerProperties().setProperty( "name", "ScreechSoundNegative" );
    ((PropertyConstraintSelector) this.selector).clearConstraints();

   
//    int reasonerNumber=3;
//
View Full Code Here

    registry = HeraklesManager.getReasonerRegistry();
    if (!reasonerConfig.isLoaded()) reasonerConfig.loadRemoteReasonerConfiguration();
    for (String reasonerType : reasonerConfig.getRemoteReasonerTypes()) {
      for (Integer i : reasonerConfig.getRemoteReasonerIndex(reasonerType)) {
        System.err.println( "Trying to connect to reasoner " + reasonerConfig.getRemoteReasonerName(reasonerType, i) + " on host " + reasonerConfig.getRemoteReasonerHost(reasonerType, i) + " with port " + reasonerConfig.getRemoteReasonerPort(reasonerType, i));
        ReasonerAdapter adapter = null;
          adapter = registry.registerReasoner( manager, reasonerConfig.getRemoteReasonerName(reasonerType, i), reasonerConfig.getRemoteReasonerHost(reasonerType, i), reasonerConfig.getRemoteReasonerPort(reasonerType, i) );
        registry.setReasonerID(reasonerConfig.getRemoteReasonerName(reasonerType, i), adapter);     
      }
    } 
    setRegistry( registry );   
View Full Code Here

    this.registry = HeraklesManager.getReasonerRegistry();
    if (!reasonerConfig.isLoaded()) reasonerConfig.loadRemoteReasonerConfiguration();
    for (String reasonerType : reasonerConfig.getRemoteReasonerTypes()) {
      for (Integer i : reasonerConfig.getRemoteReasonerIndex(reasonerType)) {
        System.err.println( "Trying to connect to reasoner " + reasonerConfig.getRemoteReasonerName(reasonerType, i) + " on host " + reasonerConfig.getRemoteReasonerHost(reasonerType, i) + " with port " + reasonerConfig.getRemoteReasonerPort(reasonerType, i));
        ReasonerAdapter adapter = null;
          adapter = registry.registerReasoner( manager, reasonerConfig.getRemoteReasonerName(reasonerType, i), reasonerConfig.getRemoteReasonerHost(reasonerType, i), reasonerConfig.getRemoteReasonerPort(reasonerType, i) );
        registry.setReasonerID(reasonerConfig.getRemoteReasonerName(reasonerType, i), adapter);     
      }
    }       
    this.start(this.registry, this.loadStrategy, this.executionStrategy);
View Full Code Here

          String port = config.getRemoteReasonerPort(type, index);

          Properties pro = null;
         
//          try {
            ReasonerAdapter adapter = null;
            boolean isNewReasoner = false;
            if(!registry.containsReasoner(name, host, port)){
              isNewReasoner = true;
              adapter = registry.registerReasoner(manager, name, host, port);
            } else {
              adapter = registry.getReasoner(name, host, port);
            }
            pro = adapter.getReasonerProperties();
           
            // test the reasoner types and correct the configuration
            String proType = pro.getProperty("name").toUpperCase();
            if(!proType.equals(type)){
              config.removeRemoteReasoner(type, index);
View Full Code Here

//         try {
          ModelManager modelManager = workspace.getEditorKit().getModelManager();
          if(modelManager instanceof OWLModelManager){
            OWLOntologyManager manager = ((OWLModelManager)modelManager).getOWLOntologyManager();
            ReasonerRegistry registry = HeraklesManager.getReasonerRegistry();
            ReasonerAdapter adapter = null;
            boolean isNewReasoner = false;
            if(!registry.containsReasoner(name, host, port)){
              adapter = registry.registerReasoner(manager, name, host, port);
              pro = adapter.getReasonerProperties();
              isNewReasoner = true;
            } else {
              adapter = registry.getReasoner(name, host, port);
              pro = adapter.getReasonerProperties();
            }
           
            String type = pro.getProperty("name").toUpperCase();
            if(isNewReasoner){
              int index = config.addRemoteReasoner(type, name, host, port);
View Full Code Here

TOP

Related Classes of de.fzi.herakles.commons.reasoner.ReasonerAdapter

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.