Interface GraphInfo

  • All Superinterfaces:
    com.alibaba.fastffi.CXXPointer, com.alibaba.fastffi.FFIPointer, com.alibaba.fastffi.FFIType

    public interface GraphInfo
    extends com.alibaba.fastffi.CXXPointer
    GraphInfo is a class to store the graph meta information.
    • Method Detail

      • load

        static Result<StdSharedPtr<GraphInfo>> load​(String path)
        Loads the input file as a `GraphInfo` instance.
        Parameters:
        path - The path of the YAML file.
        Returns:
        A Result object containing the GraphInfo instance, or a Status object indicating an error.
      • getVertexInfo

        default StdSharedPtr<VertexInfo> getVertexInfo​(String label)
        Get the vertex info with the given label.
        Parameters:
        label - The label of the vertex.
        Returns:
        A Result object containing the vertex info, or a Status object indicating an error.
      • getEdgeInfo

        default StdSharedPtr<EdgeInfo> getEdgeInfo​(String srcLabel,
                                                   String edgeLabel,
                                                   String dstLabel)
        Get the edge info with the given source vertex label, edge label, and destination vertex label.
        Parameters:
        srcLabel - The label of the source vertex.
        edgeLabel - The label of the edge.
        dstLabel - The label of the destination vertex.
        Returns:
        A Result object containing the edge info, or a Status object indicating an error.
      • getVertexInfoIndex

        default int getVertexInfoIndex​(String label)
        Get the vertex info index with the given label.
      • getEdgeInfoIndex

        default int getEdgeInfoIndex​(String srcLabel,
                                     String edgeLabel,
                                     String dstLabel)
        Get the edge info index with the given source vertex label, edge label, and destination label.
      • addVertex

        Result<StdSharedPtr<GraphInfo>> addVertex​(StdSharedPtr<VertexInfo> vertexInfo)
        Adds a vertex info to the GraphInfo instance and returns a new GraphInfo.
        Parameters:
        vertexInfo - The vertex info to add.
        Returns:
        A Status object indicating the success or failure of the operation. Returns InvalidOperation if the vertex info is already contained.
      • addEdge

        Result<StdSharedPtr<GraphInfo>> addEdge​(StdSharedPtr<EdgeInfo> edgeInfo)
        Adds an edge info to the GraphInfo instance and returns a new GraphInfo.
        Parameters:
        edgeInfo - The edge info to add.
        Returns:
        A Status object indicating the success or failure of the operation. Returns `InvalidOperation` if the edge info is already contained.
      • getName

        StdString getName()
        Get the name of the graph.
        Returns:
        The name of the graph.
      • getPrefix

        StdString getPrefix()
        Get the absolute path prefix of the chunk files.
        Returns:
        The absolute path prefix of the chunk files.
      • save

        Status save​(StdString path)
        Saves the graph info to a YAML file.
        Parameters:
        path - The name of the file to save to.
        Returns:
        A Status object indicating success or failure.
      • dump

        Result<StdString> dump()
        Returns the graph info as a YAML formatted string.
        Returns:
        A Result object containing the YAML string, or a Status object indicating an error.
      • isValidated

        @com.alibaba.fastffi.FFINameAlias("IsValidated") boolean isValidated()
        Returns whether the graph info is validated.
        Returns:
        True if the graph info is valid, False otherwise.
      • getVertexInfoIndex

        @com.alibaba.fastffi.FFINameAlias("GetVertexInfoIndex") int getVertexInfoIndex​(StdString label)
        Get the vertex info index with the given label.
      • getEdgeInfoIndex

        @com.alibaba.fastffi.FFINameAlias("GetEdgeInfoIndex"),@com.alibaba.fastffi.CXXValue int getEdgeInfoIndex​(StdString srcLabel,
                                                                                                                 StdString edgeLabel,
                                                                                                                 StdString dstLabel)
        Get the edge info index with the given source vertex label, edge label, and destination label.