Package org.neo4j.gds.api
Interface Graph
-
- All Superinterfaces:
BatchNodeIterable,Degrees,IdMap,NodeIterator,NodePropertyContainer,PartialIdMap,RelationshipIterator,RelationshipPredicate,RelationshipProperties
- All Known Subinterfaces:
CSRGraph
- All Known Implementing Classes:
CSRGraphAdapter,GraphAdapter,HugeGraph,NodeFilteredGraph,UnionGraph
public interface Graph extends IdMap, NodePropertyContainer, Degrees, RelationshipIterator, RelationshipProperties
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.BatchNodeIterable
BatchNodeIterable.BitSetIdIterator, BatchNodeIterable.IdIterable, BatchNodeIterable.IdIterator
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.IdMap
IdMap.NodeLabelConsumer
-
-
Field Summary
-
Fields inherited from interface org.neo4j.gds.api.IdMap
NOT_FOUND, START_NODE_ID
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<NodeFilteredGraph>asNodeFilteredGraph()If this graph is created using a node label filter, this will return a NodeFilteredGraph that represents the node set used in this graph.voidcanRelease(boolean canRelease)GraphconcurrentCopy()booleanhasRelationshipProperty()default booleanisEmpty()booleanisMultiGraph()Whether the graph is guaranteed to have no parallel relationships.default longnthTarget(long sourceNodeId, int offset)Get the n-th target node id for a givensourceNodeId.static longnthTarget(Graph graph, long sourceNodeId, int offset)longrelationshipCount()GraphrelationshipTypeFilteredGraph(java.util.Set<org.neo4j.gds.RelationshipType> relationshipTypes)default voidrelease()Release all resources which are not part of the result or IdMapdefault voidreleaseProperties()Release only the properties associated with that graph.default voidreleaseTopology()Release only the topological data associated with that graph.org.neo4j.gds.api.schema.GraphSchemaschema()-
Methods inherited from interface org.neo4j.gds.api.BatchNodeIterable
batchIterables
-
Methods inherited from interface org.neo4j.gds.api.Degrees
degree, degreeWithoutParallelRelationships
-
Methods inherited from interface org.neo4j.gds.api.IdMap
availableNodeLabels, contains, forEachNodeLabel, hasLabel, highestNeoId, nodeCount, nodeLabels, rootIdMap, safeToMappedNodeId, toOriginalNodeId, toRootNodeId, withFilteredLabels
-
Methods inherited from interface org.neo4j.gds.api.NodeIterator
forEachNode, nodeIterator, nodeIterator
-
Methods inherited from interface org.neo4j.gds.api.properties.nodes.NodePropertyContainer
availableNodeProperties, nodeProperties
-
Methods inherited from interface org.neo4j.gds.api.PartialIdMap
rootNodeCount, toMappedNodeId
-
Methods inherited from interface org.neo4j.gds.api.RelationshipIterator
forEachRelationship, forEachRelationship, streamRelationships
-
Methods inherited from interface org.neo4j.gds.api.RelationshipPredicate
exists
-
Methods inherited from interface org.neo4j.gds.api.RelationshipProperties
relationshipProperty, relationshipProperty
-
-
-
-
Method Detail
-
schema
org.neo4j.gds.api.schema.GraphSchema schema()
-
isEmpty
default boolean isEmpty()
-
relationshipCount
long relationshipCount()
- Returns:
- returns the total number of relationships in the graph.
-
release
default void release()
Release all resources which are not part of the result or IdMap
-
releaseTopology
default void releaseTopology()
Release only the topological data associated with that graph.
-
releaseProperties
default void releaseProperties()
Release only the properties associated with that graph.
-
isMultiGraph
boolean isMultiGraph()
Whether the graph is guaranteed to have no parallel relationships. If this returnsfalseit still may be parallel-free, but we do not know.- Returns:
trueiff the graph has maximum one relationship between each pair of nodes.
-
relationshipTypeFilteredGraph
Graph relationshipTypeFilteredGraph(java.util.Set<org.neo4j.gds.RelationshipType> relationshipTypes)
-
hasRelationshipProperty
boolean hasRelationshipProperty()
-
canRelease
void canRelease(boolean canRelease)
-
concurrentCopy
Graph concurrentCopy()
- Specified by:
concurrentCopyin interfaceRelationshipIterator- Returns:
- a copy of this iterator that reuses new cursors internally, so that iterations happen independent from other iterations.
-
asNodeFilteredGraph
java.util.Optional<NodeFilteredGraph> asNodeFilteredGraph()
If this graph is created using a node label filter, this will return a NodeFilteredGraph that represents the node set used in this graph. Be aware that it is not guaranteed to contain all relationships of the graph. Otherwise, it will return an empty Optional.
-
nthTarget
default long nthTarget(long sourceNodeId, int offset)Get the n-th target node id for a givensourceNodeId. The order of the targets is not defined and depends on the implementation of the graph, but it is consistent across separate calls to this method on the same graph. ThesourceNodeIdmust be a node id existing in the graph. Theoffsetparameter is 0-indexed and must be positive. Ifoffsetis greater than the number of targets forsourceNodeId,-1is returned. It is undefined behavior if thesourceNodeIddoes not exist in the graph or theoffsetis negative.- Parameters:
offset- then-th target to return. Must be positive.- Returns:
- the target at the
offsetor-1if there is no such target.
-
nthTarget
static long nthTarget(Graph graph, long sourceNodeId, int offset)
-
-