@Override protected PrefixMapping createPrefixMapping() { return new PolyadicPrefixMappingImpl( this ); }
/** * Return true if a given graph is an inference graph * @param g A graph * @return True if the graph is an inference graph, or is a union with an inference * base graph */ public boolean isInferenceGraph( Graph g ) { return (g instanceof InfGraph) || (g instanceof Polyadic && ((Polyadic) g).getBaseGraph() instanceof InfGraph); } }
/** * Return a multiunion, initialized with the given graphs. */ public MultiUnion createMultiUnion(Iterator<Graph> graphs) { return new MultiUnion(graphs); }
/** 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 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 ); }
@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 public TransactionHandler getTransactionHandler() { return (getBaseGraph() == null) ? super.getTransactionHandler() : getBaseGraph().getTransactionHandler(); }
@Override public Capabilities getCapabilities() { return (getBaseGraph() == null) ? super.getCapabilities() : getBaseGraph().getCapabilities(); }
public static Graph getBaseGraph(Graph graph) { Graph baseGraph = graph; while(baseGraph instanceof MultiUnion) { baseGraph = ((MultiUnion)baseGraph).getBaseGraph(); } return baseGraph; }
/** 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() ); }
/** * Return a multiunion, initialized with the given graphs. */ public MultiUnion createMultiUnion(Graph[] graphs) { return new MultiUnion(graphs); }
@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 ); }
@Override public void setUp() { gBase = Factory.createDefaultGraph(); g1 = Factory.createDefaultGraph(); g2 = Factory.createDefaultGraph(); poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); poly.setBaseGraph( gBase ); }
/** * Return true if a given graph is an inference graph * @param g A graph * @return True if the graph is an inference graph, or is a union with an inference * base graph */ public boolean isInferenceGraph( Graph g ) { return (g instanceof InfGraph) || (g instanceof Polyadic && ((Polyadic) g).getBaseGraph() instanceof InfGraph); } }
public static Graph getBaseGraph(Graph graph) { Graph baseGraph = graph; while(baseGraph instanceof MultiUnion) { baseGraph = ((MultiUnion)baseGraph).getBaseGraph(); } return baseGraph; }
@Override protected PrefixMapping createPrefixMapping() { return new PolyadicPrefixMappingImpl( this ); }
/** * Return a multiunion, initialized with the given graphs. */ public MultiUnion createMultiUnion(Iterator<Graph> graphs) { return new MultiUnion(graphs); }
/** * Return a multiunion, initialized with the given graphs. */ public MultiUnion createMultiUnion(Graph[] graphs) { return new MultiUnion(graphs); }
/** * Return a multiunion. */ public MultiUnion createMultiUnion() { return new MultiUnion(); }
/** * Return a multiunion. */ public MultiUnion createMultiUnion() { return new MultiUnion(); }