java.lang.Object
org.apache.jena.graph.impl.GraphBase
org.apache.jena.graph.impl.CollectionGraph
- All Implemented Interfaces:
Graph
,GraphWithPerform
A simple graph implementation that wraps a collection of triples.
This is intended to be used in places where a graph is required but
iteration is the only expected operation. All graph operations are supported
but many are not efficient and will be slow on large collections. In these
cases a memory based graph will be more efficient.
This implementation:
- Does not support deleting triples from the iterator
- Does not handle literal typing
-
Field Summary
Fields inherited from class org.apache.jena.graph.impl.GraphBase
TOSTRING_TRIPLE_BASE, TOSTRING_TRIPLE_LIMIT
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty graph using an empty HashSet.CollectionGraph
(Collection<Triple> triples) Construct a graph from a collection. -
Method Summary
Modifier and TypeMethodDescriptionAnswer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable).void
performAdd
(Triple t) Add a triple to the triple store.void
Remove a triple from the triple store.Methods inherited from class org.apache.jena.graph.impl.GraphBase
add, clear, close, contains, contains, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getEventManager, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, remove, size, toString, toString
-
Constructor Details
-
CollectionGraph
public CollectionGraph()Construct an empty graph using an empty HashSet. Iterator deletion is supported. -
CollectionGraph
Construct a graph from a collection. Iterator deletion is not supported.- Parameters:
triples
- The collection of triples.
-
-
Method Details
-
performAdd
Description copied from class:GraphBase
Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples.- Specified by:
performAdd
in interfaceGraphWithPerform
- Overrides:
performAdd
in classGraphBase
-
performDelete
Description copied from class:GraphBase
Remove a triple from the triple store. The default implementation throws a DeleteDeniedException; subclasses must override if they want to be able to remove triples.- Specified by:
performDelete
in interfaceGraphWithPerform
- Overrides:
performDelete
in classGraphBase
-
getCapabilities
Description copied from class:GraphBase
Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable).- Specified by:
getCapabilities
in interfaceGraph
- Overrides:
getCapabilities
in classGraphBase
-