We have a Pyspark pair RDD which stores the path of .owl
files as key and the file contents as value.
I wish to carry out reasoning using Owlready2. To load an ontology from OWL files, the get_ontology()
function is used. However, the given function expects an IRI (a sort of URL) to the file, whereas I have the file contents as a str
in Python.
Is there a way I could make this work out?
I have tried the following:
- Used
get_ontology(file_contents).load()
--> this obviously does not work as the function expects a file path. - Used
get_ontology(file_contents)
--> no error, but the ontology does not get loaded, so reasoning does not happen.