Package edu.pitt.ontology

Examples of edu.pitt.ontology.IRestriction


  private Object  convertResource(IOntology ont, Object value){
    if(value == null)
      return null;
   
    if(value instanceof IRestriction){
      IRestriction r = (IRestriction) value;
      IRestriction t = ont.createRestriction(r.getRestrictionType());
      t.setProperty((IProperty)convertResource(ont,r.getProperty()));
      t.setParameter((ILogicExpression)convertResource(ont,r.getParameter()));
      return t;
    }else if(value instanceof ILogicExpression){
      ILogicExpression e = (ILogicExpression) value;
      ILogicExpression t = ont.createLogicExpression();
      t.setExpressionType(e.getExpressionType());
      for(Object o: e){
        t.add(convertResource(ont,o));
      }
      return t;
    }else if(value instanceof IProperty){
      return ont.getProperty(((IProperty) value).getName());
    }else if(value instanceof IClass){
View Full Code Here


      for(String relation: new String [] {PART_OF, HAS_PART}){
        p = target.getProperty("annotation_"+relation);
        if(p != null){
          for(IClass sibling: getClassList(target,cls.getPropertyValues(p))){
           
            IRestriction r = target.createRestriction(IRestriction.SOME_VALUES_FROM);
            r.setProperty(target.getProperty(relation));
            r.setParameter(sibling.getLogicExpression());
            cls.addNecessaryRestriction(r);
          }
          // remove temporary property
          cls.removePropertyValues(p);
        }
View Full Code Here

  public IRestriction[] getRestrictions(IProperty p) {
    List<IRestriction> list = new ArrayList<IRestriction>();
    for(List l: new List [] {getEquivalentRestrictions(),getNecessaryRestrictions()}){
      for(Object o: l){
        if(o instanceof IRestriction){
          IRestriction r = (IRestriction)o;
          if(r.getProperty().equals(p))
            list.add(r);
        }
      }
    }
    return list.toArray(new IRestriction [0]);
View Full Code Here

TOP

Related Classes of edu.pitt.ontology.IRestriction

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.