Examples of IProperty


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

    return true;
  }
 
  public String getDescription() {
    String dsc = "";
    IProperty p = getProperty(IProperty.DC_DESCRIPTION);
    if(p != null)
      dsc = ""+getPropertyValue(p);
    if(dsc.length() == 0)
      dsc = super.getDescription();
    return dsc;
View Full Code Here

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

   
    // not lets do NCI Thesaurus specifics
    IOntology ont = cls.getOntology();
   
    // do codes
    IProperty code_p = ont.getProperty("FMAID");
    if(code_p != null){
      Object [] val = cls.getPropertyValues(code_p);
      if(val.length > 0){
        addCode(val[0].toString(),new Source("FMA"));
        setCode(val[0].toString());
      }
    }
    IProperty umls_p = ont.getProperty("UMLS_ID");
    if(umls_p != null){
      Object [] val = cls.getPropertyValues(umls_p);
      if(val.length > 0)
        addCode(val[0].toString(),new Source("UMLS"));
    }
   
    // do definitions
    List<Definition> deflist = new ArrayList<Definition>();
    IProperty def_p = ont.getProperty("definition");
    if(def_p != null){
      for(Object val : cls.getPropertyValues(def_p)){
        Definition d = new Definition(val.toString());
        deflist.add(d);
      }
View Full Code Here

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

    pcs.firePropertyChange(ONTOLOGY_LOAD_STAGE,null,ONTOLOGY_LOAD_STAGE_BUILDHIERARCHY);
    pcs.firePropertyChange(ONTOLOGY_LOADING_EVENT,null,"Creating Hierarchy ...");
   
   
    // create some important properties
    IProperty partOf = target.getProperty(PART_OF);
    if(partOf == null){
      partOf = target.createProperty(PART_OF,IProperty.OBJECT);
      partOf.setDomain(new IClass [] {target.getRoot()});
      partOf.setRange(new IClass [] {target.getRoot()});
    }
   
    IProperty hasPart = target.getProperty(HAS_PART);
    if(hasPart == null){
      hasPart = target.createProperty(HAS_PART,IProperty.OBJECT);
      hasPart.setDomain(new IClass [] {target.getRoot()});
      hasPart.setRange(new IClass [] {target.getRoot()});
    }
    // make them inverses of eachother
    hasPart.setInverseProperty(partOf);
    partOf.setInverseProperty(hasPart);
   
    // now that we have all classes, build a tree, since classes only have the superclasses set
    IResourceIterator it = target.getAllClasses();
    while(it.hasNext()){
      IClass cls = (IClass) it.next();
     
      long time = System.currentTimeMillis();
     
      // now copy equivalent classes classes
      IProperty p = target.getProperty(EQUIVALENT_CLASS);
      if(p != null){
        for(IClass sibling: getClassList(target,cls.getPropertyValues(p))){
          cls.addEquivalentClass(sibling);
        }
        // remove temporary property
View Full Code Here

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

        // do not dispose of content
      }
    }else{
     
      // create some important properties
      IProperty partOf = target.getProperty(PART_OF);
      if(partOf == null){
        partOf = target.createProperty(PART_OF,IProperty.OBJECT);
        partOf.setDomain(new IClass [] {target.getRoot()});
        partOf.setRange(new IClass [] {target.getRoot()});
      }
     
      IProperty hasPart = target.getProperty(HAS_PART);
      if(hasPart == null){
        hasPart = target.createProperty(HAS_PART,IProperty.OBJECT);
        hasPart.setDomain(new IClass [] {target.getRoot()});
        hasPart.setRange(new IClass [] {target.getRoot()});
      }
      // make them inverses of eachother
      hasPart.setInverseProperty(partOf);
      partOf.setInverseProperty(hasPart);
     
     
      // if we have last processed page
      int lastPageCount = 0;
View Full Code Here

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

      for(IProperty sp : src.getProperties()){
        // skip PartOf, and has_PART
        if(HAS_PART.equals(sp.getName()) || PART_OF.equals(sp.getName()))
          continue;
       
        IProperty dp = target.getProperty(sp.getName());
       
        // create unknown property for the first time
        if(dp == null && !target.hasResource(sp.getName())){
          dp = target.createProperty(sp.getName(),IProperty.ANNOTATION_DATATYPE);
          dp.setRange(new String [0]);
        }
       
        // copy string values
        dst.setPropertyValues(dp,src.getPropertyValues(sp));
       
View Full Code Here

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

    for(IProperty sp : src.getProperties()){
      // skip PartOf, and has_PART
      if(HAS_PART.equals(sp.getName()) || PART_OF.equals(sp.getName()))
        continue;
   
      IProperty dp = target.getProperty(sp.getName());
     
      // create unknown property for the first time
      if(dp == null && !target.hasResource(sp.getName())){
        dp = target.createProperty(sp.getName(),IProperty.ANNOTATION_DATATYPE);
        dp.setRange(new String [0]);
      }
     
      // copy string values if not there
      dst.setPropertyValues(dp,src.getPropertyValues(sp));
    }
View Full Code Here

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

   * @param dst
   * @param relation
   */
  private void copyClassRelations(BClass src, IClass dst, String relation){
    // get or create temp property
    IProperty dp = dst.getOntology().getProperty(relation);
    if(dp == null){
      dp = dst.getOntology().createProperty(relation,IProperty.ANNOTATION_DATATYPE);
      dp.setRange(new String [0]);
    }
   
    // remove prefix
    if(relation.startsWith("annotation_")){
      relation = relation.substring("annotation_".length());
View Full Code Here

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

   
    // not lets do NCI Thesaurus specifics
    IOntology ont = cls.getOntology();
   
    // do code
    IProperty code_p = ont.getProperty(BioPortalHelper.CODE);
    if(code_p != null){
      for(Object val : cls.getPropertyValues(code_p)){
        addCode(val.toString(),new Source(val.toString()));
      }
    }
   
    // do sem type
    IProperty sem_p = ont.getProperty(BioPortalHelper.SEMANTIC_TYPE);
    if(sem_p != null){
      Object [] val = cls.getPropertyValues(sem_p);
      SemanticType [] types = new SemanticType [val.length];
      for(int i=0;i<val.length;i++){
        types[i] = SemanticType.getSemanticType(val[i].toString());
View Full Code Here

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

        addAxiom(getOWLDataFactory().getOWLDataPropertyRangeAxiom(asOWLDataProperty(),((OWLLiteral)convertOntologyObject(o)).getDatatype()));
    }
  }

  public boolean isInverseOf(IProperty p) {
    IProperty i = getInverseProperty();
    return (i != null)?i.equals(p):false;
  }
View Full Code Here

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

   */
  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);
     
      // check if there is evidence to contradict inverse property
      // then the instance becomes inconsistent again
      if(satisfied && isPropertySatisfied(prop.getInverseProperty(), inst)){
        satisfied = false;
      }
      return satisfied;
    }else{
      return super.evaluate(obj);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.