Skip to content

Commit 8737c1c

Browse files
authored
Merge pull request #1471 from NASA-PDS/issue_1241
Patch to jparser to use local file instead of attempting to download URL
2 parents 99f80b7 + 7f8b2e7 commit 8737c1c

File tree

11 files changed

+15953
-5
lines changed

11 files changed

+15953
-5
lines changed

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
<dependency>
356356
<groupId>gov.nasa.pds</groupId>
357357
<artifactId>pds4-jparser</artifactId>
358-
<version>3.0.1</version>
358+
<version>3.1.0-SNAPSHOT</version>
359359
<scope>compile</scope>
360360
<exclusions>
361361
<exclusion>
@@ -370,6 +370,10 @@
370370
<groupId>org.slf4j</groupId>
371371
<artifactId>slf4j-jdk14</artifactId>
372372
</exclusion>
373+
<exclusion>
374+
<groupId>xml-apis</groupId>
375+
<artifactId>xml-apis</artifactId>
376+
</exclusion>
373377
</exclusions>
374378
</dependency>
375379
<dependency>

src/test/java/cucumber/SingleScenerio.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import java.io.IOException;
55
import java.nio.file.Files;
66
import java.nio.file.Paths;
7-
import java.util.ArrayList;
8-
import gov.nasa.pds.validate.ValidateLauncher;
97
import gov.nasa.pds.validate.constants.TestConstants;
108

