Merge two OWL Ontology Models using Apache Jena

Merge two OWL Ontology Models using Apache Jena.

Javadoc available at https://www.javatapas.com/docs/javatapas/jena/MergeOwlOntologyModelUsingJena.html


public static OntModel mergeOwlOntologyModelUsingJena(OntModel ontModel1, OntModel ontModel2) {

	Model model = ModelFactory.createUnion(ontModel1, ontModel2);

	OntModel mergedModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, model);

	return mergedModel;

}