I would like to find which values from a list exist in a specific ontology using bert map algorithm.
One of the first steps is to load the ontology in order to use it in the process.
As I am newbie in this I ask chatgpt to create an example and it took me this. However as I check the rdflib has not the Graph() command.
Here is the example:
install.packages(c("textTinyR", "rdflib"))
library(textTinyR)
library(rdflib)
uco_ontology <- "C:/Users/User/Desktop/uco_1_5.owl" # Replace with the path to your UCO ontology file
graph <- rdflib::Graph()
rdflib::parse(graph, file = uco_ontology)
Is there any way to load an ontology to R? From here you can donwload the ontology (owl) file which requests the snippet.
There are a few ways to parse the .owl file that you have, the vignette of the package might include more information
You might have a better luck with 'bert map' using the Pytorch package (https://krr-oxford.github.io/DeepOnto/). If R is required you can use the 'reticulate' R package to work with it from within R