119
public class SingleScenerio {
@@ -41,7 +39,7 @@ public static void main(String[] args) throws NumberFormatException, IOException
4139
System.out.println("execute_validate");
4240
engine.execute_validate (scenerio[4].strip().substring(1,scenerio[4].strip().length()-1));
4341
System.out.println ("compare_to_the");
44-
engine.compare_to_the(scenerio[5].strip().isBlank() ? null :
42+
engine.compare_to_the(scenerio[5].strip().isBlank() ? "" :
4543
scenerio[5].strip().substring(1, scenerio[5].strip().length()-1));
4644
System.out.println ("success");
4745
return;

src/test/resources/features/3.7.x.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: 3.7.x
1010
| 1391 | 1 | "github1391" | "--skip-context-validation -t {datasrc}/vl0axrat_char.xml" | |
1111
| 1391 | 2 | "github1391" | "--skip-context-validation -t {datasrc}/vl0axrat_delim.xml" | |
1212
| 1359 | 1 | "github1359" | "--skip-context-validation --label-extension lblx -R pds4.label --strict-field-checks -t {datasrc}/collection_hyb2_nirs3_sp_ard_data_iof_thermalcorr_v001.lblx" | |
13-
| 1358 | 1 | "github1358" | "--skip-context-validation --label-extension lblx -R pds4.label --strict-field-checks -t {datasrc}/uvi_20151207_051953_283_l2b_v21_edited.lblx " | |
13+
| 1358 | 1 | "github1358" | "--skip-context-validation -C {datasrc}/catalog.xml --label-extension lblx -R pds4.label --strict-field-checks -t {datasrc}/uvi_20151207_051953_283_l2b_v21_edited.lblx " | |
1414
| 1357 | 1 | "github1357" | "--skip-context-validation --label-extension lblx -R pds4.label -t {datasrc}/uvi_20151207_051953_283_l3b_v21.lblx" | |
1515
| 1332 | 1 | "github1332" | "--skip-context-validation -t {datasrc}/nh0001x.xml" | |
1616
| 1316 | 1 | "github1316" | "--skip-context-validation -R pds4.bundle -t {datasrc}/bundle.xml" | |
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN"
3+
"http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
4+
5+
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
6+
<rewriteSystem systemIdStartString="https://pds.nasa.gov/pds4/pds/v1/"
7+
rewritePrefix="file://{datasrc}/../jaxa/"/>
8+
9+
<rewriteSystem systemIdStartString="https://pds.nasa.gov/pds4/disp/v1/"
10+
rewritePrefix="file://{datasrc}/../jaxa/"/>
11+
12+
<rewriteSystem systemIdStartString="https://pds.nasa.gov/pds4/geom/v1/"
13+
rewritePrefix="file://{datasrc}/../jaxa/"/>
14+
15+
<rewriteSystem systemIdStartString="https://pds.nasa.gov/pds4/img/v1/"
16+
rewritePrefix="file://{datasrc}/../jaxa/"/>
17+
18+
<rewriteSystem systemIdStartString="https://pds.nasa.gov/pds4/msn/v1/"
19+
rewritePrefix="file://{datasrc}/../jaxa/"/>
20+
21+
<rewriteSystem systemIdStartString="https://data.darts.isas.jaxa.jp/pub/pds4/mission/vco/v1/"
22+
rewritePrefix="file://{datasrc}/../jaxa/"/>
23+
24+
<rewriteURI uriStartString="https://pds.nasa.gov/pds4/pds/v1/"
25+
rewritePrefix="file://{datasrc}/../jaxa/"/>
26+
27+
<rewriteURI uriStartString="https://pds.nasa.gov/pds4/disp/v1/"
28+
rewritePrefix="file://{datasrc}/../jaxa/"/>
29+
30+
<rewriteURI uritartString="https://pds.nasa.gov/pds4/geom/v1/"
31+
rewritePrefix="file://{datasrc}/../jaxa/"/>
32+
33+
<rewriteURI uriStartString="https://pds.nasa.gov/pds4/img/v1/"
34+
rewritePrefix="file://{datasrc}/../jaxa/"/>
35+
36+
<rewriteURI uriStartString="https://pds.nasa.gov/pds4/msn/v1/"
37+
rewritePrefix="file://{datasrc}/../jaxa/"/>
38+
39+
<rewriteURI uriStartString="https://data.darts.isas.jaxa.jp/pub/pds4/mission/vco/v1/"
40+
rewritePrefix="file://{datasrc}/../jaxa/"/>
41+
</catalog>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- PDS4 Schematron for Name Space Id:disp Version:1.5.1.0 - Thu Oct 20 21:50:14 UTC 2022 -->
3+
<!-- Generated from the PDS4 Information Model Version 1.19.0.0 - System Build 13.0 -->
4+
<!-- *** This PDS4 schematron file is an operational deliverable. *** -->
5+
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
6+
7+
<sch:title>Schematron using XPath 2.0</sch:title>
8+
9+
<sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/>
10+
<sch:ns uri="http://pds.nasa.gov/pds4/pds/v1" prefix="pds"/>
11+
<sch:ns uri="http://pds.nasa.gov/pds4/disp/v1" prefix="disp"/>
12+
13+
<!-- ================================================ -->
14+
<!-- NOTE: There are two types of schematron rules. -->
15+
<!-- One type includes rules written for -->
16+
<!-- specific situations. The other type are -->
17+
<!-- generated to validate enumerated value -->
18+
<!-- lists. These two types of rules have been -->
19+
<!-- merged together in the rules below. -->
20+
<!-- ================================================ -->
21+
<sch:pattern>
22+
<sch:rule context="disp:Display_Direction/disp:horizontal_display_direction">
23+
<sch:assert test=". = ('Left to Right', 'Right to Left')">
24+
<title>disp:Display_Direction/disp:horizontal_display_direction/disp:horizontal_display_direction</title>
25+
The attribute disp:Display_Direction/disp:horizontal_display_direction must be equal to one of the following values 'Left to Right', 'Right to Left'.</sch:assert>
26+
</sch:rule>
27+
</sch:pattern>
28+
<sch:pattern>
29+
<sch:rule context="disp:Display_Direction/disp:vertical_display_direction">
30+
<sch:assert test=". = ('Bottom to Top', 'Top to Bottom')">
31+
<title>disp:Display_Direction/disp:vertical_display_direction/disp:vertical_display_direction</title>
32+
The attribute disp:Display_Direction/disp:vertical_display_direction must be equal to one of the following values 'Bottom to Top', 'Top to Bottom'.</sch:assert>
33+
</sch:rule>
34+
</sch:pattern>
35+
<sch:pattern>
36+
<sch:rule context="disp:Display_Settings">
37+
<sch:let name="horizontal_display_axis" value="disp:Display_Direction/disp:horizontal_display_axis"/>
38+
<sch:let name="vertical_display_axis" value="disp:Display_Direction/disp:vertical_display_axis"/>
39+
<sch:let name="local_identifier_reference" value="pds:Local_Internal_Reference/pds:local_identifier_reference"/>
40+
<sch:assert test="//pds:*[pds:local_identifier=$local_identifier_reference]/pds:Axis_Array[pds:axis_name=$horizontal_display_axis]">
41+
<title>disp:Display_Settings/Rule</title>
42+
The horizontal display axis (<sch:value-of select='$horizontal_display_axis'/>) in display direction must match the name of an axis in the referenced Array (<sch:value-of select='$local_identifier_reference'/>)</sch:assert>
43+
<sch:assert test="//pds:*[pds:local_identifier=$local_identifier_reference]/pds:Axis_Array[pds:axis_name=$vertical_display_axis]">
44+
<title>disp:Display_Settings/Rule</title>
45+
The vertical display axis (<sch:value-of select='$vertical_display_axis'/>) in display direction must match the name of an axis in the referenced Array (<sch:value-of select='$local_identifier_reference'/>)</sch:assert>
46+
</sch:rule>
47+
</sch:pattern>
48+
<sch:pattern>
49+
<sch:rule context="disp:Display_Settings/pds:Local_Internal_Reference">
50+
<sch:assert test="pds:local_identifier_reference = //pds:*/pds:*/(pds:Array|pds:Array_2D|pds:Array_2D_Image|pds:Array_2D_Map|pds:Array_2D_Spectrum|pds:Array_3D|pds:Array_3D_Image|pds:Array_3D_Movie|pds:Array_3D_Spectrum)/pds:local_identifier
51+
">
52+
<title>disp:Display_Settings/pds:Local_Internal_Reference/Rule</title>
53+
Display Dictionary: In the pds:Local_Internal_Reference class, the value of the pds:local_identifier_reference must match the value of the pds:local_identifer of an Array class or sub-class within the File_Area.
54+
</sch:assert>
55+
<sch:assert test="pds:local_reference_type = 'display_settings_to_array'
56+
">
57+
<title>disp:Display_Settings/pds:Local_Internal_Reference/Rule</title>
58+
Display_Dictionary: For Local_Internal_Reference in disp:Display_Settings, local_reference_type must equal 'display_settings_to_array'.
59+
</sch:assert>
60+
</sch:rule>
61+
</sch:pattern>
62+
<sch:pattern>
63+
<sch:rule context="disp:Movie_Display_Settings">
64+
<sch:assert test="if (disp:loop_flag) then disp:loop_flag = ('true', 'false') else true()">
65+
<title>disp:Movie_Display_Settings/disp:loop_flag</title>
66+
The attribute disp:loop_flag must be equal to one of the following values 'true', 'false'.</sch:assert>
67+
<sch:assert test="if (disp:loop_back_and_forth_flag) then disp:loop_back_and_forth_flag = ('true', 'false') else true()">
68+
<title>disp:Movie_Display_Settings/disp:loop_back_and_forth_flag</title>
69+
The attribute disp:loop_back_and_forth_flag must be equal to one of the following values 'true', 'false'.</sch:assert>
70+
</sch:rule>
71+
</sch:pattern>
72+
<sch:pattern>
73+
<sch:rule context="disp:Movie_Display_Settings/disp:frame_rate">
74+
<sch:assert test="@unit = ('frames/s')">
75+
<title>disp:Movie_Display_Settings/disp:frame_rate/disp:frame_rate</title>
76+
The attribute @unit must be equal to one of the following values 'frames/s'.</sch:assert>
77+
</sch:rule>
78+
</sch:pattern>
79+
<sch:pattern>
80+
<sch:rule context="disp:Movie_Display_Settings/disp:loop_delay">
81+
<sch:assert test="@unit = ('day', 'hr', 'julian day', 'microseconds', 'min', 'ms', 'ns', 's', 'yr')">
82+
<title>disp:Movie_Display_Settings/disp:loop_delay/disp:loop_delay</title>
83+
The attribute @unit must be equal to one of the following values 'day', 'hr', 'julian day', 'microseconds', 'min', 'ms', 'ns', 's', 'yr'.</sch:assert>
84+
</sch:rule>
85+
</sch:pattern>
86+
</sch:schema>

0 commit comments

Comments
 (0)