Package edu.pitt.ontology

Examples of edu.pitt.ontology.IInstance


   * create it
   * @param name
   * @return
   */
  public static IInstance getInstance(IClass cls, String name){
    IInstance inst = cls.getOntology().getInstance(name);
    if(inst == null)
      inst = cls.createInstance(name);
    return inst;
  }
View Full Code Here


        }
      }
           
      // copy instances
      for(IInstance inst: source.getDirectInstances()){
        IInstance i = ont.getInstance(inst.getName());
        if(i == null){
          i = cls.createInstance(inst.getName());
          // copy property values
          for(IProperty sp : inst.getProperties()){
            IProperty tp = (IProperty) convertResource(ont,sp);
            if(tp != null){
              if(tp.isFunctional())
                i.setPropertyValue(tp,convertResource(ont,inst.getPropertyValue(sp)));
              else
                i.setPropertyValues(tp,convertResources(ont,inst.getPropertyValues(sp)));
            }
          }
        }
      }
     
View Full Code Here

      }else if(e instanceof IProperty){
        IProperty cls = (IProperty) e;
        buffer.append("<b>Domain: </b> "+Arrays.asList(cls.getDomain())+"<br>");
        buffer.append("<b>Range: </b> "+Arrays.asList(cls.getRange())+"<br>");
      }else if(e instanceof IInstance){
        IInstance cls = (IInstance) e;
        buffer.append("<b>Types: </b> "+Arrays.asList(cls.getTypes())+"<br>");
      }
      buffer.append("<b>Properties:</b>");
      IProperty[] p = e.getProperties();
      if(p.length > 0){
        buffer.append("<ul>");
View Full Code Here

      buffer.append("<tr valign=top><td><b>Domain: </b></td><td>"+
          toHTML(cls.getDomain())+"</td></tr>");
      buffer.append("<tr valign=top><td><b>Range: </b></td><td>"+
          toHTML(cls.getRange())+"</td></tr>");
    }else if(e instanceof IInstance){
      IInstance cls = (IInstance) e;
      buffer.append("<tr valign=top><td><b>Types: </b></td><td>"+
          toHTML(cls.getDirectTypes())+"</td></tr>");
    }
   
    IProperty[] p = e.getProperties();
    if(p.length > 0){
      buffer.append("<tr valign=top><td><b>Properties:</b>");
View Full Code Here

  public boolean evaluate(Object obj) {
    if(obj instanceof IClass){
      IClass c2 = (IClass) obj;
      return equals(c2) || hasSubClass(c2);
    }else if(obj instanceof IInstance){
      IInstance i2 = (IInstance) obj;
      return i2.hasType(this);
    }
    return false;
  }
View Full Code Here

   * is this restriction satisfied for the owner of this restriction
   * @param this could be a IClass, IInstance, IReousrceList or java object
   */
  public boolean evaluate(Object obj){
    if(obj instanceof IInstance){
      IInstance inst = (IInstance) obj;
      // see if this instance has a value that fits this restriction
      IProperty prop = getProperty();
     
      // is property satisfied
      boolean satisfied = isPropertySatisfied(prop, inst);
View Full Code Here

   * is this restriction satisfied for the owner of this restriction
   * @param this could be a IClass, IInstance, IReousrceList or java object
   */
  public boolean evaluate(Object obj){
    if(obj instanceof IInstance){
      IInstance inst = (IInstance) obj;
      // see if this instance has a value that fits this restriction
      IProperty prop = getProperty();
     
      // is property satisfied
      boolean satisfied = isPropertySatisfied(prop, inst);
View Full Code Here

TOP

Related Classes of edu.pitt.ontology.IInstance

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.