001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019package org.apache.commons.rdf.jena;
020
021import org.apache.commons.rdf.api.Dataset;
022import org.apache.commons.rdf.api.Graph;
023import org.apache.jena.sparql.core.DatasetGraph;
024
025/**
026 * A Jena-backed {@link Dataset}.
027 * <p>
028 * The underlying Jena {@link DatasetGraph} can be accessed with
029 * {@link #asJenaDatasetGraph()}.
030 */
031public interface JenaDataset extends Dataset {
032
033    /**
034     * Return the underlying Jena {@link DatasetGraph}.
035     * <p>
036     * Changes to the Jena <em>dataset graph</em> are reflected in the Commons
037     * RDF dataset and vice versa.
038     *
039     * @return A Jena {@link DatasetGraph}
040     */
041    DatasetGraph asJenaDatasetGraph();
042
043    /**
044     * Return a union graph view of this dataset.
045     * <p>
046     * The <em>union graph</em> contains triples in any graph (including the
047     * default graph).
048     * <p>
049     * Changes in the union graph are reflected in the Commons RDF dataset and
050     * vice versa. Triples added to the graph are added to the default graph.
051     *
052     * @return A union {@link Graph}
053     */
054    JenaGraph getUnionGraph();
055
056}