Skip to content

FAIR DO MoMEnT simple type system support - #408

Open
ThomasJejkal wants to merge 3 commits into
mainfrom
fair_do_moment_type_integration
Open

FAIR DO MoMEnT simple type system support#408
ThomasJejkal wants to merge 3 commits into
mainfrom
fair_do_moment_type_integration

Conversation

@ThomasJejkal

Copy link
Copy Markdown
Contributor

This PR implements the support for resolving FAIR DOs created by the current version of FAIR DO MoMEnT, e.g., 21.11152/8a0091ce-792f-4a78-8b6b-e4b58393e809. The reason for the modification is, that such FAIR DOs are not (yet) using DataTypes registered in the official DTR, but custom DataTypes registered in a dedicated GitHub repository.

Changes are the following:

  • Introduced GitHubRegistryUtil to load all types from the GitHub repository, transform, and store them in typeMap and handleMap
  • Changed typeMap and handleMap to use PID strings as keys instread of objects, as entries added by GitHubRegistryUtil couldn't be found

ThomasJejkal and others added 2 commits August 3, 2026 16:31
@ThomasJejkal ThomasJejkal added the enhancement New feature or request label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

🎨 Chromatic Visual Tests

✅ No visual changes

Review

View in Chromatic

Chromatic provides automated visual testing and review for component changes.

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.39726% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.99%. Comparing base (66d32a6) to head (8151512).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../stencil-library/src/rendererModules/Handle/PID.ts 3.57% 27 Missing ⚠️
...es/stencil-library/src/utils/GitHubRegistryUtil.ts 31.57% 26 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
- Coverage   77.69%   76.99%   -0.71%     
==========================================
  Files          50       51       +1     
  Lines        3520     3569      +49     
  Branches     1010     1048      +38     
==========================================
+ Hits         2735     2748      +13     
- Misses        783      819      +36     
  Partials        2        2              
Files with missing lines Coverage Δ
...-library/src/rendererModules/Handle/PIDDataType.ts 96.61% <100.00%> (+0.05%) ⬆️
packages/stencil-library/src/utils/utils.ts 100.00% <100.00%> (ø)
...es/stencil-library/src/utils/GitHubRegistryUtil.ts 31.57% <31.57%> (ø)
.../stencil-library/src/rendererModules/Handle/PID.ts 45.09% <3.57%> (-11.00%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Test Results

Coverage Summary

Node Lines Statements Branches Functions

Coverage & Quality Reports

📊 Codecov Report
🎨 Chromatic Status


For more details, check the workflow run

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

🎨 Chromatic Visual Tests

✅ No visual changes

Review

View in Chromatic

Chromatic provides automated visual testing and review for component changes.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Test Results

Coverage Summary

Node Lines Statements Branches Functions
22 75.94% 74.96% 61.59% 77.97%
24 75.94% 74.96% 61.59% 77.97%
25 75.94% 74.96% 61.59% 77.97%

Coverage & Quality Reports

📊 Codecov Report
🎨 Chromatic Status


For more details, check the workflow run

console.log("Return from handleMap for PID ", this);
return handleMap.get(this.toString());
}
else if(this.prefix.toUpperCase().match('^0\\.SIMPLE')){

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like this prefix. We do not have any authority over it. Wouldn't it be better to use one of our own prefixes instead? Also, I would prefer if it weren't hardcoded here. Either hard-code it in the GitHubRegistry Util (belongs there structurally) or make it configurable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, it might be not a solution for ever, but for the moment it gave me control and readability. Sooner or later I would definitely like to switch to real PIDs (I think using only our prefix but custom suffixes is not an option), but currently, I think this would also be only a temporary solution, e.g., my initial idea was to refer to the file in GitHub via PID redirect. The reason why I hardcoded it here was because of the implementation of isResolvable, where related strings are also hardcoded, but it's also fine to move it.

}

export class GitHubRegistryUtil {
private static readonly GITHUB_TREE_API = 'https://api.github.com/repos/ThomasJejkal/simple-type-registry/git/trees/main?recursive=1';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't a map of the prefix, raw base URL, and tree API URL be better. What happens if we want to support two repos (thinking about Andreas' repo for the FDO type system). For now this map could be hardcoded, but in the future, this would be configured/computed. Based on the current DTR infrastructure, I expect that we need to be able to deal with multiple DTRs soon. The prefix of an attribute could be a good indicator of the DTR used and could be used to configure appropriate types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This would assume, that we'll multiple GitHub-based DTRs in future, which I currently don't see. And the combination of prefix, raw base URL, and API URL seems to be specific for GitHub.

While supporting different DTRs will probably be required in future, I think, that their implementations might be completely different, API-wise and mapping-wise, and I did not want to modify the pid-component in such a drastic way. And regarding the corellation between prefix and DTR...not sure if this holds. If you check the first conversation above, an option is also to use our prefix and a "normal" PID to refer to the raw file in GitHub. Then, there is no difference anymore.

}

/**
* Resets the initialization state (useful for testing).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't a clean reset. The values are still in typeMap and handleMap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree, and it even might not be needed.

*/
isResolvable(): boolean {
return !unresolvables.has(this) && !this.prefix.toUpperCase().match('^(0$|0\\.|HS_|10320$)');
return !unresolvables.has(this.toString()) && !this.prefix.toUpperCase().match('^(0$|0\\.(?!SIMPLE)|HS_|10320$)');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You would not have this problem if you used our prefix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which problem? The only difference would be, that we can omit checking for 0.SIMPLE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants