Set<IOntologyConcept> roots = SetHelper.INSTANCE.setUnion(firstGraph.getRoots(), SetHelper.INSTANCE.setIntersection(secondGraph.getRoots(), secondConcepts));
HashMap<IRI, IOntologyConcept> uriToConcept = new HashMap<IRI, IOntologyConcept>(firstGraph.getUriToConcept());
for (IOntologyConcept second : secondConcepts) {
uriToConcept.put(second.getUri(), second);
}
return new OntologyGraph(roots, uriToConcept, null, null, null);
}