Skip to content

Conversation

@bhawana11
Copy link
Collaborator

@bhawana11 bhawana11 commented Aug 19, 2025

This is a pull request for issue RelatedUrls description: #332

Expected outcome:
For RelatedURLs pyQuARC should flag:
If missing description only (Warning)
If duplicate description only (Info)
If both missing and duplicate description (Warning)

Code Changes:
Added a new check function to check missing description in custom_validator.py and added corresponding check messages and registered new checks in check_messages.json and checks.json respectively.
Finally, added the corresponding rule mappings in rule_mapping.json.
Also for duplicate description, changed the recommendation message to "Descriptions should be unique to each URL. Several of the descriptions are repeated in this record. Recommend changing the descriptions to more accurately and uniquely describe each link"

To Reproduce:
Example concept ID: C1000000005-CDDIS (umm-c) (for duplicate description. For missing description run the test file.

Expected result:
image

@lavanya3k
Copy link
Collaborator

lavanya3k commented Oct 7, 2025

Testing: Checked the condition that if the RelatedUrls/Description is missing, a Warning message should be displayed.

Example: C1000000022-CDDIS, C1000000012-CDDIS (umm-c)

Screenshot 2025-10-07 at 2 46 25 PM

C1000000012-CDDIS - Does have a unique Relatedurl description, therefore no error will show up.

(dict): Result of the validation from xml and json schema validators
"""
return self.validator_func(metadata)
return self.validator_func(metadata)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline at the end of the file

items = [items]
num_items = len(items)
return {"valid": int(count) == num_items, "value": (count, num_items)}
return {"valid": int(count) == num_items, "value": (count, num_items)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline at the end of the file

Comment on lines 992 to 995
"remediation": "Descriptions should be unique to each URL. Several of the descriptions are repeated in this record. Recommend changing the descriptions to more accurately and uniquely describe each link"
},

"url_description_presence_check": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix formatting and missing period (.) in remediation message

"available": true
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline at the end of the file


# is the concept id valid and is the request going through?
assert downloader.errors == []
assert downloader.errors == []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline at the end of the file

Comment on lines +4762 to 4764
"url_description_presence_check": {
"rule_name": "url description presence check",
"fields_to_apply": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we replacing an existing rule? do we need to?

if we do, check if anything else is using this rule and if not, remove all the associated code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another function, url_description_uniqueness_check, in the rule_mapping.json that will check whether the description of the URL is unique. Since we have three different criteria (see below), @bhawana11 wrote a new function for URLDescription. Let me know if you have suggestions for a better fix.

  • If missing description only (Warning)
  • If duplicate description only (Info)
  • If both missing and duplicate descriptions (Warning)

Copy link
Member

@slesaad slesaad Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im concerned about the deletion, previously we used the given fields
for example:
"Collection/OnlineAccessURLs/OnlineAccessURL/URLDescription",
"Collection/OnlineAccessURLs/OnlineAccessURL/URL"
to check

if url is provided, description needs to be provided.

we're completely getting rid of that check for all these fields, is that intentional?

@slesaad slesaad mentioned this pull request Oct 15, 2025
@slesaad slesaad closed this Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants