Skip to content

METS div parser: generalize to cover more cases #64

@bertsky

Description

@bertsky

We currently rely on the assumption, that the mets:div content element contains an @ADMID (which is mandatory by METS DFG application profile, but optional in the ENMAP profile):

# descend to the deepest AMD
while div.get_ADMID() is None:
self.logger.debug("Found logical outer div type %s: %s", div.get_TYPE(), div.get_ID())
div = div.get_div()[0]
start_div = div.get_div()[0]
self.logger.debug("Found logical inner div type %s: %s", start_div.get_TYPE(), start_div.get_ID())
while start_div.get_div() and start_div.get_div()[0].get_ADMID() is not None:
self.logger.debug("Found logical inner div type %s: %s", start_div.get_TYPE(), start_div.get_ID())
div = start_div
start_div = start_div.get_div()[0]

Since this is fragile and inflexible, the parser should probably search for @TYPE and @ID (perhaps cross-checking with structlink) instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions