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

Add Metadata #38

Closed
4 of 14 tasks
digitaldogsbody opened this issue May 13, 2022 · 3 comments · Fixed by #61
Closed
4 of 14 tasks

Add Metadata #38

digitaldogsbody opened this issue May 13, 2022 · 3 comments · Fixed by #61
Assignees
Labels
helper Helper method to be added

Comments

@digitaldogsbody
Copy link
Member

digitaldogsbody commented May 13, 2022

Description

This helper adds key/value pairs to the metadata property of a Prezi3 object

Function name / Parameters / Return

Function name: .add_metadata(label, value)

Parameters:

  • label - the key to be added the metadata property
  • value - the value(s) for the key, either a string or an array of strings

Returns: None

Objects

  • Base Object (all Prezi3 Classes)
  • Collection
  • Manifest
  • Canvas
  • Range
  • AnnotationCollection
  • AnnotationPage
  • Annotation
  • Content Resource - Image
  • Content Resource - Video
  • Content Resource - Text
  • Service
  • Provider
  • Other - please list below

Considerations

@digitaldogsbody digitaldogsbody added the helper Helper method to be added label May 13, 2022
@glenrobson
Copy link
Contributor

glenrobson commented May 13, 2022

Use auto language config if not provided.

Parameters can be:

  • Strings
  • dict label={'en': 'Author'}
  • LngString

Any other way you can create a LngString.

@azaroth42
Copy link
Contributor

The metadata structure is called KeyValueString in the schema, which is what this function should create.

For the auto-language feature, see: https://github.com/iiif-prezi/iiif-prezi3/blob/main/iiif_prezi3/helpers/auto_fields.py

e.g.

>>> from iiif_prezi3 import KeyValueString
>>> kv = KeyValueString(label="label", value="value")
>>> kv
KeyValueString(label=LngString(__root__={'none': ['label']}), value=LngString(__root__={'none': ['value']}))

@azaroth42
Copy link
Contributor

Do we want a similar function to work for requiredStatement? https://iiif.io/api/presentation/3.0/#requiredstatement

@glenrobson glenrobson linked a pull request May 27, 2022 that will close this issue
digitaldogsbody added a commit that referenced this issue Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helper Helper method to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants