Interface Graph

    • 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.
      • isMultiGraph

        boolean isMultiGraph()
        Whether the graph is guaranteed to have no parallel relationships. If this returns false it still may be parallel-free, but we do not know.
        Returns:
        true iff 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()
      • concurrentCopy

        Graph concurrentCopy()
        Specified by:
        concurrentCopy in interface RelationshipIterator
        Returns:
        a copy of this iterator that reuses new cursors internally, so that iterations happen independent of 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 given sourceNodeId. 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. The sourceNodeId must be a node id existing in the graph. The offset parameter is 0-indexed and must be positive. If offset is greater than the number of targets for sourceNodeId, -1 is returned. It is undefined behavior if the sourceNodeId does not exist in the graph or the offset is negative.
        Parameters:
        offset - the n-th target to return. Must be positive.
        Returns:
        the target at the offset or -1 if there is no such target.