All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.owlapi.util.ImportsClosureComparator Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package org.protege.owlapi.util;

import java.util.Comparator;

import org.semanticweb.owlapi.model.OWLOntology;

public class ImportsClosureComparator implements Comparator {

	public int compare(OWLOntology o1, OWLOntology o2) {
		boolean o1ImportsO2 = o1.getImportsClosure().contains(o2);
		boolean o2ImportsO1 = o2.getImportsClosure().contains(o1);
		if (o1ImportsO2 && !o2ImportsO1) {
			return 1;
		}
		else if (o2ImportsO1 && !o1ImportsO2) {
			return -1;
		}
		else {
			return o1.compareTo(o2);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy