Posted by
mkumba on
URL: http://owlready.306.s1.nabble.com/How-to-move-concepts-from-one-ontology-to-another-tp1386p1392.html
I feel like I'm so close, but something isn't lining up.
I load an ontology, everything looks good. Then I do this
ontoOut= get_ontology("
https://ontologies.semanticarrs.com/gistSubSet.owl/")
ontoOut.get_namespace("
https://ontologies.semanticarts.com/gist/")
print (gist.Person.equivalent_to)
print ("aspect",gist.Aspect.is_a)
print ("gist.Aspectname", gist.Aspect.name)
with ontoOut:
types.new_class(gist.Aspect.name)
for c in ontoOut.classes():
print ("c2",c)
ontoOut.save(file = "gistSubSet.owl")
I used your suggestion to set up the output ontology (previously I had been opening an empty ontology) I'm not seeing either approach to work yet.
The first three print lines are just reasurring me that the classes I loaded from input ontology are still ok
the new_classes method seems like it should set up a class (I didn't assign it to a class name in python, if I have to do that how will I do it dynamically (I want to create many dozens, and won't know at coding time what they are)
The output
[gist.LivingThing & gist.offspringOf.some(gist.Person) & gist.name.some(<class 'str'>)]
aspect [gist.Category]
gist.Aspectname Aspect
First line, Person has its fromal definition
Second line aspect has its is_a
Third line Aspect has a name
But the "c2"'s dont show and the output file is just the headers and name of ontology
I'm overlooking something obvious here but don't see it.
Thanks again