Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a user, I want to validate that all context objects specified in observational products are referenced in the parent bundle/collection Reference_List #69

Open
3 tasks
jordanpadams opened this issue Aug 16, 2019 · 14 comments

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Aug 16, 2019

Motivation

...so that we can enable quality search results when searching at the collection/bundle level

Additional Details

Reverted per #456

All unique context objects specified in observational products must be referenced in the Reference_List of the parent collection and bundle. These context objects are referenced from:

  • Target_Identification
  • Observing_System_Component
  • Investigation_Area
    If the the context product is not referenced in the bundle/collection, throw a WARNING message (TBD, this will become an error once it is documented in the Standards Reference).

Acceptance Criteria

Given a bundle with target identified as X
When I perform validation of the bundle (-R pds4.bundle) with products that have targets X and Y
Then I expect validate to throw a WARNING that all targets are not specified in the parent bundle

Given a collection J with target identified as X
When I perform validation of the bundle containing collection J (-R pds4.bundle) with products that have targets X and Y
Then I expect validate to throw a WARNING that all targets are not specified in the parent collection

Given a collection J with target identified as X
When I perform validation of the bundle containing collection J (-R pds4.bundle) with products that have targets X and Y with --skip-context-reference-check flag
Then I expect validate to NOT throw a WARNING

Engineering Details

Some background:
Per email chain with @mitchgordon, @lynnneakrase, @rsjoyner, @rchenatjpl , the issue arose regarding specifying numerous targets within a data collection. There were several other alternatives, including specifying the targets in the context collection and specifying a planetary_system instead of the individual targets, however, it was determined the best way to specify targets at the collection/bundle level is to explicitly add all targets to the bundle/collection label Reference_List. This solution should apply across all context objects.

  • create new WARNING log message for missing_context_reference include in message Disable with --skip-context-reference-check flag.
  • implement algorithm to perform the check for child context products in the parent bundle / collection labels
  • implement flag to disable this capability
@jordanpadams jordanpadams changed the title Verify that all targets identified in a data collection are specified in collection/bundle Reference_List Verify all context objects specified in observational products are referenced in the parent bundle/collection Reference_List Aug 16, 2019
@jordanpadams jordanpadams added the requirement New requirements label Aug 16, 2019
@jordanpadams
Copy link
Member Author

email_20190815.pdf

@jordanpadams jordanpadams added enhancement New feature or request medium and removed new-feature-request labels Aug 21, 2019
@jordanpadams jordanpadams added this to the PDS.08 (ends 2020-01-15) milestone Dec 13, 2019
@jordanpadams jordanpadams added requirement New requirements and removed requirement New requirements labels Jan 8, 2020
@jordanpadams jordanpadams removed the requirement New requirements label Jan 10, 2020
@jordanpadams jordanpadams removed this from the PDS.12 (ends 2020-03-11) milestone Mar 13, 2020
@jordanpadams jordanpadams changed the title Verify all context objects specified in observational products are referenced in the parent bundle/collection Reference_List As a user, I want to validate that all context objects specified in observational products are referenced in the parent bundle/collection Reference_List Mar 14, 2021
@jordanpadams jordanpadams added p.should-have requirement New requirements and removed enhancement New feature or request medium labels Mar 14, 2021
@msbentley
Copy link

I haven't fully digested the email discussion, but just to summarise - the intention is that any target which appears in an observational product should be replicated in the parent collection and/or bundle reference list? For other types of contexts products this makes sense (investigation, host etc.) but for targets it could get... messy.

Currently I have been assuming that in the PSA we would curate the bundle label reference lists for the primary mission target(s), and not for every single target that we may have observed during a long cruise, or calibration targets etc.

I'm not again it, per se, but because we dynamically update our bundle and collection labels with every product ingestion, this would take some database work to implement etc.

jordanpadams added a commit that referenced this issue Jul 17, 2021
jordanpadams added a commit that referenced this issue Jul 17, 2021
Validate that all context objects specified in labels are referred to…
@rchenatjpl
Copy link

Is this a fail? product_observational references a target not referenced in bundle or collection. validate flags the bundle but not the collection.
Much more subtle: the collection references a target that none of its products reference.
val69.zip

@rchenatjpl rchenatjpl reopened this Oct 25, 2021
@rchenatjpl
Copy link

It's probably a fail. The revised test has these lid_references to targets:
bundle: saturn narvi
collection: saturn titan
data: saturn narvi

% validate -R pds4.bundle -t val69b

PDS Validate Tool Report

Configuration:
Version 2.2.0-SNAPSHOT
Date 2021-10-25T23:45:19Z

Parameters:
Targets [file:/Users/rchen/Desktop/val69b/]
Rule Type pds4.bundle
Severity Level WARNING
Recurse Directories true
File Filters Used [*.xml, *.XML]
Data Content Validation on
Product Level Validation on
Allow Unlabeled Files false
Max Errors 100000
Registered Contexts File /Users/rchen/PDS4tools/validate/resources/registered_context_products.json

Product Level Validation Results

PASS: file:/Users/rchen/Desktop/val69b/bundle-vg1-sat-pos-l1coords-1.0.xml
1 product validation(s) completed

PASS: file:/Users/rchen/Desktop/val69b/data-sedr/SEDR_L1.xml
2 product validation(s) completed

