Examples of OntoSpreadStrategy


Examples of org.ontospread.strategy.OntoSpreadStrategy

 
  public static OntoSpreadStrategyVisitorPair createSelectStrategy(){
    //Restrictions: Strategy Select
    OntoSpreadCompositeRestriction restrictionsSelect = new OntoSpreadCompositeRestriction();
    restrictionsSelect.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(10.0));
    OntoSpreadStrategy selectStrategy = new OntoSpreadSelectConceptStrategy(restrictionsSelect);   
    return new OntoSpreadStrategyVisitorPair(selectStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

    if(min!= 0) restrictions.getRestrictions().add(new OntoSpreadRestrictionMinConcepts(min));
    if(max!= 0) restrictions.getRestrictions().add(new OntoSpreadRestrictionMaxConcepts(max))
    if(minActivation != 0)restrictions.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(minActivation));
    if(context!=null && !context.equals("") && retries!=0)restrictions.getRestrictions().add(new OntoSpreadRestrictionContext(context,retries));   
    if(time != 0) restrictions.getRestrictions().add(new OntoSpreadRestrictionNotMaxTime(time));
    OntoSpreadStrategy stopStrategy = new OntoSpreadSimpleStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(stopStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

      double minActivation){
    OntoSpreadCompositeRestriction restrictions = new OntoSpreadCompositeRestriction();
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinConcepts(min));
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMaxConcepts(max))
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(minActivation));
    OntoSpreadStrategy stopStrategy = new OntoSpreadSimpleStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(stopStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

public class OntoSpreadTestUtils {

  public static OntoSpreadStrategyVisitorPair createSelectStrategy(OntoSpreadRestriction restrictions){
    //Restrictions: Strategy Select
    OntoSpreadStrategy selectStrategy = new OntoSpreadSelectConceptStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(selectStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

    OntoSpreadStrategy selectStrategy = new OntoSpreadSelectConceptStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(selectStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }

  public static OntoSpreadStrategyVisitorPair createStopStrategy(OntoSpreadRestriction restrictions){
    OntoSpreadStrategy stopStrategy = new OntoSpreadSimpleStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(stopStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

 
  public static OntoSpreadStrategyVisitorPair createSelectStrategy(){
    //Restrictions: Strategy Select
    OntoSpreadCompositeRestriction restrictionsSelect = new OntoSpreadCompositeRestriction();
    restrictionsSelect.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(10.0));
    OntoSpreadStrategy selectStrategy = new OntoSpreadSelectConceptStrategy(restrictionsSelect);   
    return new OntoSpreadStrategyVisitorPair(selectStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

    if(min!= 0) restrictions.getRestrictions().add(new OntoSpreadRestrictionMinConcepts(min));
    if(max!= 0) restrictions.getRestrictions().add(new OntoSpreadRestrictionMaxConcepts(max))
    if(minActivation != 0)restrictions.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(minActivation));
    if(context!=null && !context.equals("") && retries!=0)restrictions.getRestrictions().add(new OntoSpreadRestrictionContext(context,retries));   
    if(time != 0) restrictions.getRestrictions().add(new OntoSpreadRestrictionNotMaxTime(time));
    OntoSpreadStrategy stopStrategy = new OntoSpreadSimpleStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(stopStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

      double minActivation){
    OntoSpreadCompositeRestriction restrictions = new OntoSpreadCompositeRestriction();
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinConcepts(min));
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMaxConcepts(max))
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(minActivation));
    OntoSpreadStrategy stopStrategy = new OntoSpreadSimpleStrategy(restrictions);   
    return new OntoSpreadStrategyVisitorPair(stopStrategy,new OntoSpreadBooleanRestrictionVisitor());   
  }
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinConcepts(2));
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMaxConcepts(10));
    //State   
    OntoSpreadState state = new OntoSpreadState();
   
    OntoSpreadStrategy strategy = new OntoSpreadSimpleStrategy(restrictions);   
    OntoSpreadStrategyVisitorPair pair = new OntoSpreadStrategyVisitorPair(strategy,new OntoSpreadBooleanRestrictionVisitor());
   
    Object continues = pair.applyStrategy(state) ;
    assertEquals(continues.getClass(),Boolean.class);
    assertTrue(((Boolean)continues).booleanValue());
View Full Code Here

Examples of org.ontospread.strategy.OntoSpreadStrategy

    ConceptTO conceptTO = new ConceptTO("http://uri.to.test");
   
    state.setConceptToSpread(conceptTO);

   
    OntoSpreadStrategy strategy = new OntoSpreadSelectConceptStrategy(restrictions);   
    OntoSpreadStrategyVisitorPair pair = new OntoSpreadStrategyVisitorPair(strategy,new OntoSpreadBooleanRestrictionVisitor());
   
    state.setCurrentScore(11.0);   
    Object select = pair.applyStrategy(state) ;
    assertEquals(select.getClass(),Boolean.class);
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.