/** * Wraps the supplied <code>graph</code> into a new input source. No origin will be set. * * @param graph * the RDF graph * @throws IllegalArgumentException * if <code>graph</code> is neither a {@link ImmutableGraph} nor a {@link Graph}. */ public GraphSource(Graph graph) { if (graph instanceof ImmutableGraph) bindRootOntology(graph); else if (graph instanceof Graph) bindRootOntology(((Graph) graph).getImmutableGraph()); else throw new IllegalArgumentException("GraphSource supports only ImmutableGraph and Graph types. " + graph.getClass() + " is not supported."); bindPhysicalOrigin(null); }
/** * Creates a new input source by querying the supplied triple collection provider for a graph named with * the supplied <code>graphId</code>. The supplied ID will also be set as the graph origin. * * @param graphId * the graph ID. * @throws NullPointerException * if <code>tcProvider</code> is null. * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException * if no such graph can be found in <code>tcProvider</code>. */ public GraphSource(IRI graphId, TcProvider tcProvider) { this(tcProvider.getGraph(graphId)); bindPhysicalOrigin(Origin.create(graphId)); }
/** * Wraps the supplied <code>graph</code> into a new input source. No origin will be set. * * @param graph * the RDF graph * @throws IllegalArgumentException * if <code>graph</code> is neither a {@link ImmutableGraph} nor a {@link Graph}. */ public GraphSource(Graph graph) { if (graph instanceof ImmutableGraph) bindRootOntology(graph); else if (graph instanceof Graph) bindRootOntology(((Graph) graph).getImmutableGraph()); else throw new IllegalArgumentException("GraphSource supports only ImmutableGraph and Graph types. " + graph.getClass() + " is not supported."); bindPhysicalOrigin(null); }
/** * Creates a new input source by querying the supplied triple collection provider for a graph named with * the supplied <code>graphId</code>. The supplied ID will also be set as the graph origin. * * @param graphId * the graph ID. * @throws NullPointerException * if <code>tcProvider</code> is null. * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException * if no such graph can be found in <code>tcProvider</code>. */ public GraphSource(IRI graphId, TcProvider tcProvider) { this(tcProvider.getGraph(graphId)); bindPhysicalOrigin(Origin.create(graphId)); }