Re: How to move concepts from one ontology to another
Posted by mkumba on
URL: http://owlready.306.s1.nabble.com/How-to-move-concepts-from-one-ontology-to-another-tp1386p1391.html
I've delved into this deeper. I think I sort of understand what you've done. Let me run this by you and see if I'm on the right track and see if we can figure out a way for me to do what I want to do.
I naively believed that there were class objects in your system, one per class in owl, and that I could move them, by copying from one ontology to another.
It now looks to me like class is just a wrapper around a query that picks up ?class rdf:type owl:Class from your SQL table. To actually copy a class would require copying the annotations (not too hard) but also the equivalent_to and is_a, which could involve following a bunch of blank nodes through the table.
Also I don't quite get the relation of the classes to the ontology itself. something I saw somewhere in the code suggested that classes were exclusively owned by an ontology, which might make such a move difficult (although for my purpose if I knew it was being moved, I'd just be careful not to save the original ontology after I started pilfering it for parts). I also saw a warning about the blank nodes relative to an ontology, but as I don't get the whole structure here that has me puzzled.
What I would love to have to solve the problem I want to solve would be a shallow clone function. I believe if the clone function for a class copied the annotation properties and the equivalent_to and is_a to another ontology that would handle the class case. I haven't investigated the properties yet, but it would seem to me that if it cloned the annotations, all the types (to pick up functional, transitive etc) its superproperties and the domain and ranges (which unfortunately could be complex class expressions as well) and the data types, that would do it.
If you want to respond directly to me to discuss this further:
mccomb@semanticarts.com