Skip to content

Commit

Permalink
Merge pull request #807 from NASA-PDS/240814_Add_geom_kernel_type_val…
Browse files Browse the repository at this point in the history
…idation_rule

Added geom:kernel_type validation rule
  • Loading branch information
jordanpadams authored Aug 23, 2024
2 parents 7b44299 + 830217c commit 910a2ae
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1104,12 +1104,13 @@ static void setexposedElementFlag() {
static void setexposedAttributeFlag() {
// the set of attributes that will be externalized (defined as xs:Element)
exposedAttributeArr = new ArrayList<>();
exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.comment");
exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.description");
// 555 commented out until DDWG addresses impact of using ref:
// exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.comment");
// exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.description");
exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.local_identifier");
exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.logical_identifier");
exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.name");
exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.kernel_type");
// exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.name");
// exposedAttributeArr.add("0001_NASA_PDS_1.all.USER.pds.kernel_type");
}

static void setRegistryAttrFlag() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1808,13 +1808,14 @@ private DOMAttr getLocalOrExternAttr(SchemaFileDefn lSchemaFileDefn, DOMClass lD
}

// validate that referenced attribute is exposed
if (lDOMAttr.nameSpaceIdNC.compareTo("pds") == 0 && ! lDOMAttr.isExposed) {
if (lDOMAttr.isEnumerated) {
DMDocument.registerMessage("2>error Attribute: " + " - The referenced enumerated attribute " + lLocalIdentifier + " must be exposed.");
} else {
DMDocument.registerMessage("2>warning Attribute: " + " - The referenced attribute " + lLocalIdentifier + " is not exposed.");
}
}
// 555 commented out until DDWG approves impact of the fix
// if (lDOMAttr.nameSpaceIdNC.compareTo("pds") == 0 && ! lDOMAttr.isExposed) {
// if (lDOMAttr.isEnumerated) {
// DMDocument.registerMessage("2>warning Attribute: " + " - The referenced enumerated attribute " + lLocalIdentifier + " is not exposed.");
// } else {
// DMDocument.registerMessage("2>warning Attribute: " + " - The referenced attribute " + lLocalIdentifier + " is not exposed.");
// }
// }

// clone the USER or LDD attribute for use as a Resolved attribute
// returns rdfIdentifier = "TBD_rdfIdentifier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void getUserClassAttrIdMap() {
DOMInfoModel.getAttrIdentifier(DMDocument.masterUserClassNamespaceIdNC,
DMDocument.masterUserClassName, lDOMAttr.nameSpaceIdNC, lDOMAttr.title);

// 555
// set selected attributes to exposed
if (DMDocument.exposedAttributeArr.contains(lUserAttrIdentifier)) lDOMAttr.isExposed = true;

DOMInfoModel.userDOMClassAttrIdMap.put(lUserAttrIdentifier, lDOMAttr);
Expand Down
25 changes: 24 additions & 1 deletion model-ontology/src/ontology/Data/UpperModel.pins
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Thu Aug 08 12:01:13 EDT 2024
; Wed Aug 14 12:29:19 EDT 2024
;
;+ (version "3.5")
;+ (build "Build 663")
Expand Down Expand Up @@ -145,6 +145,29 @@
(identifier "nilReason")
(specMesg "The 'nilReason' attribute must be used in conjunction with xsi:nil=\"true\""))

([http%3A%2F%2Fpds.nasa.gov%2Finfomodel%2Fpds%23.geom%3ASPICE_Kernel_Identification%2Fgeom%3Akernel_type.100004870] of Schematron_Rule

(alwaysInclude "false")
(attrNameSpaceNC "geom")
(attrTitle "kernel_type")
(classNameSpaceNC "geom")
(classSteward "geom")
(classTitle "SPICE_Kernel_Identification")
(has_Schematron_Assert [http%3A%2F%2Fpds.nasa.gov%2Finfomodel%2Fpds%23.geom%3ASPICE_Kernel_Identification%2Fgeom%3Akernel_type.100004870.101])
(identifier "geom:SPICE_Kernel_Identification/geom:kernel_type")
(isMissionOnly "false")
(roleId "TBD_roleId")
(type "TBD_type")
(xpath "geom:SPICE_Kernel_Identification/geom:kernel_type"))

