I have an RDF/OWL ontology that interacts well with owlready2 except for inserts via sparql or rdflib. For instance:
onto = get_ontology("file://c:/users/diggy/natlang/story.owl").load()
graph = default_world.as_rdflib_graph()
with onto:
graph.update("""
INSERT {
<
http://www.local/story#human4>
<
http://www.local/story#hasGender>
<
http://www.local/story#male> .
} WHERE {} """)
after this insert, the triple is there (except Protege cannot see it!) and the domain and range entries for the hasGender property have been deleted! I have tried this and similar queries, also with sparql, on this and several other ontologies, with almost random results. In some cases it removes the object property entirely. I must be doing something wrong.
Thanks in advance.
Diggy