コード例 #1
0
  @Override
  protected void align() throws Exception {
    super.align(); // do the schema matching part .. if any.

    if (alignInstances == true
        && (sourceOntology.getInstances() == null || targetOntology.getInstances() == null)) {
      // the source ontology or target ontology have no instances
      for (MatchingProgressListener mpd : progressDisplays) {
        mpd.appendToReport("Instances were NOT matched since they were not loaded properly.");
      }
    } else if (alignInstances && !this.isCancelled()) {
      sourceInstanceDataset = sourceOntology.getInstances();
      targetInstanceDataset = targetOntology.getInstances();

      // compile a list of source instances
      if (!sourceInstanceDataset.isIterable() && !targetInstanceDataset.isIterable()) {
        throw new AMException(
            "Neither the source or the target instance datasets are iterable.  We cannot instance match.");
      }

      if (!sourceInstanceDataset.isIterable()) {
        throw new AMException("The source MUST be an iterable instance dataset.");
      }

      Iterator<Instance> sourceInstances = sourceInstanceDataset.getInstances();

      // for every individual in the source list, look for candidate individuals in the target
      instanceAlignmentSet = alignInstances(sourceInstances);
    }
  }
コード例 #2
0
  @Override
  protected void setupProgress() {
    super.setupProgress();

    if (alignInstances) {
      try {
        InstanceDataset instances = sourceOntology.getInstances();
        if (instances != null && instances.isIterable())
          stepsTotal += sourceOntology.getInstances().size();
      } catch (Exception e) {
        sLog.error("", e);
      }
    }
  }