de.fuberlin.wiwiss.ng4j.impl
Class NamedGraphImpl

java.lang.Object
  extended by de.fuberlin.wiwiss.ng4j.impl.NamedGraphImpl
All Implemented Interfaces:
Graph, GraphAdd, NamedGraph
Direct Known Subclasses:
SWPNamedGraphImpl

public class NamedGraphImpl
extends Object
implements NamedGraph

NamedGraph implementation that wraps a Graph instance and a name for that graph. All methods inherited from the Graph interface are delegated to the underlying Graph instance.

NamedGraph instances can be created from any Jena Graph instance, or by calling NamedGraphSet.createGraph(Node) on a NamedGraphSet.

TODO: Implement equals, but with what semantics?

Author:
Chris Bizer, Richard Cyganiak (richard@cyganiak.de)
See Also:
Graph, NamedGraphSet.createGraph(Node)

Field Summary
 
Fields inherited from interface com.hp.hpl.jena.graph.Graph
emptyGraph
 
Constructor Summary
NamedGraphImpl(Node graphName, Graph graph)
          Creates a NamedGraph from a Graph instance and a name.
NamedGraphImpl(String graphNameURI, Graph graph)
          Creates a NamedGraph from a Graph instance and a name.
 
Method Summary
 void add(Triple t)
           
 void close()
           
 boolean contains(Node s, Node p, Node o)
           
 boolean contains(Triple t)
           
 void delete(Triple t)
           
 boolean dependsOn(Graph other)
           
 ExtendedIterator find(Node s, Node p, Node o)
           
 ExtendedIterator find(TripleMatch m)
           
 BulkUpdateHandler getBulkUpdateHandler()
           
 Capabilities getCapabilities()
           
 GraphEventManager getEventManager()
           
 Node getGraphName()
          Returns the URI of the named graph.
 PrefixMapping getPrefixMapping()
           
 Reifier getReifier()
           
 TransactionHandler getTransactionHandler()
           
 boolean isClosed()
           
 boolean isEmpty()
           
 boolean isIsomorphicWith(Graph g)
           
 QueryHandler queryHandler()
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedGraphImpl

public NamedGraphImpl(Node graphName,
                      Graph graph)
Creates a NamedGraph from a Graph instance and a name. The name must be an URI.

Parameters:
graphName - a name for the graph; must be an URI Node
graph - a graph instance
See Also:
NamedGraphSet.createGraph(Node)

NamedGraphImpl

public NamedGraphImpl(String graphNameURI,
                      Graph graph)
Creates a NamedGraph from a Graph instance and a name.

Parameters:
graphNameURI - a name for the graph; must be an URI
graph - a graph instance
See Also:
NamedGraphSet.createGraph(Node)
Method Detail

getGraphName

public Node getGraphName()
Returns the URI of the named graph. The returned Node instance is always an URI and cannot be a blank node or literal.

Specified by:
getGraphName in interface NamedGraph

close

public void close()
Specified by:
close in interface Graph

isClosed

public boolean isClosed()
Specified by:
isClosed in interface Graph

contains

public boolean contains(Node s,
                        Node p,
                        Node o)
Specified by:
contains in interface Graph

contains

public boolean contains(Triple t)
Specified by:
contains in interface Graph

delete

public void delete(Triple t)
            throws DeleteDeniedException
Specified by:
delete in interface Graph
Throws:
DeleteDeniedException

dependsOn

public boolean dependsOn(Graph other)
Specified by:
dependsOn in interface Graph

find

public ExtendedIterator find(Node s,
                             Node p,
                             Node o)
Specified by:
find in interface Graph

find

public ExtendedIterator find(TripleMatch m)
Specified by:
find in interface Graph

getBulkUpdateHandler

public BulkUpdateHandler getBulkUpdateHandler()
Specified by:
getBulkUpdateHandler in interface Graph

getCapabilities

public Capabilities getCapabilities()
Specified by:
getCapabilities in interface Graph

getEventManager

public GraphEventManager getEventManager()
Specified by:
getEventManager in interface Graph

getPrefixMapping

public PrefixMapping getPrefixMapping()
Specified by:
getPrefixMapping in interface Graph

getReifier

public Reifier getReifier()
Specified by:
getReifier in interface Graph

getTransactionHandler

public TransactionHandler getTransactionHandler()
Specified by:
getTransactionHandler in interface Graph

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Graph

isIsomorphicWith

public boolean isIsomorphicWith(Graph g)
Specified by:
isIsomorphicWith in interface Graph

queryHandler

public QueryHandler queryHandler()
Specified by:
queryHandler in interface Graph

size

public int size()
Specified by:
size in interface Graph

add

public void add(Triple t)
         throws AddDeniedException
Specified by:
add in interface GraphAdd
Throws:
AddDeniedException

toString

public String toString()
Overrides:
toString in class Object