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

Context validation needs to be updated to include all possible product type use cases #62

Closed
jordanpadams opened this issue Jul 30, 2019 · 0 comments · Fixed by #76
Closed
Assignees
Labels
bug Something isn't working

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Jul 30, 2019

Describe the bug
Current context product validation only includes a subset of potential cases where a context products may be referenced. Need to update to include all possible cases.

To Reproduce
From ContextProductReferenceValidationRule.java:

  private final String INTERNAL_REF_XPATH =
    "//*:Internal_Reference[namespace-uri()='" + PDS4_NS + "' and starts-with(*:reference_type[namespace-uri()='" + PDS4_NS + "'],'is_')] | " + 
    "//*:Internal_Reference[namespace-uri()='" + PDS4_NS + "' and ends-with(*:reference_type[namespace-uri()='" + PDS4_NS + "'], '_to_target')] | " +
    "//*:Internal_Reference[namespace-uri()='" + PDS4_NS + "' and *:reference_type[namespace-uri()='" + PDS4_NS + "'] = 'collection_to_context'] | " + 
    "//*:Internal_Reference[namespace-uri()='" + PDS4_NS + "' and *:reference_type[namespace-uri()='" + PDS4_NS + "'] = 'data_to_investigation'] | " + 
    "//*:Internal_Reference[namespace-uri()='" + PDS4_NS + "' and starts-with(*:reference_type[namespace-uri()='" + PDS4_NS + "'],'document_to_') and " + 
    "*:reference_type[namespace-uri()='" + PDS4_NS + "'] != 'document_to_associate']";

Expected behavior
This should check for the following patterns for reference_type:

  • is_* (already does this successfully)
  • *_to_instrument
  • *_to_instrument_host
  • *_to_other
  • *_to_facility
  • *_to_telescope
  • *_to_airborne
  • *_to_laboratory
  • *_to_observatory
  • *_to_target
  • *_to_context
@jordanpadams jordanpadams added the bug Something isn't working label Jul 30, 2019
@jordanpadams jordanpadams changed the title Context validation only works for subset of use cases Context validation needs to be updated to include all possible use cases Jul 30, 2019
@jordanpadams jordanpadams changed the title Context validation needs to be updated to include all possible use cases Context validation needs to be updated to include all possible product type use cases Jul 30, 2019
jordanpadams added a commit that referenced this issue Aug 19, 2019
Initial implementation of context product validation only include a small subset of possible Internal_Reference.reference_types that could include context products.

ContextProductReferenceValidationRule.java was updated accordingly to include reference_types like:

- is_*
- *_to_instrument
- *_to_instrument_host
- *_to_other
- *_to_facility
- *_to_telescope
- *_to_airborne
- *_to_laboratory
- *_to_observatory
- *_to_target
- *_to_context
jordanpadams added a commit that referenced this issue Aug 22, 2019
Issue #62: Include wider range of context products in validation
jordanpadams pushed a commit that referenced this issue Sep 10, 2019
…mes denoted context products (#82)

* Issue #15: Verify that all name/type attribute values correspond to
names denoted context products


- Generated the json file in the new formate:
{
 "Product_Context": [
   {
   "name": "Name",
   "type": "Type",
   "lidvid": "ID::VER"
   },
   
- set the Registered Products with name and type.
- modified LidVid.java to handle name and type.

* Modified the classes basic on the issue #62.

* Issue #15: Verify that all name/type attribute values correspond to
names denoted context products

- update json files:
main/resources/util/registered_context_products.json
test/resources/github28/new_context.json

- add new test case:
test/resources/github15

- implemented functionality to verify name/type.

... ...

* modified after merge master into issue_15

* Rename LidVid object to more useful ContextProductReference

* Update and simplify reference check code for Observing_System_Component

* Update usefulness of error messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants