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

Automatically assemble a valid RO-Crate JSON file from metadata in the container #15

Open
apirogov opened this issue Aug 18, 2022 · 0 comments
Labels
enhancement New feature or request prio:B standards!!! Standard-compliance and best-practice related

Comments

@apirogov
Copy link
Collaborator

We can use pyld and use that to transform our redundant and nested JSON-LD into normalized form.

from pyld import jsonld
jsonld.compact(jsonld.flatten(imgmeta.dict()),"https://w3id.org/ro/crate/1.1/context")

Some things to consider:

  • pyld chokes on the normal schema.org context, but works when given the direct link to the json file see here for URLs
  • In any case, the transformations should work offline so we should maintain copies of the needed contexts in the packages
  • For pyld transformations then we would need to search/replace canonical context URLs with our local context loaded from file (just assign the same dict, it is efficient due to sharing)
@apirogov apirogov added enhancement New feature or request prio:B labels Aug 18, 2022
@apirogov apirogov added the standards!!! Standard-compliance and best-practice related label Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prio:B standards!!! Standard-compliance and best-practice related
Projects
None yet
Development

No branches or pull requests

1 participant