com.hp.hpl.jena.sparql.core
Class DatasetGraphAltDefaultGraph

java.lang.Object
  extended by com.hp.hpl.jena.sparql.core.DatasetGraphBase
      extended by com.hp.hpl.jena.sparql.core.DatasetGraphBaseFind
          extended by com.hp.hpl.jena.sparql.core.DatasetGraphCollection
              extended by com.hp.hpl.jena.sparql.core.DatasetGraphAltDefaultGraph
All Implemented Interfaces:
DatasetGraph, Closeable

public class DatasetGraphAltDefaultGraph
extends DatasetGraphCollection

DatasetGraph that switch teh default graph to another graph. This different graph can be one of the underlying dataset or a completely unconnected graph.


Constructor Summary
DatasetGraphAltDefaultGraph(DatasetGraph dsg, Graph defaultGraph)
           
 
Method Summary
 void addGraph(Node graphName, Graph graph)
          Add the given graph to the dataset.
 Graph getDefaultGraph()
          Get the default graph as a Jena Graph
 Graph getGraph(Node graphNode)
          Get the graph named by graphNode : returns null on no graph NB Whether a dataset contains a graph if there are no triples is not defined - see the specifc implementation.
 Iterator<Node> listGraphNodes()
          Iterate over all names of named graphs
 void removeGraph(Node graphName)
          Remove all data associated with the named graph
 
Methods inherited from class com.hp.hpl.jena.sparql.core.DatasetGraphCollection
add, delete
 
Methods inherited from class com.hp.hpl.jena.sparql.core.DatasetGraphBaseFind
find, findNG
 
Methods inherited from class com.hp.hpl.jena.sparql.core.DatasetGraphBase
add, close, contains, contains, containsGraph, delete, deleteAny, find, find, getContext, getLock, isEmpty, setDefaultGraph, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatasetGraphAltDefaultGraph

public DatasetGraphAltDefaultGraph(DatasetGraph dsg,
                                   Graph defaultGraph)
Method Detail

listGraphNodes

public Iterator<Node> listGraphNodes()
Description copied from interface: DatasetGraph
Iterate over all names of named graphs

Specified by:
listGraphNodes in interface DatasetGraph
Specified by:
listGraphNodes in class DatasetGraphCollection

getDefaultGraph

public Graph getDefaultGraph()
Description copied from interface: DatasetGraph
Get the default graph as a Jena Graph

Specified by:
getDefaultGraph in interface DatasetGraph
Specified by:
getDefaultGraph in class DatasetGraphBase

getGraph

public Graph getGraph(Node graphNode)
Description copied from interface: DatasetGraph
Get the graph named by graphNode : returns null on no graph NB Whether a dataset contains a graph if there are no triples is not defined - see the specifc implementation. Some datasets are "open" - they have all graphs even if no triples,

Specified by:
getGraph in interface DatasetGraph
Specified by:
getGraph in class DatasetGraphBase

addGraph

public void addGraph(Node graphName,
                     Graph graph)
Description copied from interface: DatasetGraph
Add the given graph to the dataset. Replaces any existing data for the named graph; to add data, get the graph and add triples to it, or add quads to the dataset. Do not assume that the same Java object is returned by DatasetGraph.getGraph(com.hp.hpl.jena.graph.Node)

Specified by:
addGraph in interface DatasetGraph
Specified by:
addGraph in class DatasetGraphBase

removeGraph

public void removeGraph(Node graphName)
Description copied from interface: DatasetGraph
Remove all data associated with the named graph

Specified by:
removeGraph in interface DatasetGraph
Specified by:
removeGraph in class DatasetGraphBase


Licenced under the Apache License, Version 2.0