Skip to content

Make the plugin ready for the new data model#3

Draft
zyzzyxdonta wants to merge 2 commits into
mainfrom
feature/new-data-model
Draft

Make the plugin ready for the new data model#3
zyzzyxdonta wants to merge 2 commits into
mainfrom
feature/new-data-model

Conversation

@zyzzyxdonta

@zyzzyxdonta zyzzyxdonta commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Known bug: The new data model uses schema: <http://schema.org/> while rdflib used in the validation code uses schema: <https://schema.org/> which causes validation to be skipped for all non-https things.

@zyzzyxdonta

Copy link
Copy Markdown
Collaborator Author

Hey @notactuallyfinn, here is another case where @SKernchen and I refactored a HERMES plugin to use the new data model. Would you be willing to take a look at the code to see if this makes sense? Thanks! 😄

@notactuallyfinn notactuallyfinn left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me, only a few very minor things.


def prepare(self):
def __call__(
self, command: HermesCommand, metadata: SoftwareMetadata

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The annotation of command could be changed to HermesCurateCommand from hermes.commands.curate.base, which is more precise.


def create_report(self):
"""Create basic text report."""
def create_report(self, metadata: SoftwareMetadata):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

metadata is never used in the method.

Comment on lines +112 to +115
ctx = HermesCacheManager()
validation_file = ctx.cache_dir / "curate" / "validation.json"
validation_file.parent.mkdir(exist_ok=True, parents=True)
self._validation_graph.serialize(validation_file, format="json-ld")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not use the HermesCacheManager the way it was intended to be used?
(validation_file would have to be moved, but is there another reason?)

validation_file.parent.mkdir(exist_ok=True, parents=True)
self._validation_graph.serialize(validation_file, format="json-ld")

self._report = create_report(self._validation_graph)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

self._report seems to be unused.
Can it be removed?

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