Examples of OntoSpreadCompositeRestriction


Examples of org.ontospread.restrictions.OntoSpreadCompositeRestriction

import org.ontospread.state.OntoSpreadState;

public class OntoSpreadBooleanRestrictionVisitorTest extends TestCase {

  public void testVisitOntoSpreadCompositeRestriction() {
    OntoSpreadCompositeRestriction restrictions = new OntoSpreadCompositeRestriction();
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinConcepts(2));
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMaxConcepts(10));   
    OntoSpreadState state = new OntoSpreadState();
    OntoSpreadBooleanRestrictionVisitor visitor = new OntoSpreadBooleanRestrictionVisitor();
    visitor.setOntoSpreadState(state);
    Object stop = visitor.visit(restrictions);
    assertEquals(stop.getClass(),Boolean.class);
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadCompositeRestriction

public class OntoSpreadStrategyVisitorPairTest extends TestCase {

  public void testApplyStopStrategy() {
    //Restrictions
    OntoSpreadCompositeRestriction restrictions = new OntoSpreadCompositeRestriction();
    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());
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadCompositeRestriction

   
  }
 
  public void testApplySelectConceptStrategy() {
    //Restrictions
    OntoSpreadCompositeRestriction restrictions = new OntoSpreadCompositeRestriction();
    restrictions.getRestrictions().add(new OntoSpreadRestrictionMinActivationValue(10.0));
    //State   
    OntoSpreadState state = new OntoSpreadState();
   
   
    ConceptTO conceptTO = new ConceptTO("http://uri.to.test");
View Full Code Here

Examples of org.ontospread.restrictions.OntoSpreadCompositeRestriction

public class OntoSpreadTestUtils {

  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.restrictions.OntoSpreadCompositeRestriction

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

  public static OntoSpreadStrategyVisitorPair createStopStrategy(int min, int max, 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
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.