Skip to content

Commit

Permalink
Merge pull request #677 from NASA-PDS/issue_671
Browse files Browse the repository at this point in the history
#671: look at only bundles
  • Loading branch information
jordanpadams committed Aug 4, 2023
2 parents 7613b69 + 71043fb commit e5def06
Show file tree
Hide file tree
Showing 13 changed files with 262,043 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,16 @@ public static List<Target> findBundleWithLatestVersion(URL url, String labelExte
List<Target> children = new ArrayList<>();
try {
Crawler crawler = CrawlerFactory.newInstance(url);
List<Target> bundles = new ArrayList<>();
String extensions[] = { labelExtension };
children = crawler.crawl(url, extensions, true);

for (Target child : children) {
if (TargetExaminer.isTargetBundleType (child.getUrl(), true)) {
bundles.add (child);
}
}
children = bundles;
LOG.debug(
"findBundleWithLatestVersion:afor:reduceToLatestTargetOnly:children.size(),url {},{}",
children.size(), url);
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/features/validate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Scenario Outline: Execute validate command for tests below.
Examples:
| testName | testDir | messageCount | messageText | problemEnum | resourceDir | reportDir | commandArgs | refOutputValue |

# Validate#671
|"NASA-PDS/validate#671 Success processing of bundle" | "github671" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github671.json -s json --skip-context-validation -t {resourceDir}/github671 -R pds4.bundle" | "report_github671.json" |

# Validate#652
|"NASA-PDS/validate#652 Success processing of bundles and collections" | "github652" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github652.json -s json -t {resourceDir}/github652" | "report_github652.json" |

Expand Down
243 changes: 243 additions & 0 deletions src/test/resources/github671/bundle_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="pds4.xsl"?>
<?xml-model href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1D00.sch"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
<Product_Bundle
xmlns="http://pds.nasa.gov/pds4/pds/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://pds.nasa.gov/pds4/pds/v1
https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1D00.xsd
">
<Identification_Area>
<logical_identifier>urn:nasa:pds:cassini.rss.raw.test</logical_identifier>
<version_id>1.0</version_id>
<title>Bundle for Testing VALIDATE SNAPSHOT Anomaly</title>
<information_model_version>1.13.0.0</information_model_version>
<product_class>Product_Bundle</product_class>
<Citation_Information>
<author_list>Simpson, R. A.</author_list>
<publication_year>2023</publication_year>
<description>
This bundle contains test data for exploring an unexpected SKIP message from VALIDATE.
</description>
</Citation_Information>
<Modification_History>
<Modification_Detail>
<modification_date>2023-07-09</modification_date>
<version_id>1.0</version_id>
<description>This bundle contains test data for exploring an unexpected SKIP message from VALIDATE.</description>
</Modification_Detail>
</Modification_History>
</Identification_Area>

<Context_Area>
<Time_Coordinates>
<start_date_time>2005-05-02T00:00:00Z</start_date_time>
<stop_date_time>2017-07-19T23:59:59Z</stop_date_time>
</Time_Coordinates>

<Primary_Result_Summary>
<purpose>Science</purpose>
<processing_level>Raw</processing_level>
</Primary_Result_Summary>

<Investigation_Area>
<name>Cassini-Huygens Mission</name>
<type>Mission</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:mission.cassini-huygens</lid_reference>
<reference_type>bundle_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>

<Investigation_Area>
<name>DSN Media Calibration</name>
<type>Other Investigation</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:other_investigation.media.dsn</lid_reference>
<reference_type>bundle_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>

<Investigation_Area>
<name>Geodesy</name>
<type>Observing Campaign</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:other_investigation.geodesy</lid_reference>
<reference_type>bundle_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>

<Observing_System>
<Observing_System_Component>
<name>NASA Deep Space Network</name>
<type>Observatory</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:facility:observatory.dsn</lid_reference>
<reference_type>is_facility</reference_type>
</Internal_Reference>
</Observing_System_Component>

<Observing_System_Component>
<name>DSN Instrumentation</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:dsn.rss</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>

<Observing_System_Component>
<name>DSN Media Calibration Instrumentation</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:dsn.media</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>

<Observing_System_Component>
<name>Global Positioning System</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:dsn.media</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>

<Observing_System_Component>
<name>Cassini Orbiter</name>
<type>Spacecraft</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.co</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>

<Observing_System_Component>
<name>Cassini Orbiter Spacecraft Sensors</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:eng.co</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>


<Observing_System_Component>
<name>Spacecraft Sensors</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:eng.co</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>



<Observing_System_Component>
<name>DSN Antenna DSS 55</name>
<type>Telescope</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:telescope:madrid.dss55_34m</lid_reference>
<reference_type>is_telescope</reference_type>
</Internal_Reference>
</Observing_System_Component>



<Observing_System_Component>
<name>DSN Antenna DSS 25</name>
<type>Telescope</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:telescope:goldstone.dss25_34m</lid_reference>
<reference_type>is_telescope</reference_type>
</Internal_Reference>
</Observing_System_Component>



</Observing_System>

<Target_Identification>
<name>Earth</name>
<type>Planet</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:target:planet.earth</lid_reference>
<reference_type>bundle_to_target</reference_type>
</Internal_Reference>
</Target_Identification>

<Target_Identification>
<name>Cassini Orbiter</name>
<type>Equipment</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.co</lid_reference>
<reference_type>bundle_to_target</reference_type>
</Internal_Reference>
</Target_Identification>


<Target_Identification>
<name>DSN Antenna DSS 55</name>
<type>Equipment</type>
<description>The target is a DSN antenna used to track the Cassini-Huygens spacecraft.</description>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:telescope:madrid.dss55_34m</lid_reference>
<reference_type>bundle_to_target</reference_type>
</Internal_Reference>
</Target_Identification>



<Target_Identification>
<name>DSN Antenna DSS 25</name>
<type>Equipment</type>
<description>The target is a DSN antenna used to track the Cassini-Huygens spacecraft.</description>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:telescope:goldstone.dss25_34m</lid_reference>
<reference_type>bundle_to_target</reference_type>
</Internal_Reference>
</Target_Identification>



</Context_Area>

<Reference_List>
<External_Reference>
<reference_text>https://pds-atmospheres.nmsu.edu/data_and_services/atmospheres_data/Cassini/Cassini/RSS%20PDS%20page%202019-01-23/rss/activities/data</reference_text>
<description>
The referenced URL is the root of a data base that contains over 11,000 files that
document planning and real-time operations for Cassini radio science observations
between 2004 and 2017. The documents are organized into directories by year and date,
then by observation type, and finally by document type. The data base and its
contents are described in an appendix to the "Software Interface Specification:
Cassini Radio Science Raw Data Archive" (see the Document collection in this bundle).
The data base is not a PDS archive itself; but it is hosted by the PDS Atmospheres
Discipline Node.
</description>
</External_Reference>
</Reference_List>

<Bundle>
<bundle_type>Archive</bundle_type>
<description>
This bundle contains test data for exploring an unexpected SKIP message from VALIDATE.
</description>
</Bundle>

<Bundle_Member_Entry>
<lidvid_reference>urn:nasa:pds:cassini.rss.raw.test:data.pd2::1.0</lidvid_reference>
<member_status>Primary</member_status>
<reference_type>bundle_has_data_collection</reference_type>
</Bundle_Member_Entry>

<Bundle_Member_Entry>
<lidvid_reference>urn:nasa:pds:cassini.rss.raw.test:data.158::1.0</lidvid_reference>
<member_status>Primary</member_status>
<reference_type>bundle_has_data_collection</reference_type>
</Bundle_Member_Entry>

</Product_Bundle>
Loading

0 comments on commit e5def06

Please sign in to comment.