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

java.lang.Object
  extended by com.hp.hpl.jena.sparql.core.DatasetGraphBase
All Implemented Interfaces:
DatasetGraph, Closeable
Direct Known Subclasses:
DatasetGraphBaseFind, DatasetGraphQuad

public abstract class DatasetGraphBase
extends Object
implements DatasetGraph

DatasetGraph framework : readonly dataset need only provide find(g,s,p,o), getGraph() and getDefaultGraph() although it may wish to override other operations and do better.

Other implementations include:


Method Summary
 void add(com.hp.hpl.jena.graph.Node g, com.hp.hpl.jena.graph.Node s, com.hp.hpl.jena.graph.Node p, com.hp.hpl.jena.graph.Node o)
          Add a quad
 void add(Quad quad)
          Add a quad
 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 contains(com.hp.hpl.jena.graph.Node g, com.hp.hpl.jena.graph.Node s, com.hp.hpl.jena.graph.Node p, com.hp.hpl.jena.graph.Node o)
          Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null
 boolean contains(Quad quad)
          Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null
 boolean containsGraph(com.hp.hpl.jena.graph.Node graphNode)
           
 void delete(com.hp.hpl.jena.graph.Node g, com.hp.hpl.jena.graph.Node s, com.hp.hpl.jena.graph.Node p, com.hp.hpl.jena.graph.Node o)
          Delete a quad
 void delete(Quad quad)
          Delete a quad
 void deleteAny(com.hp.hpl.jena.graph.Node g, com.hp.hpl.jena.graph.Node s, com.hp.hpl.jena.graph.Node p, com.hp.hpl.jena.graph.Node o)
          Delete any quads matching the pattern
 Iterator<Quad> find()
          Iterate over all quads in the dataset graph
 Iterator<Quad> find(Quad quad)
          Find matching quads in the dataset - may include wildcards, Node.ANY or null
 Context getContext()
          Get the context associated with this object - may be null
abstract  com.hp.hpl.jena.graph.Graph getDefaultGraph()
          Get the default graph as a Jena Graph
abstract  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.
 com.hp.hpl.jena.shared.Lock getLock()
          Return a lock for the dataset to help with concurrency control
 boolean isEmpty()
          Test whether the dataset is empty
 void removeGraph(com.hp.hpl.jena.graph.Node graphName)
          Remove all data associated with the named graph
 void setDefaultGraph(com.hp.hpl.jena.graph.Graph g)
          Set the default graph.
 long size()
          Get the size (number of named graphs) - may be -1 for unknown
 String 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
find, findNG, listGraphNodes
 

Method Detail

containsGraph

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

getDefaultGraph

public abstract 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

getGraph

public abstract 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

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

removeGraph

public 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

setDefaultGraph

public void setDefaultGraph(com.hp.hpl.jena.graph.Graph g)
Description copied from interface: DatasetGraph
Set the default graph. Set the active graph if it was null. This replaces the contents default graph, not merge data into it. Do not assume that the same object is returned by DatasetGraph.getDefaultGraph()

Specified by:
setDefaultGraph in interface DatasetGraph

add

public void add(Quad quad)
Description copied from interface: DatasetGraph
Add a quad

Specified by:
add in interface DatasetGraph

delete

public void delete(Quad quad)
Description copied from interface: DatasetGraph
Delete a quad

Specified by:
delete in interface DatasetGraph

add

public void add(com.hp.hpl.jena.graph.Node g,
                com.hp.hpl.jena.graph.Node s,
                com.hp.hpl.jena.graph.Node p,
                com.hp.hpl.jena.graph.Node o)
Description copied from interface: DatasetGraph
Add a quad

Specified by:
add in interface DatasetGraph

delete

public void delete(com.hp.hpl.jena.graph.Node g,
                   com.hp.hpl.jena.graph.Node s,
                   com.hp.hpl.jena.graph.Node p,
                   com.hp.hpl.jena.graph.Node o)
Description copied from interface: DatasetGraph
Delete a quad

Specified by:
delete in interface DatasetGraph

deleteAny

public void deleteAny(com.hp.hpl.jena.graph.Node g,
                      com.hp.hpl.jena.graph.Node s,
                      com.hp.hpl.jena.graph.Node p,
                      com.hp.hpl.jena.graph.Node o)
Description copied from interface: DatasetGraph
Delete any quads matching the pattern

Specified by:
deleteAny in interface DatasetGraph

find

public Iterator<Quad> find()
Description copied from interface: DatasetGraph
Iterate over all quads in the dataset graph

Specified by:
find in interface DatasetGraph

find

public Iterator<Quad> find(Quad quad)
Description copied from interface: DatasetGraph
Find matching quads in the dataset - may include wildcards, Node.ANY or null

Specified by:
find in interface DatasetGraph
See Also:
Graph.find(TripleMatch)

contains

public boolean contains(Quad quad)
Description copied from interface: DatasetGraph
Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null

Specified by:
contains in interface DatasetGraph

contains

public boolean contains(com.hp.hpl.jena.graph.Node g,
                        com.hp.hpl.jena.graph.Node s,
                        com.hp.hpl.jena.graph.Node p,
                        com.hp.hpl.jena.graph.Node o)
Description copied from interface: DatasetGraph
Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null

Specified by:
contains in interface DatasetGraph

isEmpty

public boolean isEmpty()
Description copied from interface: DatasetGraph
Test whether the dataset is empty

Specified by:
isEmpty in interface DatasetGraph

size

public long size()
Description copied from interface: DatasetGraph
Get the size (number of named graphs) - may be -1 for unknown

Specified by:
size in interface DatasetGraph

getLock

public com.hp.hpl.jena.shared.Lock getLock()
Description copied from interface: DatasetGraph
Return a lock for the dataset to help with concurrency control

Specified by:
getLock in interface DatasetGraph
See Also:
Lock

getContext

public Context getContext()
Description copied from interface: DatasetGraph
Get the context associated with this object - may be null

Specified by:
getContext in interface DatasetGraph

close

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

Specified by:
close in interface DatasetGraph
Specified by:
close in interface Closeable

toString

public String toString()
Overrides:
toString in class Object


Licenced under the Apache License, Version 2.0