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

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.DatasetGraphTriplesQuads
              extended by com.hp.hpl.jena.sparql.core.DatasetGraphCaching
All Implemented Interfaces:
DatasetGraph, Closeable

public abstract class DatasetGraphCaching
extends DatasetGraphTriplesQuads

DatasetGraph that caches calls to make graph implementations. Useful for storage layers that use triples+quads storage and the graphs are wrappers to the actual storage layer. The cache is finite and graphs will be dropped as needed. DatasetGraphMap provides an implementation which is an extensable collection of graphs.


Method Summary
 void addGraph(com.hp.hpl.jena.graph.Node graphName, com.hp.hpl.jena.graph.Graph graph)
          Add the given graph to the dataset.
 void close()
          Close the dataset
 boolean containsGraph(com.hp.hpl.jena.graph.Node graphNode)
           
 com.hp.hpl.jena.graph.Graph getDefaultGraph()
          Get the default graph as a Jena Graph
 com.hp.hpl.jena.graph.Graph getGraph(com.hp.hpl.jena.graph.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.
 void removeGraph(com.hp.hpl.jena.graph.Node graphName)
          Remove all data associated with the named graph
 
Methods inherited from class com.hp.hpl.jena.sparql.core.DatasetGraphTriplesQuads
add, add, delete, 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
contains, contains, deleteAny, find, find, getContext, getLock, isEmpty, setDefaultGraph, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.sparql.core.DatasetGraph
listGraphNodes
 

Method Detail

containsGraph

public boolean containsGraph(com.hp.hpl.jena.graph.Node graphNode)
Specified by:
containsGraph in interface DatasetGraph
Overrides:
containsGraph in class DatasetGraphBase

getDefaultGraph

public final com.hp.hpl.jena.graph.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 final com.hp.hpl.jena.graph.Graph getGraph(com.hp.hpl.jena.graph.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(com.hp.hpl.jena.graph.Node graphName,
                     com.hp.hpl.jena.graph.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
Overrides:
addGraph in class DatasetGraphBase

removeGraph

public final void removeGraph(com.hp.hpl.jena.graph.Node graphName)
Description copied from interface: DatasetGraph
Remove all data associated with the named graph

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

close

public void close()
Description copied from interface: DatasetGraph
Close the dataset

Specified by:
close in interface DatasetGraph
Specified by:
close in interface Closeable
Overrides:
close in class DatasetGraphBase


Licenced under the Apache License, Version 2.0