Package edu.pitt.dbmi.nlp.noble.ontology

Examples of edu.pitt.dbmi.nlp.noble.ontology.LogicExpression


   * @param obj if Array or Collection, fill multiple params
   * @return
   */
  public ILogicExpression createLogicExpression(int type, Object param){
    if(param instanceof Collection)
      return new LogicExpression(type,(Collection) param);
    else if(param instanceof Object [])
      return new LogicExpression(type,(Object []) param);
    else
      return new LogicExpression(type,param);
  }
View Full Code Here


   * @param type
   * @param obj if Array or Collection, fill multiple params
   * @return
   */
  public ILogicExpression createLogicExpression(){
    return new LogicExpression(ILogicExpression.EMPTY);
  }
View Full Code Here

   * usually this is an empty expression with this as its parameter
   * if resource is LogicClass, then it might do something interesting
   * @return
   */
  public ILogicExpression getLogicExpression(){
    return new LogicExpression(this);
  }
View Full Code Here

      int  r = ((OWLCardinalityBase) rest).getCardinality();
      obj = new Integer(r);
    }
    if(obj instanceof ILogicExpression)
      return (ILogicExpression) obj;
    return new LogicExpression(obj);
  }
View Full Code Here

  /**
   * get necessary restrictions
   */
  public ILogicExpression getNecessaryRestrictions() {
    ILogicExpression exp = new LogicExpression(ILogicExpression.AND);
    for(Object o: getDirectNecessaryRestrictions())
      exp.add(o);
    for(IClass parent: getSuperClasses()){
      for(Object o: parent.getDirectNecessaryRestrictions())
        exp.add(o);
    }
    return exp;
  }
View Full Code Here

   * @param dpatterns
   * @return
   */
  public static ILogicExpression getMatchingPatterns(IClass dx, IInstance inst){
    // check for multi-pattern
    ILogicExpression result = new LogicExpression(ILogicExpression.OR);
    ILogicExpression exp = dx.getEquivalentRestrictions();
    if(exp.getExpressionType() == ILogicExpression.OR){
      for(int i=0;i<exp.size();i++){
        if(exp.get(i) instanceof ILogicExpression){
          ILogicExpression e = (ILogicExpression) exp.get(i);
          // if this pattern matches
          if(e.evaluate(inst)){
            result.add(exp.get(i));
          }
        }
      }
    }
    return result;
View Full Code Here

  public IClass[] getEquivalentClasses() {
    return getClassList(EQUIVALENT_CLASS).toArray(new IClass [0]);
  }

  public ILogicExpression getEquivalentRestrictions() {
    return new LogicExpression(ILogicExpression.EMPTY);
  }
View Full Code Here

    // TODO Auto-generated method stub
    return new IInstance [0];
  }

  public ILogicExpression getNecessaryRestrictions() {
    return new LogicExpression(ILogicExpression.EMPTY);
  }
View Full Code Here

TOP

Related Classes of edu.pitt.dbmi.nlp.noble.ontology.LogicExpression

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.