OiO.lk Blog python rdflib converting a complex CSV to a Graph – chained objects
python

rdflib converting a complex CSV to a Graph – chained objects


I’m fairly new to OWL and RDFlib, so my apologies if any of my terminology is off. I have a CSV that I’d like to convert into a knowledge graph, where each row becomes a sort of top level subject, and then has properties linked to it. While not important for the problem, the knowledge graph describes some biological assays, which is where my example "IRIs" are coming from.

my basic structure is:

assay1 a obo:assay;
    rdfs:comment "Some comment" ;
    BAO:has-endpoint BAO:endpoint .

what I would like to do is add:

BAO:endpoint SIO:has-value "5" ;
    SIO:has-unit "mg" .

and:

BAO:endpoint CHEMINF:has-uncertainty NCIT:StatisticalDispersion .
NCIT:StatisticalDispersion SIO:has-value "2" ;
    SIO:has-unit "mg" .

such that those additional triples are still associated with assay1. The idea is that each assay will have it’s own values, but I’m not really sure how to implement this with RDFlib. I’m guessing BNodes are my solution, but would that mean dropping something like NCIT:StatisticalDispersion entirely?

Thank you for the help!



You need to sign in to view this answers

Exit mobile version