/**
   * Initiates the dereferencing process of some of the URIs identified in the dataset, chosen in
   * accordance with a statistical sampling method, in order to compute the estimated
   * dereferenceability of the whole dataset
   *
   * @return estimated dereferencibility, computed as aforementioned
   */
  @Override
  public double metricValue() {

    if (!this.metricCalculated) {
      uriSet.addAll(this.fqurisReservoir.getItems());
      double uriSize = (double) uriSet.size();

      // Process
      this.httpRetreiver.addListOfResourceToQueue(this.fqurisReservoir.getItems());
      this.httpRetreiver.start(true);

      do {
        this.checkForForwardLinking();
        uriSet.clear();
        uriSet.addAll(this.notFetchedQueue);
        this.notFetchedQueue.clear();
      } while (!this.uriSet.isEmpty());

      this.metricCalculated = true;
      httpRetreiver.stop();
      // End Process

      metricValue = (totalDerefDataWithSub == 0.0) ? 0.0 : (double) totalDerefDataWithSub / uriSize;

      statsLogger.info(
          "Estimated Dereferencable Forward Links Metric: Dataset: {} - Total # Forward Links URIs {}; Total URIs : {}",
          EnvironmentProperties.getInstance().getDatasetURI(),
          totalDerefDataWithSub,
          uriSize);
    }

    return this.metricValue;
  }
Ejemplo n.º 2
0
  @Override
  public double metricValue() {
    double noDocs = this.docs.size();
    double noDocsWithoutEndorcement = 0.0;

    for (DigitalSignature ds : this.docs.values())
      noDocsWithoutEndorcement += (ds.fullEndorcement()) ? 1 : 0;

    statsLogger.info(
        "DigitalSignatureUsage. Dataset: {} - Total # Documents : {}; # Documents without Endorcement : {};",
        EnvironmentProperties.getInstance().getDatasetURI(),
        noDocs,
        noDocsWithoutEndorcement);

    return (noDocsWithoutEndorcement / noDocs);
  }