ontology

Add new Individuals to an existing ontology from a dataframe using owlready 2

Add new Individuals to an existing ontology from a dataframe using owlready 2 Question: I have the following dataframe: import pandas as pd data = [[‘onto.modify’, ‘onto.ModificationAction1’]] df = pd.DataFrame(data, columns=[‘queries’, ‘corpus’]) queries corpus 0 onto.modify onto.ModificationAction1 The elements of corpus column are Individuals of a particular Class of an ontology called ontology2. I want …

Total answers: 1

Loading an ontology from string in Python

Loading an ontology from string in Python Question: 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 …

Total answers: 1

Visualize an RDFLIB Graph in Python

Visualize an RDFLIB Graph in Python Question: I am new to RDFLIB in python. I found this example of creating a graph on here. What is the simplest way to visualize graph created by this code? import rdflib # Now we create a graph, a representaiton of the ontology g = rdflib.Graph() # Now define …

Total answers: 2