Package org.apache.graphar.graphinfo
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GraphInfo.Static
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Result<StdSharedPtr<GraphInfo>>
addEdge(StdSharedPtr<EdgeInfo> edgeInfo)
Adds an edge info to the GraphInfo instance and returns a new GraphInfo.Result<StdSharedPtr<GraphInfo>>
addVertex(StdSharedPtr<VertexInfo> vertexInfo)
Adds a vertex info to the GraphInfo instance and returns a new GraphInfo.Result<StdString>
dump()
Returns the graph info as a YAML formatted string.StdSharedPtr<EdgeInfo>
getEdgeInfo(StdString srcLabel, StdString edgeLabel, StdString dstLabel)
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.StdSharedPtr<EdgeInfo>
getEdgeInfoByIndex(int index)
@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.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.StdVector<StdSharedPtr<EdgeInfo>>
getEdgeInfos()
Get the edge infos of graph infoStdSharedPtr<InfoVersion>
getInfoVersion()
StdString
getName()
Get the name of the graph.StdString
getPrefix()
Get the absolute path prefix of the chunk files.StdSharedPtr<VertexInfo>
getVertexInfo(StdString label)
default StdSharedPtr<VertexInfo>
getVertexInfo(String label)
Get the vertex info with the given label.StdSharedPtr<VertexInfo>
getVertexInfoByIndex(int index)
@com.alibaba.fastffi.FFINameAlias("GetVertexInfoIndex") int
getVertexInfoIndex(StdString label)
Get the vertex info index with the given label.default int
getVertexInfoIndex(String label)
Get the vertex info index with the given label.StdVector<StdSharedPtr<VertexInfo>>
getVertexInfos()
Get the vertex infos of graph info@com.alibaba.fastffi.FFINameAlias("IsValidated") boolean
isValidated()
Returns whether the graph info is validated.static Result<StdSharedPtr<GraphInfo>>
load(String path)
Loads the input file as a `GraphInfo` instance.Status
save(StdString path)
Saves the graph info to a YAML file.
-
-
-
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.
-
getVertexInfos
StdVector<StdSharedPtr<VertexInfo>> getVertexInfos()
Get the vertex infos of graph info- Returns:
- vertex infos of graph info
-
getEdgeInfos
StdVector<StdSharedPtr<EdgeInfo>> getEdgeInfos()
Get the edge infos of graph info- Returns:
- edge infos of graph info
-
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.
-
getVertexInfo
StdSharedPtr<VertexInfo> getVertexInfo(StdString label)
-
getEdgeInfo
StdSharedPtr<EdgeInfo> getEdgeInfo(StdString srcLabel, StdString edgeLabel, StdString dstLabel)
-
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.
-
getVertexInfoByIndex
StdSharedPtr<VertexInfo> getVertexInfoByIndex(int index)
-
getEdgeInfoByIndex
StdSharedPtr<EdgeInfo> getEdgeInfoByIndex(int index)
-
getInfoVersion
StdSharedPtr<InfoVersion> getInfoVersion()
-
-