([http%3A%2F%2Fpds.nasa.gov%2Finfomodel%2Fpds%23.geom%3ASPICE_Kernel_Identification%2Fgeom%3Akernel_type.100004870.101] of Schematron_Assert

(assertMsg "The attribute geom:SPICE_Kernel_Identification/geom:kernel_type must be equal to one of the following values 'CK', 'DBK', 'DSK', 'EK', 'FK', 'IK', 'LSK', 'MK', 'PCK', 'SCLK', 'SPK'.")
(assertStmt ". = ('CK', 'DBK', 'DSK', 'EK', 'FK', 'IK', 'LSK', 'MK', 'PCK', 'SCLK', 'SPK')")
(assertType "RAW")
(attrTitle "kernel_type")
(identifier "kernel_type"))

([http%3A%2F%2Fpds.nasa.gov%2Finfomodel%2Fpds%23.pds%3A%2FProduct_Observational%2Fpds%3AIdentification_Area%2Fpds%3Alogical_identifier.100002512] of Schematron_Rule

(alwaysInclude "true")
Expand Down
2 changes: 1 addition & 1 deletion model-ontology/src/ontology/Data/UpperModel.pont
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Thu Aug 08 12:01:12 EDT 2024
; Wed Aug 14 12:29:18 EDT 2024
;
;+ (version "3.5")
;+ (build "Build 663")
Expand Down
40 changes: 20 additions & 20 deletions model-ontology/src/ontology/Data/UpperModel.pprj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
; Thu Aug 08 12:01:13 EDT 2024
; Wed Aug 14 12:29:19 EDT 2024
;
;+ (version "3.5")
;+ (build "Build 663")

([BROWSER_SLOT_NAMES] of Property_List

(properties
[UpperModel_ProjectKB_Class10123]
[UpperModel_ProjectKB_Class10124]
[UpperModel_ProjectKB_Class10125]
[UpperModel_ProjectKB_Class10126]))
[UpperModel_ProjectKB_Class123]
[UpperModel_ProjectKB_Class124]
[UpperModel_ProjectKB_Class125]
[UpperModel_ProjectKB_Class126]))

([CLSES_TAB] of Widget

Expand Down Expand Up @@ -423,10 +423,10 @@
(x 0)
(y 120))

([KB_663782_Class0] of Map
([KB_414268_Class0] of Map
)

([KB_858554_Class0] of Map
([KB_663782_Class0] of Map
)

([KB_887149_Instance_43] of String
Expand Down Expand Up @@ -841,35 +841,35 @@
([UpperModel_ProjectKB_Class10] of Property_List
)

([UpperModel_ProjectKB_Class10123] of String
([UpperModel_ProjectKB_Class11] of Widget

(is_hidden TRUE)
(property_list [UpperModel_ProjectKB_Class12])
(widget_class_name "edu.stanford.smi.protegex.owl.ui.cls.OWLClassesTab"))

([UpperModel_ProjectKB_Class12] of Property_List
)

([UpperModel_ProjectKB_Class123] of String

(name "ChangeLog")
(string_value "date"))

([UpperModel_ProjectKB_Class10124] of String
([UpperModel_ProjectKB_Class124] of String

(name ":INSTANCE-ANNOTATION")
(string_value "%3AANNOTATION-TEXT"))

([UpperModel_ProjectKB_Class10125] of String
([UpperModel_ProjectKB_Class125] of String

(name ":PAL-CONSTRAINT")
(string_value "%3APAL-NAME"))

([UpperModel_ProjectKB_Class10126] of String
([UpperModel_ProjectKB_Class126] of String

(name ":META-CLASS")
(string_value "%3ANAME"))

([UpperModel_ProjectKB_Class11] of Widget

(is_hidden TRUE)
(property_list [UpperModel_ProjectKB_Class12])
(widget_class_name "edu.stanford.smi.protegex.owl.ui.cls.OWLClassesTab"))

([UpperModel_ProjectKB_Class12] of Property_List
)

([UpperModel_ProjectKB_Class13] of Widget

(is_hidden TRUE)
Expand Down

0 comments on commit 910a2ae

Please sign in to comment.