gov.nasa.pds.citool.ri.StatementFinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of catalog Show documentation
Show all versions of catalog Show documentation
The Catalog Tool provides functionality for ingesting PDS3 catalog files into the the PDS4 infrastructure including the Registry and Storage Services.
// Copyright 2009, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government sponsorship acknowledged.
// Any commercial use must be negotiated with the Office of Technology Transfer
// at the California Institute of Technology.
//
// This software is subject to U. S. export control laws and regulations
// (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
// is subject to U.S. export control laws and regulations, the recipient has
// the responsibility to obtain export licenses or other export authority as
// may be required before exporting such information to foreign countries or
// providing access to foreign nationals.
//
// $Id$
package gov.nasa.pds.citool.ri;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import gov.nasa.pds.tools.label.AttributeStatement;
import gov.nasa.pds.tools.label.GroupStatement;
import gov.nasa.pds.tools.label.Label;
import gov.nasa.pds.tools.label.ObjectStatement;
import gov.nasa.pds.tools.label.Statement;
/**
* Class that finds statements in a PDS label that matches a user supplied
* list of keywords.
*
* @author mcayanan
*
*/
public class StatementFinder {
/**
* Recursively searches down a PDS label to find attributes that matches
* a user supplied keyword.
*
* @param label A PDS label file.
* @param identifier An identifier to search for in the labels.
*
* @return A list of attributes that match the supplied identifier.
*/
public static List getStatementsRecursively(Label label, String identifier) {
List identifiers = new ArrayList();
List statements = new ArrayList();
identifiers.add(identifier);
Map> results = getStatementsRecursively(label, identifiers);
List list = results.get(identifier);
if(list != null)
statements.addAll(list);
return statements;
}
/**
* Recursively searches down a PDS label to find attributes that match
* a user supplied list of keywords.
*
* @param labels A list of PDS label files.
* @param identifier An identifier to search for in the labels.
*
* @return A list of attributes that match the supplied identifier.
*/
public static List getStatementsRecursively(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy