Thanks, Anson, that is very useful. I was also curious to find out of any local serialization implementation and related projects, but maybe there is none. Many thanks again, Best Manuela
__________________________________________________________________________________ Dr Manuela Pallotto Strickland | Metadata and Digital Preservation Coordinator | Archives & Research Collections | Libraries & Collections King's College London | Strand | London WC2R 2LS | manuela.pallotto.strickl...@kcl.ac.uk Tel: Please call me using MS Teams or Skype for Business, or email to arrange a call W: https://www.kcl.ac.uk/library/collections/archives T: twitter.com/KingsArchives and twitter.com/kingslibraries Blog: blogs.kcl.ac.uk/kingscollections -----Original Message----- From: Code for Libraries <CODE4LIB@LISTS.CLIR.ORG> On Behalf Of parker, anson D (adp6j) Sent: Tuesday, August 1, 2023 3:56 PM To: CODE4LIB@LISTS.CLIR.ORG Subject: Re: [CODE4LIB] METS in JSON-LD? [You don't often get email from 000000d5611add13-dmarc-requ...@lists.clir.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] might be worth spending a minute on some AI bots to play with this at the end of the day it's an XML->JSON project and there are a bunch of tools that will streamline that for instance here's a dumbed down python script with a streamlit interface i got out of claude.ai in a couple of queries import streamlit as st import xml.etree.ElementTree as ET import json st.title('METS to JSON-LD Converter') uploaded_file = st.file_uploader('Choose a METS XML file', type=['xml']) if uploaded_file is not None: # Load METS file tree = ET.parse(uploaded_file) root = tree.getroot() # JSON-LD context context = { '@vocab': 'http://schema.org/', 'dc': 'http://purl.org/dc/elements/1.1/' } jsonld = {'@context': context} jsonld['metadata'] = [] # Parse METS and generate JSON-LD for dmdSec in root.iter('dmdSec'): # Extract metadata md = { 'name': dmdSec.find('mdWrap/xmlData/mods/titleInfo/title').text, 'author': [{'@type': 'Person', 'name': namePart.text} for namePart in dmdSec.find('mdWrap/xmlData/mods/name')], 'datePublished': dmdSec.find('mdWrap/xmlData/mods/originInfo/dateIssued').text, 'publisher': {'@type': 'Organization', 'name': dmdSec.find('mdWrap/xmlData/mods/originInfo/publisher').text}, 'genre': dmdSec.find('mdWrap/xmlData/mods/genre').text, 'description': dmdSec.find('mdWrap/xmlData/mods/abstract').text } jsonld['metadata'].append(md) # Output JSON-LD file for download json_txt = json.dumps(jsonld, indent=4) st.download_button('Download JSON-LD', json_txt, 'metadata.jsonld') ________________________________________ From: Code for Libraries <CODE4LIB@LISTS.CLIR.ORG> on behalf of Manuela Pallotto Strickland <000001243159acc2-dmarc-requ...@lists.clir.org> Sent: Tuesday, August 1, 2023 10:47 AM To: CODE4LIB@LISTS.CLIR.ORG Subject: [CODE4LIB] METS in JSON-LD? Hello, I am posting this question on a couple of lists, so sincere apologies to those who might see it twice (or thrice). Does anyone know of any work that has been/is being/will be done on 'a' METS JSON-LD serialization? Any relevant info or comment in this re will be very much appreciated. Thank you! Best wishes, Manuela __________________________________________________________________________________ Dr Manuela Pallotto Strickland | Metadata and Digital Preservation Coordinator | Archives & Research Collections | Libraries & Collections King's College London | Strand | London WC2R 2LS | manuela.pallotto.strickl...@kcl.ac.uk<mailto:manuela.pallotto.strickl...@kcl.ac.uk> Tel: Please call me using MS Teams or Skype for Business, or email to arrange a call W: https://www.kcl.ac.uk/library/collections/archives T: twitter.com/KingsArchives<http://twitter.com/KingsArchives> and twitter.com/kingslibraries<http://twitter.com/kingslibraries> Blog: blogs.kcl.ac.uk/kingscollections<http://blogs.kcl.ac.uk/kingscollections>