예제 #1
0
  /** setup fact++ reasoner */
  protected void setupReasoner() {
    // run reasoner

    try {
      reasoner = new Reasoner(manager);
    } catch (Exception e) {
      e.printStackTrace(); // To change body of catch statement use File | Settings | File
      // Templates.
    }
    try {
      if (reasoner != null) {
        reasoner.loadOntologies(manager.getOntologies());
        reasoner.classify();
      }
    } catch (final OWLReasonerException e) {
      Runnable runnable =
          new Runnable() {
            public void run() {
              JOptionPane.showMessageDialog(
                  null,
                  "A reasoner error has ocurred.\n" + "[" + e.getMessage() + "]",
                  "Reasoner Error",
                  JOptionPane.ERROR_MESSAGE);
            }
          };
    }
    ;
  }
예제 #2
0
 /**
  * @param entity
  * @return
  */
 public String render(OWLEntity entity) {
   for (OWLOntology ont : manager.getOntologies()) {
     for (OWLAnnotation annot : entity.getAnnotations(ont)) {
       if (annot.getAnnotationURI().equals(OWLRDFVocabulary.RDFS_LABEL.getURI())) {
         if (annot instanceof OWLConstantAnnotation) {
           return ((OWLConstantAnnotation) annot).getAnnotationValue().getLiteral();
         }
       }
     }
   }
   return entity.getURI().getFragment();
 }