/** * Return a multiunion, initialized with the given graphs. */ public MultiUnion createMultiUnion(Graph[] graphs) { return new MultiUnion(graphs); }
@Override public Graph getUnionGraph() { return new MultiUnion(map(listGraphNodes(), this::getGraph)); }
public static Model withDefaultValueTypeInferences(Model model) { return ModelFactory.createModelForGraph(new MultiUnion(new Graph[] { model.getGraph(), SHACLUtil.createDefaultValueTypesModel(model).getGraph() })); }
public static Model withDefaultValueTypeInferences(Model model) { return ModelFactory.createModelForGraph(new MultiUnion(new Graph[] { model.getGraph(), SHACLUtil.createDefaultValueTypesModel(model).getGraph() })); }
private MultiUnion multi( String a, String b ) { Graph A = graph( a ), B = graph( b ); return new MultiUnion( new Graph[] {A, B} ); }
@Override protected Model openEmptyModel( Assembler a, Resource root, Mode mode ) { checkType( root, JA.UnionModel ); MultiUnion union = new MultiUnion(); union.addGraph( getRootModel( a, root, mode ) ); addSubModels( a, root, union, mode ); return ModelFactory.createModelForGraph( union ); }
private MultiUnion multi( String a, String b ) { Graph A = graph( a ), B = graph( b ); return new MultiUnion( new Graph[] {A, B} ); }
@Override public Graph getGraph() { Graph gBase = graphWith( "" ), g1 = graphWith( "" ); return new MultiUnion( new Graph[] {gBase, g1} ); }
@Override protected Model openEmptyModel( Assembler a, Resource root, Mode mode ) { checkType( root, JA.UnionModel ); MultiUnion union = new MultiUnion(); union.addGraph( getRootModel( a, root, mode ) ); addSubModels( a, root, union, mode ); return ModelFactory.createModelForGraph( union ); }
@Override public Graph getGraph() { Graph gBase = graphWith( "" ), g1 = graphWith( "" ); return new MultiUnion( new Graph[] {gBase, g1} ); }
@Override public void setUp() { gBase = Factory.createDefaultGraph(); g1 = Factory.createDefaultGraph(); g2 = Factory.createDefaultGraph(); poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); poly.setBaseGraph( gBase ); }
@Override protected PrefixMapping getMapping() { Graph gBase = Factory.createDefaultGraph(); Graph g1 = Factory.createDefaultGraph(); Graph g2 = Factory.createDefaultGraph(); Polyadic poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); return new PolyadicPrefixMappingImpl( poly ); }
/** A MultiUnion graph should have a MultiUnionStatisticsHandler, and that handler should point right back to that graph. */ public void testMultiUnionHasMultiUnionStatisticsHandler() { MultiUnion mu = new MultiUnion(); GraphStatisticsHandler sh = mu.getStatisticsHandler(); assertInstanceOf( MultiUnionStatisticsHandler.class, sh ); assertSame( mu, ((MultiUnionStatisticsHandler) sh).getUnion() ); }
/** A MultiUnion graph should have a MultiUnionStatisticsHandler, and that handler should point right back to that graph. */ public void testMultiUnionHasMultiUnionStatisticsHandler() { MultiUnion mu = new MultiUnion(); GraphStatisticsHandler sh = mu.getStatisticsHandler(); assertInstanceOf( MultiUnionStatisticsHandler.class, sh ); assertSame( mu, ((MultiUnionStatisticsHandler) sh).getUnion() ); }
@Override public void setUp() { gBase = Factory.createDefaultGraph(); g1 = Factory.createDefaultGraph(); g2 = Factory.createDefaultGraph(); poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); poly.setBaseGraph( gBase ); }
@Override protected PrefixMapping getMapping() { Graph gBase = Factory.createDefaultGraph(); Graph g1 = Factory.createDefaultGraph(); Graph g2 = Factory.createDefaultGraph(); Polyadic poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); return new PolyadicPrefixMappingImpl( poly ); }
public void testEmptyGraph() { Graph m = new MultiUnion(); Graph g0 = graphWith( "x p y"); assertEquals( "Empty model should have size zero", 0, m.size() ); assertFalse( "Empty model should not contain another graph", m.dependsOn( g0 ) ); }
public void testEmptyGraph() { Graph m = new MultiUnion(); Graph g0 = graphWith( "x p y"); assertEquals( "Empty model should have size zero", 0, m.size() ); assertFalse( "Empty model should not contain another graph", m.dependsOn( g0 ) ); }
public void testContains() { Graph g0 = graphWith( "x p y" ); Graph g1 = graphWith( "x p z; z p zz" ); // disjoint with g0 MultiUnion m = new MultiUnion( new Graph[] {g0, g1} ); assertTrue( "m should contain triple", m.contains( triple( "x p y "))); assertTrue( "m should contain triple", m.contains( triple( "x p z "))); assertTrue( "m should contain triple", m.contains( triple( "z p zz "))); assertFalse( "m should not contain triple", m.contains( triple( "zz p z "))); }
public void testContains() { Graph g0 = graphWith( "x p y" ); Graph g1 = graphWith( "x p z; z p zz" ); // disjoint with g0 MultiUnion m = new MultiUnion( new Graph[] {g0, g1} ); assertTrue( "m should contain triple", m.contains( triple( "x p y "))); assertTrue( "m should contain triple", m.contains( triple( "x p z "))); assertTrue( "m should contain triple", m.contains( triple( "z p zz "))); assertFalse( "m should not contain triple", m.contains( triple( "zz p z "))); }