Hi,
I tried the script below and it does create a new individuals, which can be seen in Protégé.
If you really want to be fully compatible with OWL, you may also add the following RDF triple:
gr:""" + username + """ rdf:type owl:NamedIndividual.
Jiba
---8<-------------
from owlready2 import *
onto = get_ontology('
http://www.semanticweb.org/bentofuascarvalho/ontologies/OntoBase#')
with onto:
class Person(Thing): pass
username = "jiba"
graph2 = default_world.as_rdflib_graph().get_context(onto)
graph2.update("""
PREFIX rdf: <
http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <
http://www.w3.org/2002/07/owl#>
PREFIX xsd: <
http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <
http://www.w3.org/2000/01/rdf-schema#>
PREFIX gr: <
http://www.semanticweb.org/bentofuascarvalho/ontologies/OntoBase#>
INSERT {
gr:""" + username + """ rdf:type gr:Person.
} WHERE {}""")
default_world.graph.dump()
onto.save("/tmp/z.owl")