예제 #1
0
 public static String getRendering(AxiomType axiomType) {
   String rendering = renderingMap.get(axiomType);
   if (rendering != null) {
     return rendering;
   }
   return axiomType.getName();
 }
예제 #2
0
 @Override
 protected String getObjectTypeName() {
   return axiomType.getName() + " axioms";
 }
  @Override
  public void start() {
    logger.info(
        "Started learning of "
            + axiomType.getName()
            + " axioms for "
            + OWLAPIUtils.getPrintName(entityToDescribe.getEntityType())
            + " "
            + entityToDescribe.toStringID()
            + "...");
    startTime = System.currentTimeMillis();

    currentlyBestAxioms = new TreeSet<EvaluatedAxiom<T>>();

    popularity = reasoner.getPopularity(entityToDescribe);
    if (popularity == 0) {
      logger.warn(
          "Cannot make "
              + axiomType.getName()
              + " axiom suggestions for empty "
              + OWLAPIUtils.getPrintName(entityToDescribe.getEntityType())
              + " "
              + entityToDescribe.toStringID());
      return;
    }

    if (returnOnlyNewAxioms) {
      getExistingAxioms();
    }

    if (useSampling) {
      generateSample();
    } else {
      qef = ksQef;
      reasoner = ksReasoner;
    }

    progressMonitor.learningStarted(axiomType);
    try {
      learnAxioms();
    } catch (Exception e) {
      progressMonitor.learningFailed(axiomType);
      throw e;
    } finally {
      progressMonitor.learningStopped(axiomType);
    }

    logger.info(
        "...finished learning of "
            + axiomType.getName()
            + " axioms for "
            + OWLAPIUtils.getPrintName(entityToDescribe.getEntityType())
            + " "
            + entityToDescribe.toStringID()
            + " in {}ms.",
        (System.currentTimeMillis() - startTime));
    if (this instanceof ObjectPropertyCharacteristicsAxiomLearner) {
      logger.info("Suggested axiom: " + currentlyBestAxioms.first());
    } else {
      logger.info("Found " + currentlyBestAxioms.size() + " axiom candidates.");
      if (!currentlyBestAxioms.isEmpty()) {
        logger.info("Best axiom candidate is " + currentlyBestAxioms.first());
      }
    }
  }