PASS: file:/Users/rchen/Desktop/val69b/data-sedr/collection-data-sedr-1.0.xml
3 product validation(s) completed

PDS4 Bundle Level Validation Results

PASS: file:/Users/rchen/Desktop/val69b/data-sedr/collection-data-sedr-1.0.xml
1 integrity check(s) completed

PASS: file:/Users/rchen/Desktop/val69b/bundle-vg1-sat-pos-l1coords-1.0.xml
WARNING [warning.integrity.missing_context_reference] This file should reference 'urn:nasa:pds:context:target:satellite.saturn.narvi' because its child product with LIDVID urn:nasa:pds:vg1-saturn-pos-l1coords:data-sedr:sedr-l1::1.0 references it.
WARNING [warning.integrity.missing_context_reference] This file should reference 'urn:nasa:pds:context:target:satellite.saturn.titan' because its child product with LIDVID urn:nasa:pds:vg1-saturn-pos-l1coords:data-sedr::1.0 references it.
2 integrity check(s) completed

PASS: file:/Users/rchen/Desktop/val69b/data-sedr/SEDR_L1.xml
3 integrity check(s) completed

Summary:

0 error(s)
2 warning(s)

Product Validation Summary:
3 product(s) passed
0 product(s) failed
0 product(s) skipped

Referential Integrity Check Summary:
3 check(s) passed
0 check(s) failed
0 check(s) skipped

Message Types:
2 warning.integrity.missing_context_reference

End of Report
Completed execution in 4662 ms

@rchenatjpl
Copy link

val69b.zip

@rchenatjpl
Copy link

@qchaupds @jordanpadams Another probable point of failure: context products all have LIDs urn:::context:..., i.e. look for "context". The attached should generate no warnings or errors.

% validate -R pds4.bundle -t val308a
PDS Validate Tool Report
Configuration:
Version 2.2.0-SNAPSHOT
Date 2021-10-26T02:33:46Z
Parameters:
Targets [file:/Users/rchen/Desktop/test/val308a/]
Rule Type pds4.bundle
Severity Level WARNING
Recurse Directories true
File Filters Used [*.xml, *.XML]
Data Content Validation on
Product Level Validation on
Allow Unlabeled Files false
Max Errors 100000
Registered Contexts File /Users/rchen/PDS4tools/validate/resources/registered_context_products.json
Product Level Validation Results
PASS: file:/Users/rchen/Desktop/test/val308a/bundle-voyager1-pls-sat-1.0.xml
1 product validation(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/browse-ion-moments/collection-browse-ion-moments-1.0.xml
2 product validation(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/browse-ion-moments/ION_MOM.xml
3 product validation(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/data-ion-moments-96sec/collection-data-ion-moments-96s-1.0.xml
4 product validation(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/data-ion-moments-96sec/ION_MOM.xml
5 product validation(s) completed
PDS4 Bundle Level Validation Results
PASS: file:/Users/rchen/Desktop/test/val308a/browse-ion-moments/collection-browse-ion-moments-1.0.xml
1 integrity check(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/bundle-voyager1-pls-sat-1.0.xml
WARNING [warning.integrity.missing_context_reference] This file should reference 'urn:nasa:pds:vg1-pls-sat:data-ion-moments-96sec:ion-mom' because its child product with LIDVID urn:nasa:pds:vg1-pls-sat:browse-ion-moments:ion-mom::1.0 references it.
WARNING [warning.integrity.missing_context_reference] This file should reference 'urn:nasa:pds:vg1-pls-sat:browse-ion-moments:ion-mom' because its child product with LIDVID urn:nasa:pds:vg1-pls-sat:data-ion-moments-96sec:ion-mom::1.0 references it.
2 integrity check(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/data-ion-moments-96sec/collection-data-ion-moments-96s-1.0.xml
3 integrity check(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/data-ion-moments-96sec/ION_MOM.xml
4 integrity check(s) completed
PASS: file:/Users/rchen/Desktop/test/val308a/browse-ion-moments/ION_MOM.xml
5 integrity check(s) completed
Summary:
0 error(s)
2 warning(s)
Product Validation Summary:
5 product(s) passed
0 product(s) failed
0 product(s) skipped
Referential Integrity Check Summary:
5 check(s) passed
0 check(s) failed
0 check(s) skipped
Message Types:
2 warning.integrity.missing_context_reference
End of Report
Completed execution in 6189 ms
val308a.zip

@jordanpadams
Copy link
Member Author

@rchenatjpl created a new ticket to track this at #430

jordanpadams added a commit that referenced this issue Dec 7, 2021
previous expected test result was invalid
jordanpadams added a commit that referenced this issue Dec 8, 2021
previous expected test result was invalid
jordanpadams added a commit that referenced this issue Dec 10, 2021
Numerous issues have stemmed from these updates. Revert those and re-implement #69 at a later date using the registry paradigm
jordanpadams added a commit that referenced this issue Dec 10, 2021
Numerous issues have stemmed from these updates. Revert those and re-implement #69 at a later date using the registry paradigm
@jordanpadams jordanpadams reopened this Dec 10, 2021
@jordanpadams jordanpadams added icebox and removed B12.0 labels Dec 10, 2021
@jordanpadams jordanpadams removed this from the 11.Jesse.Owens milestone Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ToDo
Development

No branches or pull requests

6 participants