All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nasa.pds.citool.ri.ReferenceRIChecker Maven / Gradle / Ivy

Go to download

The Legacy Catalog Tool provides functionality for ingesting PDS3 catalog files into the PDS4 infrastructure including the Registry Service.

There is a newer version: 3.1.0
Show newest version
package gov.nasa.pds.citool.ri;

import gov.nasa.pds.citool.diff.DiffException;
import gov.nasa.pds.citool.diff.DiffRecord;
import gov.nasa.pds.citool.diff.ValueDiff;
import gov.nasa.pds.citool.util.Utility;
import gov.nasa.pds.tools.LabelParserException;
import gov.nasa.pds.tools.constants.Constants;
import gov.nasa.pds.tools.label.AttributeStatement;
import gov.nasa.pds.tools.label.Label;
import gov.nasa.pds.tools.label.ObjectStatement;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.IOUtils;

/**
 * Class to do referential integrity checking on references.
 *
 * @author mcayanan
 *
 */
public class ReferenceRIChecker extends RIChecker {
    private Map idToDescriptions;
    private List refFiles;
    private List parentIDs;
    private final String ID = "REFERENCE_KEY_ID";
    private final String DESCRIPTION = "REFERENCE_DESC";

    /**
     * Constructor
     *
     */
    public ReferenceRIChecker() {
        idToDescriptions = new HashMap();
        parentIDs = new ArrayList();
        refFiles = new ArrayList();
    }

    /**
     * Determines whether the supplied list of catalog files has referential
     * integrity when compared to the REF.CAT file.
     *
     * @param parentLabels A set of catalog files containing the REFERENCE
     * object.
     * @param childLabels A set of catalog files that do not contain the
     * REFERENCE object.
     */
    public void performCheck(List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy