public static Model createIncludesModel(Model model,String graphURI){
  Set<Graph> graphs=new HashSet<Graph>();
  Graph baseGraph=model.getGraph();
  addIncludes(baseGraph,graphURI,graphs,new HashSet<String>());
  if (graphs.size() == 1) {
    return model;
  }
 else {
    MultiUnion union=new MultiUnion(graphs.iterator());
    union.setBaseGraph(baseGraph);
    return ModelFactory.createModelForGraph(union);
  }
}

public static Model createIncludesModel ( Model model , String graphURI ) { Set < Graph > graphs = new HashSet < Graph > ( ) ; Graph baseGraph = model . getGraph ( ) ; addIncludes ( baseGraph , graphURI , graphs , new HashSet < String > ( ) ) ; if ( graphs . size ( ) == 1 ) { return model ; } else { MultiUnion union = new MultiUnion ( graphs . iterator ( ) ) ; union . setBaseGraph ( baseGraph ) ; return ModelFactory . createModelForGraph ( union ) ; } }
creates an includes model for a given input model . the includes model is the union of the input model will all graphs linked via sh : include ( or owl : imports ) , transitively .
