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

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


   * @return The <code>Nodes</code> label.
   */
  public String getLabel(Node node) {
    Object obj = node.getUserObject();
    if(obj instanceof RDFSClass) {
      RDFSClass cls = (RDFSClass) obj;
      return cls.getBrowserText();
    }
    else if(obj instanceof OWLIndividual) {
      OWLIndividual owlInstance = (OWLIndividual) obj;
      return owlInstance.getBrowserText();
    }
View Full Code Here


  /**
   * remove restriction
   */
  public void removeNecessaryRestriction(IRestriction res) {
    if(cls instanceof OWLNamedClass){
      RDFSClass r = getResource(res);
      // if this restriction is attached to more then one class
      // then try just to remove its parent status
      // else simply remove it
      if(r.getSubclassCount() > 1){
        RDFSClass clone = r.createClone();
        // re-add clone to subclasses
        for(Object c : r.getSubclasses(false)){
          if(c instanceof OWLNamedClass && !c.equals(cls)){
            ((OWLNamedClass)c).addSuperclass(clone);
          }
View Full Code Here

   */
  private OWLAnonymousClass [] getEquivalentRestrictionClasses(){
    if(cls instanceof OWLNamedClass){
      List<OWLAnonymousClass> list = new ArrayList<OWLAnonymousClass>();
      for(Object obj: ((OWLNamedClass)cls).getEquivalentClasses()){
        RDFSClass cls = (RDFSClass) obj;
        if(cls instanceof OWLAnonymousClass)
          list.add((OWLAnonymousClass)cls);
      }
      return list.toArray(new OWLAnonymousClass [0]);
    }
View Full Code Here

  public ILogicExpression getNecessaryRestrictions(){
    ILogicExpression exp = new LogicExpression(ILogicExpression.AND);
    if(cls instanceof OWLNamedClass){
      Collection list = cls.getEquivalentClasses();
      for(Object o: ((OWLNamedClass) cls).getSuperclasses(true)){
        RDFSClass c = (RDFSClass) o;
        if(c.isAnonymous() && !list.contains(c)){
          exp.add(convertParameter(c));
        }
      }
    }
    return exp;
View Full Code Here

  public ILogicExpression getDirectNecessaryRestrictions(){
    ILogicExpression exp = new LogicExpression(ILogicExpression.AND);
    if(cls instanceof OWLNamedClass){
      Collection list = cls.getEquivalentClasses();
      for(Object o: ((OWLNamedClass) cls).getSuperclasses(false)){
        RDFSClass c = (RDFSClass) o;
        if(c.isAnonymous() && !list.contains(c)){
          exp.add(convertParameter(c));
        }
      }
    }
    return exp;
View Full Code Here

        }
      }
      return exp;
    // we might have a complement
    }else if(resource instanceof OWLComplementClass){
      RDFSClass c = ((OWLComplementClass)resource).getComplement();
      return new LogicExpression(ILogicExpression.NOT,convertParameter(c));
    }
    // default just container that contains this
    return super.getLogicExpression();
  }
View Full Code Here

   */
  protected IClass [] getClasses(Collection list){
    Set<IClass> c = new LinkedHashSet<IClass>();
    for(Object o: list){
      if(o instanceof RDFSClass){
        RDFSClass cls = (RDFSClass)o;
        //System.out.println("get class "+cls.getBrowserText()+" "+cls.getClass().getName());
        if(!cls.isSystem() || cls.equals(cls.getOWLModel().getOWLThingClass())){
          c.add(new PClass(cls,getOntology()));
        }
      }
    }
    return (IClass []) c.toArray(new IClass [0]);
View Full Code Here

  /**
   * remove restriction
   */
  public void removeNecessaryRestriction(IRestriction res) {
    if(cls instanceof OWLNamedClass){
      RDFSClass r = getResource(res);
      // if this restriction is attached to more then one class
      // then try just to remove its parent status
      // else simply remove it
      if(r.getSubclassCount() > 1){
        RDFSClass clone = r.createClone();
        // re-add clone to subclasses
        for(Object c : r.getSubclasses(false)){
          if(c instanceof OWLNamedClass && !c.equals(cls)){
            ((OWLNamedClass)c).addSuperclass(clone);
          }
View Full Code Here

   */
  private OWLAnonymousClass [] getEquivalentRestrictionClasses(){
    if(cls instanceof OWLNamedClass){
      List<OWLAnonymousClass> list = new ArrayList<OWLAnonymousClass>();
      for(Object obj: ((OWLNamedClass)cls).getEquivalentClasses()){
        RDFSClass cls = (RDFSClass) obj;
        if(cls instanceof OWLAnonymousClass)
          list.add((OWLAnonymousClass)cls);
      }
      return list.toArray(new OWLAnonymousClass [0]);
    }
View Full Code Here

  public ILogicExpression getNecessaryRestrictions(){
    ILogicExpression exp = new LogicExpression(ILogicExpression.AND);
    if(cls instanceof OWLNamedClass){
      Collection list = cls.getEquivalentClasses();
      for(Object o: ((OWLNamedClass) cls).getSuperclasses(true)){
        RDFSClass c = (RDFSClass) o;
        if(c.isAnonymous() && !list.contains(c)){
          exp.add(convertParameter(c));
        }
      }
    }
    return exp;
View Full Code Here

TOP

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

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.