Skip to content

Update citation author/editor handling to use JSON fields with ORCID and ROR links#59

Merged
jordanpadams merged 1 commit intomainfrom
registry-legacy-solr-237
Jan 10, 2026
Merged

Update citation author/editor handling to use JSON fields with ORCID and ROR links#59
jordanpadams merged 1 commit intomainfrom
registry-legacy-solr-237

Conversation

@jordanpadams
Copy link
Member

@jordanpadams jordanpadams commented Jan 7, 2026

🗒️ Summary

Replaces flattened citation metadata fields with JSON-based extraction to preserve nested relationships between authors/editors, affiliations, and organizations. Adds clickable links for ORCID identifiers on person names and ROR identifiers on organization names to enable direct access to contributor profiles and institutional information.

Changes:

  • Remove deprecated flattened field constants from Constants.java
  • Add new JSON field constants for citation_author/editor_person/organization_json
  • Replace getAuthorEditorBlock() with processJsonField(), formatPerson(), formatOrganization()
  • Parse JSON to extract nested Person and Organization structures with Affiliations
  • Generate HTML links for person_orcid (ORCID) and organization_rorid (ROR) identifiers
  • Handle both single and array affiliations per person

⚙️ Test Data and/or Report

Screenshot 2026-01-06 at 4 20 52 PM

♻️ Related Issues

🤓 Reviewer Checklist

Reviewers: Please verify the following before approving this pull request.

Security & Quality

  • SonarCloud: Confirmed no new High or Critical security findings.
  • Secrets Detection: Verified that the Secrets Detection scan passed and no sensitive information (keys, tokens, PII) is exposed.
  • Code Quality: Code follows organization style guidelines and best practices for the specific language (e.g., PEP 8, Google Java Style).

Testing & Validation

  • Test Accuracy: Verified that test data is accurate, representative of real-world PDS4 scenarios, and sufficient for the logic being tested.
  • Coverage: Automated tests cover new logic and edge cases.
  • Local Verification: (If applicable) Successfully built and ran the changes in a local or staging environment.

Documentation

  • Documentation: README, Wiki, or inline documentation (Sphinx, Javadoc, Docstrings) have been updated to reflect these changes.

Maintenance

  • Issue Traceability: The PR is linked to a valid GitHub Issue or Jira Ticket.
  • Backward Compatibility: Confirmed that these changes do not break existing downstream dependencies or API contracts (or that breaking changes are clearly documented).

…and ROR links

Replaces flattened citation metadata fields with JSON-based extraction to preserve nested relationships between authors/editors, affiliations, and organizations. Adds clickable links for ORCID identifiers on person names and ROR identifiers on organization names to enable direct access to contributor profiles and institutional information.

Changes:
- Remove deprecated flattened field constants from Constants.java
- Add new JSON field constants for citation_author/editor_person/organization_json
- Replace getAuthorEditorBlock() with processJsonField(), formatPerson(), formatOrganization()
- Parse JSON to extract nested Person and Organization structures with Affiliations
- Generate HTML links for person_orcid (ORCID) and organization_rorid (ROR) identifiers
- Handle both single and array affiliations per person

Related to NASA-PDS/registry-legacy-solr#237
@jordanpadams jordanpadams requested a review from a team as a code owner January 7, 2026 00:20
@jordanpadams jordanpadams changed the title Update citation author/editor handling to use JSON fields with ORCID … Update citation author/editor handling to use JSON fields with ORCID and ROR links Jan 7, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
16.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

if (person.has("person_orcid")) {
String orcidUrl = person.getString("person_orcid");
sb.append("<a href=\"").append(orcidUrl).append("\" target=\"_blank\">");
sb.append(personName);
Copy link
Member

Choose a reason for hiding this comment

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

Is there any chance the upstream source could contain malicious data?

For example, suppose the personName contains <script src='https://my.hackers.org/exploit/v1'>. For this case, using an HTML element tree might be safer.

Yes, I can be a bit paranoid 😆

Copy link
Member

@nutjob4life nutjob4life left a comment

Choose a reason for hiding this comment

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

Approved but do see my question about HTML injection 😉

Also, 🎉

[INFO] Tests run: 36, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

@jordanpadams
Copy link
Member Author

jordanpadams commented Jan 10, 2026

@nutjob4life fix completed to sanitize these URLs. is this sufficient or should we take this a step further as use something like JSoup to actually build the HTML?

Screenshot 2026-01-10 at 11 32 49 AM

@nutjob4life
Copy link
Member

@jordanpadams good question; soup's good but maybe overkill? I don't know. Then again, AI might be able to write it up pretty fast too.

@jordanpadams
Copy link
Member Author

@nutjob4life true. but with the lack of a test suite here, I am worried about ripping apart the code and trying to test it. let's table that for now.

@jordanpadams jordanpadams merged commit 7634ff8 into main Jan 10, 2026
6 of 7 checks passed
@nutjob4life nutjob4life deleted the registry-legacy-solr-237 branch January 10, 2026 19:39
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.

2 participants