예제 #1
0
  private void ConnectKnowledgeBaseBtnMouseClicked(
      java.awt.event.MouseEvent evt) { // GEN-FIRST:event_ConnectKnowledgeBaseBtnMouseClicked

    String sPrjFile = ProjectNameTF.getText().trim();
    String sLocationURI = sURI + "Location";

    Collection errors = new ArrayList();
    Date d1 = new Date();
    long l1 = d1.getTime();
    prj = Project.loadProjectFromFile(sPrjFile, errors);
    owlModel = (OWLModel) prj.getKnowledgeBase();

    kb = prj.getKnowledgeBase();
    URI uri = prj.getActiveRootURI();

    Collection colNumberOfInstance = kb.getInstances();
    lNumberOfInstance = colNumberOfInstance.size();

    Date d2 = new Date();
    long l2 = d2.getTime();
    lLoadedTime = (l2 - l1);

    theLogger.info("Connected to MySQL in " + lLoadedTime + " ms");
    theLogger.info("KB has " + lNumberOfInstance + " instances");

    LoggingAreaTA.append("Project has " + lNumberOfInstance + " in total\n");
    LoggingAreaTA.append("Project is loaded in " + lLoadedTime + " ms\n");
  } // GEN-LAST:event_ConnectKnowledgeBaseBtnMouseClicked
예제 #2
0
 private void BriefInfoBtnMouseClicked(
     java.awt.event.MouseEvent evt) { // GEN-FIRST:event_BriefInfoBtnMouseClicked
   // TODO add your handling code here:
   Collection colNumberOfInstance = kb.getInstances();
   long lNumberOfInstance = colNumberOfInstance.size();
   LoggingAreaTA.append("Project has " + lNumberOfInstance + " in total");
   LoggingAreaTA.append("Project is loaded in " + lLoadedTime + " ms");
 } // GEN-LAST:event_BriefInfoBtnMouseClicked
예제 #3
0
  private long InstancesCount() {

    String sIname = ClassNameTF.getText().trim();
    long lNumberOfInstance = 0;
    if (sIname.length() > 0) {
      String sClassName = ClassNameTF.getText();
      try {
        Cls cls = kb.getCls(sClassName);
        Collection colInstances = kb.getInstances(cls);
        lNumberOfInstance = colInstances.size();
      } catch (Exception e) {
        theLogger.severe("Class not found");
      }

    } else {
      try {
        Collection colInstances = kb.getInstances();
        lNumberOfInstance = colInstances.size();
      } catch (Exception e) {
        theLogger.severe("Class not found");
      }
    }
    return lNumberOfInstance;
  }