ReproNim / OHBMEducation-2022

Repo for the OHBM Education 1/2 day course entitled: "How to Write a Re-Executable Publication"
http://www.repronim.org/OHBMEducation-2022/
Creative Commons Zero v1.0 Universal
3 stars 15 forks source link

Local (ReproHub) python handling of my_nidm.ttl #9

Open dnkennedy opened 2 years ago

dnkennedy commented 2 years ago

Would love to be able to have the students load their my_nidm.ttl into the python notebook on the ReproHub, so that can do some additional things over the pynidm 'linear-regression'.

@satra suggested trying:

import rdflib as rl
g = rl.ConjunctiveGraph()
g.parse("path/to/ttl", format="turtle")
res = g.query(query)
res.bindings --> should be convertable to a dataframe fairly easily
dnkennedy commented 2 years ago

I'm trying to work out what the 'syntax' of the 'query' above would be... @dbkeator pointed me to some that I've yet to try.