Package edu.stanford.smi.protegex.owl.model

Examples of edu.stanford.smi.protegex.owl.model.OWLIntersectionClass


    if(cls instanceof OWLNamedClass){
      // see if there are already necessary and sufficient restrictions
      OWLAnonymousClass [] eq = getEquivalentRestrictionClasses();
      // if there aren't any add this restriction as equivalence class
      if(eq == null || eq.length == 0){
        OWLIntersectionClass ic = cls.getOWLModel().createOWLIntersectionClass();
        ic.addOperand(getResource(res));
        ((OWLNamedClass)cls).addEquivalentClass(ic);
      // if there are some, make a union of them
      }else {
        // try to find intersection class and add to it
        for(int i=0;i<eq.length;i++){
          if(eq[i] instanceof OWLIntersectionClass){
            ((OWLIntersectionClass)eq[i]).addOperand(getResource(res));
            return;
          }
        }
        // if we cant find intersection, lets make an intersection with
        // existing restrictions
        OWLIntersectionClass in = cls.getOWLModel().createOWLIntersectionClass();
        for(int i=0;i<eq.length;i++){
          in.addOperand(eq[i].createClone());
          ((OWLNamedClass)cls).removeEquivalentClass(eq[i]);
        }
        in.addOperand(getResource(res));
        ((OWLNamedClass)cls).addEquivalentClass(in);
      }
    }
  }
View Full Code Here


            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){
View Full Code Here

    if(cls instanceof OWLNamedClass){
      // see if there are already necessary and sufficient restrictions
      OWLAnonymousClass [] eq = getEquivalentRestrictionClasses();
      // if there aren't any add this restriction as equivalence class
      if(eq == null || eq.length == 0){
        OWLIntersectionClass ic = cls.getOWLModel().createOWLIntersectionClass();
        ic.addOperand(getResource(res));
        ((OWLNamedClass)cls).addEquivalentClass(ic);
      // if there are some, make a union of them
      }else {
        // try to find intersection class and add to it
        for(int i=0;i<eq.length;i++){
          if(eq[i] instanceof OWLIntersectionClass){
            ((OWLIntersectionClass)eq[i]).addOperand(getResource(res));
            return;
          }
        }
        // if we cant find intersection, lets make an intersection with
        // existing restrictions
        OWLIntersectionClass in = cls.getOWLModel().createOWLIntersectionClass();
        for(int i=0;i<eq.length;i++){
          in.addOperand(eq[i].createClone());
          ((OWLNamedClass)cls).removeEquivalentClass(eq[i]);
        }
        in.addOperand(getResource(res));
        ((OWLNamedClass)cls).addEquivalentClass(in);
      }
    }
  }
View Full Code Here

            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){
View Full Code Here

TOP

Related Classes of edu.stanford.smi.protegex.owl.model.OWLIntersectionClass

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.