-
Notifications
You must be signed in to change notification settings - Fork 3
RelatedUrls description #346
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
Conversation
pyQuARC/code/schema_validator.py
Outdated
| (dict): Result of the validation from xml and json schema validators | ||
| """ | ||
| return self.validator_func(metadata) | ||
| return self.validator_func(metadata) |
There was a problem hiding this comment.
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
pyQuARC/code/custom_validator.py
Outdated
| 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)} |
There was a problem hiding this comment.
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
| "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": { |
There was a problem hiding this comment.
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
pyQuARC/schemas/checks.json
Outdated
| "available": true | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
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
tests/test_downloader.py
Outdated
|
|
||
| # is the concept id valid and is the request going through? | ||
| assert downloader.errors == [] | ||
| assert downloader.errors == [] |
There was a problem hiding this comment.
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
| "url_description_presence_check": { | ||
| "rule_name": "url description presence check", | ||
| "fields_to_apply": { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?

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:
