Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Jan 16, 2025
2 parents b60fce3 + 81e130f commit d5f0609
Show file tree
Hide file tree
Showing 17 changed files with 1,428 additions and 22 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [«unknown»](https://github.com/NASA-PDS/validate/tree/«unknown») (2025-01-07)
## [«unknown»](https://github.com/NASA-PDS/validate/tree/«unknown») (2025-01-16)

[Full Changelog](https://github.com/NASA-PDS/validate/compare/v3.6.3...«unknown»)

Expand All @@ -10,11 +10,13 @@

**Defects:**

- validate's PDS4 Bundle Level Validation Results are wrong if filenames end in XML [\#1100](https://github.com/NASA-PDS/validate/issues/1100) [[s.medium](https://github.com/NASA-PDS/validate/labels/s.medium)]
- validate cucumber testing is not exercising all tests as it should be [\#1058](https://github.com/NASA-PDS/validate/issues/1058) [[s.medium](https://github.com/NASA-PDS/validate/labels/s.medium)]
- Validate fails when installed into the same directory [\#935](https://github.com/NASA-PDS/validate/issues/935) [[s.low](https://github.com/NASA-PDS/validate/labels/s.low)]

**Other closed issues:**

- Quiet `Selected XML parser...` output that goes to stdout [\#1103](https://github.com/NASA-PDS/validate/issues/1103)
- Switchover to using registry-common library to communicate with OpenSearch Serverless Registry [\#895](https://github.com/NASA-PDS/validate/issues/895)

## [v3.6.3](https://github.com/NASA-PDS/validate/tree/v3.6.3) (2024-11-19)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/gov/nasa/pds/tools/label/LabelValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import gov.nasa.pds.tools.util.Utility;
import gov.nasa.pds.tools.util.VersionInfo;
import gov.nasa.pds.tools.util.XMLExtractor;
import gov.nasa.pds.tools.validate.ProblemContainer;
import gov.nasa.pds.tools.validate.ProblemDefinition;
import gov.nasa.pds.tools.validate.ProblemHandler;
import gov.nasa.pds.tools.validate.ProblemType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
import org.slf4j.LoggerFactory;
import gov.nasa.pds.tools.util.Utility;
import gov.nasa.pds.tools.util.XslURIResolver;
import gov.nasa.pds.tools.validate.ProblemDefinition;
import gov.nasa.pds.tools.validate.ProblemHandler;
import gov.nasa.pds.tools.validate.ProblemType;
import gov.nasa.pds.tools.validate.ValidationProblem;

/**
* A class that transforms Schematron files based on the isoSchematron stylesheet.
Expand All @@ -64,7 +61,7 @@ private Transformer buildIsoTransformer() throws TransformerConfigurationExcepti
TransformerFactory isoFactory = TransformerFactory.newInstance();
try {
isoFactory.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", true);
isoFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
//isoFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); see validate#1103
isoFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
} catch (TransformerConfigurationException e) {
throw new TransformerConfigurationException("Failed to configure TransformerFactory for secure processing", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,6 @@ public synchronized Collection<String> getUnreferencedTargets() {
return unreferencedTargets;
}

@Override
public synchronized Collection<Identifier> getReferencedIdentifiers() {
return referencedIdentifiers;
}

@Override
public synchronized Collection<Identifier> getUnreferencedIdentifiers() {
List<Identifier> unreferencedIdentifiers = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ public interface TargetRegistrar {
*
* @return a collection of referenced identifiers.
*/
Collection<Identifier> getReferencedIdentifiers();

/**
* Gets the location of where the given identifier is referenced.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,7 @@ public void collectionReferentialIntegrityRule() {
LOG.debug("collectionReferentialIntegrityRule:getTarget() {}, num collections {}",
getTarget(), collections.keySet().size());

// Check for collection(_.*)?\.(xml or lblx) file.
for (Map.Entry<String, ValidationTarget> collection : collections.entrySet()) {
if (!collection.getValue().getLocation().endsWith(getContext().getLabelExtension())) {
continue;
}

Target collectionTarget = new Target(collection.getValue().getUrl(), false);
try {
XMLExtractor extractor = new XMLExtractor(collectionTarget.getUrl());
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/features/3.6.x.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: 3.6.x
| issueNumber | subtest | datasrc | args | expectation |
#begin

| 1100 | | "github1100" | "--skip-context-validation -R pds4.bundle -t {datasrc}" | |
| 1066 | | "github1066" | "--skip-content-validation -t {datasrc}/vg2u_49xr_1986024t232141.xml" | |
| 1028 | | "github1028" | "--skip-context-validation -t {datasrc}/xa.s16..shz.1976.070.0.xml --schema {datasrc}/PDS4_PDS_1N00.xsd --schematron {datasrc}/PDS4_PDS_1N00.sch" | |
| 1008 | | "github1008" | "--skip-context-validation -t {datasrc}/example.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.pdf.file.not_pdfa_compliant=1" |
Expand Down
13 changes: 8 additions & 5 deletions src/test/resources/features/pre.3.6.x.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ Feature: < 3.6
| 611 | | "github611" | "-t {datasrc}/GRD-L1A-150313-150319_150625-BGO.xml" | "summary:totalErrors=0,summary:totalWarnings=1,summary:messageTypes:warning.table.field_value_out_of_special_constant_min_max_range=1" |
| 605 | | "github605" | "--skip-context-validation -t {datasrc}/video_and_audio.xml" | |
| 604 | | "github604" | "--skip-context-validation -t {datasrc}/video.xml" | |
| 599 | | "github599" | "-t {datasrc}/AREA_Camelot_1radii.xml" | |
| 599 | 1 | "github599" | "--skip-context-validation -t {datasrc}/AREA_Camelot_1radii.xml" | |
| 599 | 2 | "github599" | "--skip-context-validation -x {datasrc}/PDS4_PDS_1I00.xsd -t {datasrc}/AREA_Camelot_1radii.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.label.schema=1" |
| 599 | 3 | "github599" | "--skip-context-validation -S {datasrc}/PDS4_PDS_1I00.sch -t {datasrc}/AREA_Camelot_1radii.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.label.schema=1" |
| 599 | 4 | "github599" | "--skip-context-validation -S {datasrc}/PDS4_PDS_1I00.sch -x {datasrc}/PDS4_PDS_1I00.xsd -t {datasrc}/AREA_Camelot_1radii.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.label.schema=1" |
| 597 | 1 | "github597" | "--skip-context-validation -R pds4.bundle -t {datasrc}" | |
| 597 | 2 | "github562" | "-t {datasrc}" | |
| 597 | 3 | "github561" | "-R pds4.collection --label-extension lblx --skip-context-validation -t {datasrc}" | |
Expand Down Expand Up @@ -113,8 +116,8 @@ Feature: < 3.6
| 357 | 4 | "github357" | "-R pds4.label -t {datasrc}/whypointsremovedfromdata_4_records.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.validation.invalid_field_value=1" |
| 356 | 1 | "github356" | "-R pds4.bundle --skip-product-validation --skip-context-validation --skip-content-validation -t {resourceDir}/github240/valid/bundle_kaguya_derived.xml" | |
| 356 | 2 | "github356" | "-R pds4.bundle --skip-product-validation --skip-context-validation --skip-content-validation -t {resourceDir}/github240/invalid/bundle_kaguya_derived.xml" | "summary:totalErrors=0,summary:totalWarnings=1,summary:messageTypes:warning.sub_directory.unallowed_name=1" |
| 349 | 1 | "github349" | "-R pds4.label -t {datasrc}/valid/datasetgood.xml" | |
| 349 | 2 | "github349" | "-R pds4.label -t {datasrc}/invalid/datasetbad.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.directory.unallowed_name=1" |
| 349 | 1 | "github349" | "-R pds4.label --skip-context-validation -t {datasrc}/valid/datasetgood.xml" | |
| 349 | 2 | "github349" | "-R pds4.label --skip-context-validation -t {datasrc}/invalid/datasetbad.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.directory.unallowed_name=1" |
| 345 | 1 | "github345" | "-R pds4.label -t {datasrc}/astro_sample_t.xml" | |
| 345 | 2 | "github345" | "-R pds4.label -t {datasrc}/astro_sample_data_t.xml" | |
| 344 | | "github344" | "-R pds4.bundle -t {datasrc}/bundle.xml" | |
Expand All @@ -136,8 +139,8 @@ Feature: < 3.6
| 303 | 2 | "github303" | "-R pds4.label --skip-context-validation -t {datasrc}/valid/I52_20210207_1A_U1B03A_01_0001.avgs.xml" | |
| 299 | 1 | "github299" | "-R pds4.label -t {datasrc}/valid/gbo_ast_fieber-beyer_spectra_v2.0_20210211_aip_v1.0.xml" | |
| 299 | 2 | "github299" | "-R pds4.label -t {datasrc}/invalid/gbo_ast_fieber-beyer_spectra_v2.0_20210211_aip_v1.0.xml" | "summary:totalErrors=0,summary:totalWarnings=3" |
| 298 | 1 | "github298" | "-R pds4.label {datasrc}/valid/sentences.xml" | |
| 298 | 2 | "github298" | "-R pds4.label {datasrc}/invalid/sentences.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.validation.invalid_field_value=1" |
| 298 | 1 | "github298" | "-R pds4.label --skip-context-validation {datasrc}/valid/sentences.xml" | |
| 298 | 2 | "github298" | "-R pds4.label --skip-context-validation {datasrc}/invalid/sentences.xml" | "summary:totalErrors=1,summary:totalWarnings=0,summary:productValidation:failed=1,summary:messageTypes:error.validation.invalid_field_value=1" |
| 297 | 1 | "github297" | "--skip-context-validation -R pds4.label -t {datasrc}/valid/rimfax_rdr_0081_example.xml" | |
| 297 | 2 | "github297" | "--skip-context-validation -R pds4.label -t {datasrc}/invalid/rimfax_rdr_0081_example.xml" | "summary:totalErrors=0,summary:totalWarnings=1" |
| 294 | 1 | "github294" | "--skip-context-validation -R pds4.label -t {datasrc}/valid/minmax-error.xml" | |
Expand Down
90 changes: 90 additions & 0 deletions src/test/resources/github1100/bundle_suda.XML
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0"?>
<?xml-model
href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1J00.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_1J00.xsd">
<Identification_Area>
<logical_identifier>urn:nasa:pds:clipper.sud</logical_identifier>
<version_id>1.0</version_id>
<title>Europa Clipper SUDA Bundle</title>
<information_model_version>1.19.0.0</information_model_version>
<product_class>Product_Bundle</product_class>
<Citation_Information>
<author_list>Kempf, Sascha; Curtin, Alexandra; Polson, Shawn</author_list>
<publication_year>2024</publication_year>
<doi>10.26033/xaky-md22</doi>
<description>This bundle collects all the operational data products produced by the SUDA instrument onboard the Europa Clipper spacecraft.</description>
</Citation_Information>
<Modification_History>
<Modification_Detail>
<modification_date>2024-12-03</modification_date>
<version_id>1.0</version_id>
<description>Initial release.</description>
</Modification_Detail>
</Modification_History>
</Identification_Area>
<Context_Area>
<Time_Coordinates>
<start_date_time>2022-08-30T13:32:12.723000Z</start_date_time>
<stop_date_time>2022-08-30T16:48:38.364000Z</stop_date_time>
</Time_Coordinates>
<Primary_Result_Summary>
<purpose>Science</purpose>
<processing_level>Raw</processing_level>
<processing_level>Partially Processed</processing_level>
<Science_Facets>
<domain>Surface</domain>
<discipline_name>Small Bodies</discipline_name>
<facet1>Dust Study</facet1>
</Science_Facets>
</Primary_Result_Summary>
<Investigation_Area>
<name>Europa Clipper Mission</name>
<type>Mission</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:mission.clipper</lid_reference>
<reference_type>bundle_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>
<Observing_System>
<name>Europa Clipper</name>
<Observing_System_Component>
<name>Europa Clipper Spacecraft</name>
<type>Host</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.clipper</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>
<Observing_System_Component>
<name>SUrface Dust Analyzer (SUDA)</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:clipper.sud</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>
</Observing_System>
<Target_Identification>
<name>DUST</name>
<type>Dust</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:target:dust.dust</lid_reference>
<reference_type>bundle_to_target</reference_type>
</Internal_Reference>
</Target_Identification>
</Context_Area>
<Bundle>
<bundle_type>Archive</bundle_type>
</Bundle>
<Bundle_Member_Entry>
<lidvid_reference>urn:nasa:pds:clipper.sud:data_sci_calibrated::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 d5f0609

Please sign in to comment.