owlcs / owlapi

OWL API main repository
822 stars 315 forks source link

Partition very large ontologies with Atomic Decomposition #1001

Closed ignazio1977 closed 2 years ago

ignazio1977 commented 3 years ago

Marwa Abdelreheim - 22 hours ago
Hello, I need to partition very large ontologies in bioportal (more than 100 MB). I read that I can do with atomic decomposition. can you refer me to a code snippet for using that library?

ignazio1977 commented 3 years ago

Atomic Decomposition can be used to create sets of principal ideals for each atom in the ontology. This can be seen as a partition, but whether it is suitable for your use case depends on the ontology and on the details of what you need to do with it.

An example on how to create modules following the same approach as the other modularization classes in OWLAPI:

protected Set<OWLAxiom> getADModule1(OWLOntology o, Set<OWLEntity> sig, ModuleType mt) {
    AtomicDecomposition ad = new AtomicDecompositionImpl(o, mt, false);
    return asSet(ad.getModule(sig.stream(), false, mt));
}

Explore the AtomicDecomposition interface for other methods available.

marwa811 commented 3 years ago

Thanks Igbazio for your reply. Actually, I have a problem "run out of memory" when I parse those large ontologies and make some ontology matching tasks (as they are more than 100 MB) and I thought I can find a library than can partition such large files and generate small files and make me set which size I need for each file (example 20 MB) then it partiton based on my settings and generate small files. Is there any library that can do what I need?

Best regards, Marwa