Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make encode-marc21 validation optional or optionally less strict #567

Closed
TobiasNx opened this issue Nov 11, 2024 · 7 comments · Fixed by #572
Closed

Make encode-marc21 validation optional or optionally less strict #567

TobiasNx opened this issue Nov 11, 2024 · 7 comments · Fixed by #572
Assignees

Comments

@TobiasNx
Copy link
Contributor

TobiasNx commented Nov 11, 2024

Currently the marc encoder only serializes to marc21 if a lot of validations are true.

Hbz/Verbundgruppe has a use case where for the it is more important to change the form from marcxml to marc21 than having valid marc21.

The transformation breaks if the data is not valid at the moment.

I therefore suggest to make the validation of the leader and controllfields optional.

@TobiasNx TobiasNx changed the title Make encode-marc21 validation optional Make encode-marc21 validation optional or less strict Nov 12, 2024
@TobiasNx
Copy link
Contributor Author

Also the marcxml schema is less strict than the marc21 specification from LOC:

https://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd

Leader has to have 24 characters but the regex is the following: <xsd:pattern value="[\d ]{5}[\dA-Za-z ]{1}[\dA-Za-z]{1}[\dA-Za-z ]{3}(2| )(2| )[\d ]{5}[\dA-Za-z ]{3}(4500| )"/>

@TobiasNx TobiasNx changed the title Make encode-marc21 validation optional or less strict Make encode-marc21 validation optional or optionally less strict Nov 12, 2024
@dr0i dr0i self-assigned this Nov 12, 2024
@dr0i dr0i moved this to Selected in Metafacture Nov 12, 2024
@dr0i dr0i moved this from Selected to Working in Metafacture Nov 18, 2024
@dr0i

This comment was marked as resolved.

@TobiasNx

This comment was marked as resolved.

@TobiasNx
Copy link
Contributor Author

I would suggest an option | handle-marcxml(validate="false")

@dr0i
Copy link
Member

dr0i commented Nov 18, 2024

you mean encode-marc21 ? And I would opt for a more precise option name, like:
encode-marc21(validateLeader="false").

@TobiasNx
Copy link
Contributor Author

you mean encode-marc21 ? And I would opt for a more precise option name, like: encode-marc21(validateLeader="false").

you are correct! is there any additional metadata beside the leader that is validated?

@dr0i
Copy link
Member

dr0i commented Nov 19, 2024

Well, yes - somehow the input must be structurally representable as MARC...
Read the description section, e.g.

Top-level literals are encoded as reference fields. Their name must

Of course we could also ignore that. Sparks the question: When is MARC MARC and when it isn't anymore?

dr0i added a commit that referenced this issue Nov 19, 2024
@dr0i dr0i closed this as completed in #572 Nov 19, 2024
@github-project-automation github-project-automation bot moved this from Working to Done in Metafacture Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants