java.lang.Object
org.apache.jena.graph.impl.GraphBase
org.apache.jena.mem.GraphMemBase
org.apache.jena.mem2.GraphMem2
- All Implemented Interfaces:
Graph,GraphWithPerform
- Direct Known Subclasses:
GraphMem2Fast,GraphMem2Legacy,GraphMem2Roaring
A graph that stores triples in memory. This class is not thread-safe.
All triples are stored in a
TripleStore.
Implementation mus always comply to term-equality semantics. The characteristics of the implementations always have handlesLiteralTyping() == false.
-
Field Summary
Fields inherited from class org.apache.jena.graph.impl.GraphBase
TOSTRING_TRIPLE_BASE, TOSTRING_TRIPLE_LIMITFields inherited from interface org.apache.jena.graph.Graph
emptyGraph -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Remove all the statements from this graph.voiddestroy()Subclasses over-ride this method to release any resources they no longer need once fully closed.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).booleangraphBaseContains(Triple tripleMatch) Answer true if the graph contains any triple matchingt.graphBaseFind(Triple tripleMatch) Returns anExtendedIteratorof all triples in the graph matching the given triple match.intAnswer the number of triples in this graph.voidperformAdd(Triple t) Add a triple to the graph without notifying.voidRemove a triple from the triple store.stream()Returns aStreamof all triples in the graph.Returns aStreamof Triples matching a pattern.Methods inherited from class org.apache.jena.mem.GraphMemBase
close, openAgainMethods inherited from class org.apache.jena.graph.impl.GraphBase
add, contains, contains, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getEventManager, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, remove, size, toString, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jena.graph.Graph
add, add, close, contains, contains, delete, delete, dependsOn, find, find, find, getEventManager, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, remove, size
-
Constructor Details
-
GraphMem2
-
-
Method Details
-
destroy
public void destroy()Subclasses over-ride this method to release any resources they no longer need once fully closed. -
clear
public void clear()Remove all the statements from this graph. -
performAdd
Add a triple to the graph without notifying. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples.- Specified by:
performAddin interfaceGraphWithPerform- Overrides:
performAddin classGraphBase- Parameters:
t- triple to add
-
performDelete
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:
performDeletein interfaceGraphWithPerform- Overrides:
performDeletein classGraphBase- Parameters:
t- triple to delete
-
stream
Returns aStreamof all triples in the graph. Note:BaseStream.parallel()is supported. -
stream
Returns aStreamof Triples matching a pattern. Note:BaseStream.parallel()is supported. -
graphBaseFind
Returns anExtendedIteratorof all triples in the graph matching the given triple match. -
graphBaseContains
Answer true if the graph contains any triple matchingt. The default implementation usesfindand checks to see if the iterator is non-empty.- Parameters:
tripleMatch- triple match pattern, which may be contained
-
graphBaseSize
public int graphBaseSize()Answer the number of triples in this graph. Default implementation counts its way through the results of a findAll. Subclasses must override if they want size() to be efficient. -
getCapabilities
Description copied from class:GraphBaseAnswer 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:
getCapabilitiesin interfaceGraph- Overrides:
getCapabilitiesin classGraphBase
-