Skip to content

Fix the "metadata" templates. - #22

Open
gouttegd wants to merge 4 commits into
mainfrom
fix-metadata-templates
Open

Fix the "metadata" templates.#22
gouttegd wants to merge 4 commits into
mainfrom
fix-metadata-templates

Conversation

@gouttegd

Copy link
Copy Markdown
Collaborator

We update the dynamic templates that produce the files in src/metadata (the description of the ontology for the OBO Foundry and the PURL configuration file).

Mostly, we try to use the ODK configuration to fill those files as much as possible, especially regarding the available release artefacts and export formats. When we do not have the information we need from the ODK configuration, we let some explicit placeholder for the ontology owner to replace.

We also avoid generating GitHub-specific URLs if the ontology does not appear to be intended to be hosted on GitHub (no github_org).

For the PURL config file, we redirect to attached release artefacts rather than to files from the repository itself, except for imports, components, and pattern files -- those files are expected to be imported from the -edit file, so most users would expect that their PURLs should point to the tip of the main branch rather than to the last release. In most cases this should not matter because the XML Catalog is there to redirect IRIs of import modules and components to local files so that we won't even hit the network, but this may be useful if one needs to process the -edit file with a tool written in a niche language that does not have support for XML Catalogs (e.g., Python; see obophenotype/cell-ontology#3119).

closes INCATools/ontology-development-kit#1236

@gouttegd gouttegd self-assigned this Aug 29, 2026
We update the dynamic templates that produce the files in `src/metadata`
(the description of the ontology for the OBO Foundry and the PURL
configuration file).

Mostly, we try to use the ODK configuration to fill those files as much
as possible, especially regarding the available release artefacts and
export formats. When we do _not_ have the information we need from the
ODK configuration, we let some explicit placeholder for the ontology
owner to replace.

We also avoid generating GitHub-specific URLs if the ontology does not
appear to be intended to be hosted on GitHub (no `github_org`).

For the PURL config file, we redirect to attached release artefacts
rather than to files from the repository itself, _except_ for imports,
components, and pattern files -- those files are expected to be imported
from the -edit file, so most users would expect that their PURLs should
point to the tip of the main branch rather than to the last release. In
most cases this should not matter because the XML Catalog is there to
redirect IRIs of import modules and components to local files so that we
won't even hit the network, but this may be useful if one needs to
process the -edit file with a tool written in a niche language that does
not have support for XML Catalogs (e.g., Python; see
obophenotype/cell-ontology#3119).

closes INCATools/ontology-development-kit#1236
@gouttegd
gouttegd force-pushed the fix-metadata-templates branch from 52046f9 to a27e981 Compare August 29, 2026 16:52
@gouttegd
gouttegd requested a review from matentzn August 29, 2026 17:24

@matentzn matentzn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great, some cosmetic stuff to consider

Comment thread src/incatools/odk/templates/_dynamic_files.jinja2 Outdated
Comment thread src/incatools/odk/templates/_dynamic_files.jinja2 Outdated
{% endif -%}
{% if project.use_dosdps -%}
- prefix: /patterns/
replacement: https://github.com/{{ project.github_org }}/{{ project.repo }}/raw/refs/heads/{{ project.git_main_branch }}/src/ontology/patterns/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
replacement: https://github.com/{{ project.github_org }}/{{ project.repo }}/raw/refs/heads/{{ project.git_main_branch }}/src/ontology/patterns/
replacement: https://github.com/{{ project.github_org }}/{{ project.repo }}/raw/refs/heads/{{ project.git_main_branch }}/src/patterns/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or even

Suggested change
replacement: https://github.com/{{ project.github_org }}/{{ project.repo }}/raw/refs/heads/{{ project.git_main_branch }}/src/ontology/patterns/
replacement: https://github.com/{{ project.github_org }}/{{ project.repo }}/raw/refs/heads/{{ project.git_main_branch }}/src/patterns/dosdp-patterns/

Depending on what the intention is of this process prefix.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The point is to make sure that an import declaration like http://purl.obolibrary.org/obo/MYONT/patterns/definitions.owl can find the current version of the definitions.owl file even without a catalog.

Files under dosdp-patterns are used by the DOSDP pipelines but none of them should ever be imported directly (they are not even OWL files), so there shouldn’t be any reason to have a redirection to that directory.

Comment thread src/incatools/odk/templates/_dynamic_files.jinja2 Outdated
{%- endif %}
{%- endfor %}
{%- for artefact in project.release_artefacts %}
{%- if artefact != project.primary_release %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

drops <id>/<id>-base.owl from products when someone sets primary_release: base, so PURL resolves only through fall thru?

@gouttegd gouttegd Aug 30, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

so PURL resolves only through fall thru?

Err, what are you talking about? Those lines are not in the PURL config template, they are in the OBO Foundry metadata template. This is the list of available products, as in:

products:
  - id: myont.owl
    name: "My Ontology main release in OWL format"
  - id: myont-base.owl
    name "My Ontology BASE release in OWL format"

So yes, we drop myont/myont-X.owl when X is the ”primary release” product, to avoid needlessly listing what is in effect the same product twice (once under the name of the primary release, and once under the qualified name).

This seems to be the norm on the OBO FOundry website: For most ontologies, the “primary release” is -full, and the -full product is not listed among the available products (see for example Uberon, CL, …).

Comment thread src/incatools/odk/templates/_dynamic_files.jinja2
Both the project.title and project.description are free text, and could
contain YAML-breaking stuff.
When not using GitHub, we cannot predict what the URLs to redirect to
for all the various parts of the ontology will be, so we just write out
placeholders for the ontology owner to fill.
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.

Fix the generated PURL configuration

2 participants