flatten a deep json structure with jq for pandasit did't work for me but this may be a good answer for others here. (in my case the dicts can have different depths). I finally made a lot of work of indices by hand, but now I have a working copy that looks somehow similar to yours.

SPARQL initializationI am sorry, that I didn't answer in any kind yet, I am still stuck with the "solution" that I provided in the beginning. It somehow works, but it seems odd to me. I have not updated the code til now, maybe there is some strange behavior caused by some version issue. As soon as I have time I will try to update my SPARQL-Wrapper code and feedback my experience. Cheers