/** * <p> * Remove the given model as one of the sub-models of the enclosed ontology union model. * </p> * * @param model A sub-model to remove * @param rebind If true, rebind any associated inferencing engine to the new data (which * may be an expensive operation) */ @Override public void removeSubModel( Model model, boolean rebind ) { Graph subG = model.getGraph(); getUnionGraph().removeGraph( subG ); // note that it may be the base graph of the given model that was added // originally if (subG instanceof MultiUnion) { // we need to get the base graph when removing a ontmodel getUnionGraph().removeGraph( ((MultiUnion) subG).getBaseGraph() ); } if (rebind) { rebind(); } }
/** * <p> * Remove the given model as one of the sub-models of the enclosed ontology union model. * </p> * * @param model A sub-model to remove * @param rebind If true, rebind any associated inferencing engine to the new data (which * may be an expensive operation) */ @Override public void removeSubModel( Model model, boolean rebind ) { Graph subG = model.getGraph(); getUnionGraph().removeGraph( subG ); // note that it may be the base graph of the given model that was added // originally if (subG instanceof MultiUnion) { // we need to get the base graph when removing a ontmodel getUnionGraph().removeGraph( ((MultiUnion) subG).getBaseGraph() ); } if (rebind) { rebind(); } }
assertEquals( "Size of union of g0, g1 and g2 not correct", s0+s1+s2 -1, m0.size() ); m0.removeGraph( g1 ); assertEquals( "Size of union of g0 and g2 not correct", s0+s2 -1, m0.size() ); m0.removeGraph( g0 ); assertEquals( "Size of union of g2 not correct", s2, m0.size() ); m0.removeGraph( g0 ); assertEquals( "Size of union of g2 not correct", s2, m0.size() ); m0.removeGraph( g2 ); assertEquals( "Size of empty union not correct", 0, m0.size() );
assertEquals( "Size of union of g0, g1 and g2 not correct", s0+s1+s2 -1, m0.size() ); m0.removeGraph( g1 ); assertEquals( "Size of union of g0 and g2 not correct", s0+s2 -1, m0.size() ); m0.removeGraph( g0 ); assertEquals( "Size of union of g2 not correct", s2, m0.size() ); m0.removeGraph( g0 ); assertEquals( "Size of union of g2 not correct", s2, m0.size() ); m0.removeGraph( g2 ); assertEquals( "Size of empty union not correct", 0, m0.size() );