Transfer axioms from two ontologies into a third one

20 Views Asked by At

I want to achieve something specific involving ontologies. The task is this:

Scenario

  • I am using LogMap, to achieve some String matching between classes from two specific ontologies. For example, I get a mapping/matching that looks like this:

{ http://purl.obolibrary.org/obo/ENVO_01001140 , http://purl.obolibrary.org/obo/CHEBI_18219 }

In Manchester Syntax a mappings might look like this: O1:C1 equiv O2:C2

  • Now what I want is to create a new class, let's name it "C" for the sake of our example, that would keep/store the mapping. To store it, I will use a HashMap. For example, in our provided example (O1:C1 equiv O2:C2), the HashMap will look like this:

{C} --> {O1:C1,O2:C2}

and based on code format it looks like this:

http://newontology.com/C_0 == {http://purl.obolibrary.org/obo/ENVO_01001479, http://purl.obolibrary.org/obo/ENVO_01001784}

  • Next, I want to create a third ontology, lets call it O3, where it will store the "C" class, which as I said, it would be the mapping between to other classes from two other ontologies. In total I have 1333 mappings.

Problem

Now, my issue is this: How can I pass the axioms where the classes from the two other ontologies are involved? For example, in our example the O1:C1 and O2:C2 classes are involved in some axioms for the O1 and O2. How can I transfer those axioms in my O3?

Approach (maybe...)

My approach is this, tell me if would be correct or it need another approach:

"For every axiom of O1 where class C1 is involved, I would simply replace the C1 with C. I will do the same for every axiom of O2 where class C2 is involved as well."

Is it possible to achieve something like in a simple way? Should I create another class just "for help" or is it possible another way? I am using Java and OWLAPI, if it helps...

Thank you in regards!

This is a pseudo code I have come up with, if it can help:

for (Axiom axiom : O1.axioms) {
    if (axiom.involves(C1)) {
        // Replace occurrences of C1 with C in axiom
        Axiom modifiedAxiom = replaceClass(axiom, C1, C);
        // Add modified axiom to O3
        O3.addAxiom(modifiedAxiom);
    }
}

// Iterate over axioms in O2
for (Axiom axiom : O2.axioms) {
    if (axiom.involves(C2)) {
        // Replace occurrences of C2 with C in axiom
        Axiom modifiedAxiom = replaceClass(axiom, C2, C);
        // Add modified axiom to O3
        O3.addAxiom(modifiedAxiom);
    }
}
0

There are 0 best solutions below