private <T extends OWLEntity> void addResults(
     Map<String, List<String>> map, Class<T> cls, Collection<T> matches, ShortFormProvider sfp) {
   List<String> names = new ArrayList<String>();
   for (T match : matches) {
     String name = sfp.getShortForm(match);
     if (name.indexOf(" ") > -1) {
       name = "\"" + name + "\"";
     }
     names.add(name);
   }
   map.put(cls.getSimpleName(), names);
 }
 private void printEntities(String name, Set<? extends OWLEntity> entities, StringBuilder sb) {
   sb.append(name);
   int length = 50 - name.length();
   for (int i = 0; i < length; i++) {
     sb.append(".");
   }
   sb.append("\\n\\n");
   if (!entities.isEmpty()) {
     for (OWLEntity entity : entities) {
       sb.append("\\t").append(shortFormProvider.getShortForm(entity)).append("\\n");
     }
   } else {
     sb.append("\\t[NONE]\\n");
   }
   sb.append("\\n");
 }
Esempio n. 3
0
 @Override
 public void visit(OWLObjectProperty entity) {
   write(escapeName(shortFormProvider.getShortForm(entity)));
 }
Esempio n. 4
0
 @Override
 public void visit(OWLNamedIndividual entity) {
   write(escapeName(shortFormProvider.getShortForm(entity)));
 }
Esempio n. 5
0
 @Override
 public void visit(OWLClass node) {
   write(escapeName(shortFormProvider.getShortForm(node)));
 }