Examples of OWLNamedClass


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

  }


  public JComponent getPageContent(RDFResource instance) {
    if(instance instanceof OWLNamedClass) {
      OWLNamedClass cls = (OWLNamedClass) instance;
      return createConditionsTableComponent(cls);
    }
    else {
      return new JPanel();
    }
View Full Code Here

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

  protected Collection getAppropriateChildren(OWLNamedClass owlNamedClass) {
    ArrayList list = new ArrayList(owlNamedClass.getNamedSubclasses());
    for(Iterator it = list.iterator(); it.hasNext();) {
      Object curObj = it.next();
      if(curObj instanceof OWLNamedClass) {
        OWLNamedClass curCls = (OWLNamedClass) curObj;
        if(curCls.isMetaclass() || curCls.isVisible() == false) {
          it.remove();
        }
      }
      else {
        it.remove();
View Full Code Here

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

      RDFIndividual individualOne;
      RDFIndividual individualTwo;
      OWLObjectProperty objectProperty;

      OWLNamedClass domainResidentNodePr = this.getOwlModel().getOWLNamedClass(DOMAIN_RESIDENT);
      Collection instances = domainResidentNodePr.getInstances(true);
      MFrag mFragOfNode = null;

      for (Iterator it = instances.iterator(); it.hasNext();) {

        individualOne = (RDFIndividual) it.next();
View Full Code Here

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

      InputNode generativeInputNode;
      BuiltInRV builtInRV;

      RDFIndividual individualOne;
      RDFIndividual individualTwo;
      OWLNamedClass owlNamedClass;
      OWLObjectProperty objectProperty;

      owlNamedClass = getOwlModel().getOWLNamedClass(DOMAIN_MFRAG);
      Collection instances = owlNamedClass.getInstances(false);

      for (Iterator it = instances.iterator(); it.hasNext();) {
        individualOne = (RDFIndividual) it.next();
        domainMFrag = getMapDomainMFrag().get(individualOne.getBrowserText());
        if (domainMFrag == null) {
View Full Code Here

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

     * (non-Javadoc)
     * @see unbbayes.io.mebn.SaverPrOwlIO#saveMTheory()
     */
    protected void saveMTheory(){

        OWLNamedClass mTheoryClass = getOwlModel().getOWLNamedClass(MTHEORY);
        // check if individual exists
        OWLIndividual mTheoryIndividual = getOwlModel().getOWLIndividual(getMebn().getName());
        if (mTheoryIndividual == null) {
          // if this individual is new, create it
          mTheoryIndividual = mTheoryClass.createOWLIndividual(getMebn().getName());
        }
        Debug.println("MTheory = " + getMebn().getName());
       
        if(getMebn().getDescription() != null){
          mTheoryIndividual.addComment(getMebn().getDescription());
        }
       
        /* hasMFrag */
       
        OWLObjectProperty hasMFragProperty = (OWLObjectProperty)getOwlModel().getOWLObjectProperty("hasMFrag");  
        List<MFrag> listDomainMFrag = getMebn().getDomainMFragList();
       
        for(MFrag domainMFrag: listDomainMFrag){
          OWLNamedClass domainMFragClass = getOwlModel().getOWLNamedClass(DOMAIN_MFRAG);
          Debug.println("Domain_MFrag = " + domainMFrag.getName());
          // check if individual exists.
          OWLIndividual domainMFragIndividual = getOwlModel().getOWLIndividual(this.MFRAG_NAME_PREFIX + domainMFrag.getName());
          if (domainMFragIndividual == null) {
            // if new, create it
            domainMFragIndividual = domainMFragClass.createOWLIndividual(this.MFRAG_NAME_PREFIX + domainMFrag.getName());
          }
          getMapMFrag().put(domainMFrag, domainMFragIndividual);
          mTheoryIndividual.addPropertyValue(hasMFragProperty, domainMFragIndividual);
         
          if(domainMFrag.getDescription()!=null){
            domainMFragIndividual.addComment(domainMFrag.getDescription());
          }
         
          /* hasResidentNode */
          OWLObjectProperty hasResidentNodeProperty = (OWLObjectProperty)getOwlModel().getOWLObjectProperty("hasResidentNode");  
         
          for(Node node: domainMFrag.getNodeList()){
            if (node instanceof ResidentNode) {
              ResidentNode residentNode = (ResidentNode) node;
             
              Debug.println("Domain_Res = " + residentNode.getName())
              // check if individual exists
              OWLIndividual domainResIndividual = getOwlModel().getOWLIndividual(this.RESIDENT_NAME_PREFIX + residentNode.getName());
              if (domainResIndividual == null) {
                // if new, create it
                OWLNamedClass domainResClass = null;
                if (residentNode instanceof ContinuousResidentNode) {
                  // get owl class for continuous nodes
                  domainResClass = getOwlModel().getOWLNamedClass(CONTINUOUS_RESIDENT_NODE);
                  if (domainResClass == null) {
                    // if CONTINUOUS_RESIDENT_NODE does not exist, create it
                    domainResClass = getOwlModel().createOWLNamedSubclass(CONTINUOUS_RESIDENT_NODE, getOwlModel().getOWLNamedClass(DOMAIN_RESIDENT));
                  }
                } else {
                  // get owl class for resident nodes
                  domainResClass = getOwlModel().getOWLNamedClass(DOMAIN_RESIDENT);
                }
               
                domainResIndividual = domainResClass.createOWLIndividual(this.RESIDENT_NAME_PREFIX + residentNode.getName());
              }
              domainMFragIndividual.addPropertyValue(hasResidentNodeProperty, domainResIndividual);  
              getMapDomainResident().put(residentNode, domainResIndividual);
            }
           
          } 
         
          /* hasInputNode */
          OWLObjectProperty hasInputNodeProperty = (OWLObjectProperty)getOwlModel().getOWLObjectProperty("hasInputNode");  
          OWLNamedClass generativeInputClass = getOwlModel().getOWLNamedClass(GENERATIVE_INPUT);
          for(InputNode inputNode: domainMFrag.getInputNodeList()){
            Debug.println("Generative_input = " + inputNode.getName());
            // check if individuals exists
            OWLIndividual generativeInputIndividual = getOwlModel().getOWLIndividual(inputNode.getName());
            if (generativeInputIndividual == null) {
              // if new, create it
              generativeInputIndividual = generativeInputClass.createOWLIndividual(inputNode.getName());
            }
            domainMFragIndividual.addPropertyValue(hasInputNodeProperty, generativeInputIndividual);    
            getMapGenerativeInput().put(inputNode, generativeInputIndividual);    
          }       
         
          /* hasContextNode */
          OWLObjectProperty hasContextNodeProperty = (OWLObjectProperty)getOwlModel().getOWLObjectProperty("hasContextNode");  
          OWLNamedClass contextClass = getOwlModel().getOWLNamedClass(CONTEXT_NODE);
          for(ContextNode contextNode: domainMFrag.getContextNodeList()){
            // check if individuals exist
            OWLIndividual contextIndividual = getOwlModel().getOWLIndividual(contextNode.getName());
            if (contextIndividual == null) {
              // if new, create it
              contextIndividual = contextClass.createOWLIndividual(contextNode.getName());
            }
            domainMFragIndividual.addPropertyValue(hasContextNodeProperty, contextIndividual);                  
            getMapContext().put(contextNode, contextIndividual);  
          }       
         
          /* hasOVariable */
          OWLObjectProperty hasOVariableProperty = (OWLObjectProperty)getOwlModel().getOWLObjectProperty("hasOVariable");  
            OWLNamedClass oVariableClass = getOwlModel().getOWLNamedClass(ORDINARY_VARIABLE);
          OWLObjectProperty isSubsByProperty = (OWLObjectProperty)getOwlModel().getOWLObjectProperty("isSubsBy");  
         
          for(OrdinaryVariable oVariable: domainMFrag.getOrdinaryVariableList()){
            // Set variable name as "MFragName.OVName"
            OWLIndividual oVariableIndividual = getOwlModel().getOWLIndividual(
                  oVariable.getMFrag().getName() + SCOPE_SEPARATOR
                  + oVariable.getName() );
            if (oVariableIndividual == null) {
              oVariableIndividual = oVariableClass.createOWLIndividual(
                      oVariable.getMFrag().getName() + SCOPE_SEPARATOR
                    + oVariable.getName() );
            }
            domainMFragIndividual.addPropertyValue(hasOVariableProperty, oVariableIndividual);    
           
View Full Code Here

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

      reasoner.classifyTaxonomy();
      List<IResult> result = new ArrayList<IResult>();
     
      // NOTE: copy/pasted from Protege code ChangedClassesTableModel.java
      for(Object o: ontology.getModel().getChangedInferredClasses()){
        OWLNamedClass c = (OWLNamedClass) o;
        result.addAll(computeResults(c,c.getInferredSuperclasses(),IResult.SUPERCLASS));
      }
      return result.toArray(new IResult[0]);
    }catch(ProtegeReasonerException ex){
      throw new IOntologyError("Reasoner Problem",ex);
    }
View Full Code Here

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

  public IResult [] computeInferredTypes() {
    try{
      reasoner.computeInferredIndividualTypes();
      // NOTE: copy/pasted from Protege code ChangedClassesTableModel.java
      for(Object o: ontology.getModel().getChangedInferredClasses()){
        OWLNamedClass cls = (OWLNamedClass) o;
        System.out.println("inferred types: "+cls);
      }
    }catch(ProtegeReasonerException ex){
      throw new IOntologyError("Reasoner Problem",ex);
    }
View Full Code Here

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

   * its inferred super classes and its inferred equivalent classes.
   * Assert the result
   */
  public IResult [] computeInferredHierarchy(IClass cls){
    try{
      OWLNamedClass  c = (OWLNamedClass)ontology.convertSetValue(cls);
      List<IResult> result = new ArrayList<IResult>();
      result.addAll(computeResults(c,reasoner.getSuperclasses(c),IResult.SUPERCLASS));
      //result.addAll(computeResults(c,reasoner.getSubclasses(c),IResult.SUBCLASS));
      return result.toArray(new IResult[0]);
    }catch(Exception ex){
View Full Code Here

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

      reasoner.classifyTaxonomy();
      List<IResult> result = new ArrayList<IResult>();
     
      // NOTE: copy/pasted from Protege code ChangedClassesTableModel.java
      for(Object o: ontology.getModel().getChangedInferredClasses()){
        OWLNamedClass c = (OWLNamedClass) o;
        result.addAll(computeResults(c,c.getInferredSuperclasses(),IResult.SUPERCLASS));
      }
      return result.toArray(new IResult[0]);
    }catch(ProtegeReasonerException ex){
      throw new IOntologyError("Reasoner Problem",ex);
    }
View Full Code Here

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

  public IResult [] computeInferredTypes() {
    try{
      reasoner.computeInferredIndividualTypes();
      // NOTE: copy/pasted from Protege code ChangedClassesTableModel.java
      for(Object o: ontology.getModel().getChangedInferredClasses()){
        OWLNamedClass cls = (OWLNamedClass) o;
        System.out.println("inferred types: "+cls);
      }
    }catch(ProtegeReasonerException ex){
      throw new IOntologyError("Reasoner Problem",ex);
    }
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.