Skip to content

Conversation

@dyrpsf
Copy link
Contributor

@dyrpsf dyrpsf commented Jan 12, 2026

Summary

This PR extends SBMLRDFAnnotationParser so that creators written using the newer
dcterms:creator + vCard4 format (as produced by libSBML) are parsed into History /
Creator objects, in addition to the existing support for the legacy
dc:creator + vCard/v1 format.

Concrete changes:

  • readRDFHistory now also looks for dcterms:creator elements in the dcterms
    namespace (JSBML.URI_PURL_TERMS) and calls readCreator on them, so both
    <dc:creator> and <dcterms:creator> blocks are handled.

  • readCreator(...) still supports the original vCard pattern:

    • vCard:NvCard:Family, vCard:Given
    • vCard:EMAIL
    • vCard:ORGvCard:Orgname

    but now also falls back to vCard4 when those nodes are not present:

    • vCard4:hasNamevCard4:family-name, vCard4:given-name
    • vCard4:hasEmail
    • vCard4:organization-name

    The vCard4 namespace used is http://www.w3.org/2006/vcard/ns#.

This addresses creators that are written using vCard4 as in
sbmlteam/jsbml#270, so that
History.getListOfCreators() returns the expected Creator instances.

Verification

  • Built JSBML and ran the core tests with Java 11:
  mvn test -pl core -am

The jsbml-core tests pass, so the new parsing logic does not break the
existing test suite.

Fixes #270

Copy link
Member

@draeger draeger left a comment

Choose a reason for hiding this comment

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

It would be better to collect String literals as public static final String constants; possibly an enum could be created. I'd suggest avoiding keywords in the source code, as this can be hard to maintain if, for instance, typos occur.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creators are not parsed from annotation

2 participants