This could be done using siibra, or probably the new EBRAINS KG python client. I can provide a code snippets for siibra.