Package edu.pitt.ontology

Examples of edu.pitt.ontology.ILogicExpression


  /**
   * 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


    if(val instanceof Integer )
      return df.getOWLLiteral((Integer) val);
    if(val instanceof Boolean )
      return df.getOWLLiteral((Boolean) val);
    if(val instanceof ILogicExpression){
      ILogicExpression exp = (ILogicExpression) val;
      if(exp.isEmpty())
        return null;
      Object obj = convertOntologyObject(exp.get(0));
      switch(exp.getExpressionType()){
      case ILogicExpression.EMPTY:
        return obj;
      case ILogicExpression.NOT:
        if(obj instanceof OWLLiteral)
          return df.getOWLDataComplementOf(((OWLLiteral)obj).getDatatype());
View Full Code Here

    Object [] values = inst.getPropertyValues(prop);
    if(values == null || values.length == 0)
      return false;
   
    // if any of values fits, that we are good
    ILogicExpression exp = getParameter();
    for(int i=0;i<values.length;i++){
      if(exp.evaluate(values[i])){
        return true;
      }
    }
    return false;
  }
View Full Code Here

   
    if(value instanceof PResource){
      return ((PResource)value).getResource();
    }else if(value instanceof ILogicExpression){ 
      OWLModel model = resource.getOWLModel();
      ILogicExpression exp = (ILogicExpression) value;
      Object obj = null;
      if(exp.isSingleton()){
        if(exp.getExpressionType() == ILogicExpression.NOT){
          try{
            obj = model.createOWLComplementClass(
                (RDFSClass)convertSetValue(exp.getOperand()));
          }catch(ClassCastException ex){
            throw new IOntologyError("Cannot complement "+exp.getOperand()+", because it is not a class",ex);
          }
        }else
          obj =  convertSetValue(exp.getOperand());
      }else if(exp.getExpressionType() == ILogicExpression.AND){
        OWLIntersectionClass ac = model.createOWLIntersectionClass();
        for(Object o: exp){
          ac.addOperand((RDFSClass)convertSetValue(o));
        }
        obj = ac;
      }else if(exp.getExpressionType() == ILogicExpression.OR){
        OWLUnionClass oc = model.createOWLUnionClass();
        for(Object o: exp){
          oc.addOperand((RDFSClass)convertSetValue(o));
        }
        obj = oc;
View Full Code Here

    Object [] values = inst.getPropertyValues(prop);
    if(values == null || values.length == 0)
      return false;
   
    // if any of values fits, that we are good
    ILogicExpression exp = getParameter();
    for(int i=0;i<values.length;i++){
      if(exp.evaluate(values[i])){
        return true;
      }
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of edu.pitt.ontology.ILogicExpression

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.