Package org.apache.graphar.graphinfo
Interface EdgeInfo
-
- All Superinterfaces:
com.alibaba.fastffi.CXXPointer
,com.alibaba.fastffi.FFIPointer
,com.alibaba.fastffi.FFIType
public interface EdgeInfo extends com.alibaba.fastffi.CXXPointer
EdgeInfo is a class that stores metadata information about an edge.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
EdgeInfo.Static
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Result<StdSharedPtr<EdgeInfo>>
addAdjacentList(StdSharedPtr<AdjacentList> adjList)
Result<StdSharedPtr<EdgeInfo>>
addPropertyGroup(StdSharedPtr<PropertyGroup> propertyGroup)
Add a property group to edge info for the given adjacency list type.Result<StdString>
dump()
Returns the edge info as a YAML formatted string.StdSharedPtr<AdjacentList>
getAdjacentList(AdjListType adjListType)
Result<StdString>
getAdjListFilePath(@com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long vertexChunkIndex, @com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long edgeChunkIndex, AdjListType adjListType)
Get the file path of adj list topology chunkResult<StdString>
getAdjListOffsetFilePath(@com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long vertexChunkIndex, AdjListType adjListType)
Get the adjacency list offset chunk file path of vertex chunk the offset chunks is aligned with the vertex chunksResult<StdString>
getAdjListPathPrefix(AdjListType adjListType)
Get the path prefix of the adjacency list topology chunk for the given adjacency list type.@com.alibaba.fastffi.FFINameAlias("GetChunkSize"),@com.alibaba.fastffi.CXXValue long
getChunkSize()
Get the number of edges in each edge chunk.@com.alibaba.fastffi.FFINameAlias("GetDstChunkSize"),@com.alibaba.fastffi.CXXValue long
getDstChunkSize()
Get the number of destination vertices in each vertex chunk.StdString
getDstLabel()
Get the label of the destination vertex.StdString
getEdgeLabel()
Get the label of the edge.Result<StdString>
getEdgesNumFilePath(@com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long vertexChunkIndex, AdjListType adjListType)
Get the file path for the number of edges.Result<StdString>
getOffsetPathPrefix(AdjListType adjListType)
Get the path prefix of the adjacency list offset chunk for the given adjacency list type.StdString
getPrefix()
Get the path prefix of the edge.Result<StdString>
getPropertyFilePath(StdSharedPtr<PropertyGroup> propertyGroup, AdjListType adjListType, @com.alibaba.fastffi.FFINameAlias("graphar::IdType") long vertexChunkIndex, @com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long edgeChunkIndex)
Get the chunk file path of adj list property group the property group chunks is aligned with the adj list topology chunksStdSharedPtr<PropertyGroup>
getPropertyGroup(StdString property)
Get the property group containing the given property.Result<StdString>
getPropertyGroupPathPrefix(StdSharedPtr<PropertyGroup> propertyGroup, AdjListType adjListType)
Get the path prefix of the property group chunk for the given adjacency list type.StdVector<StdSharedPtr<PropertyGroup>>
getPropertyGroups()
Get the property groups.Result<StdSharedPtr<DataType>>
getPropertyType(StdString propertyName)
Get the data type of the specified property.@com.alibaba.fastffi.FFINameAlias("GetSrcChunkSize"),@com.alibaba.fastffi.CXXValue long
getSrcChunkSize()
Get the number of source vertices in each vertex chunk.StdString
getSrcLabel()
Get the label of the source vertex.StdSharedPtr<InfoVersion>
getVersion()
Get the version info of the edge.Result<StdString>
getVerticesNumFilePath(AdjListType adjListType)
Get the file path for the number of vertices.@com.alibaba.fastffi.FFINameAlias("HasAdjacentListType") boolean
hasAdjacentListType(AdjListType adjListType)
Return whether the edge info contains the adjacency list information.@com.alibaba.fastffi.FFINameAlias("HasPropertyGroup") boolean
hasPropertyGroup(StdSharedPtr<PropertyGroup> propertyGroup)
Returns whether the edge info contains the given property group for the specified adjacency list type.@com.alibaba.fastffi.FFINameAlias("HasProperty") boolean
hasPropertyGroup(StdString property)
Returns whether the edge info contains the given property for any adjacency list type.@com.alibaba.fastffi.FFINameAlias("IsDirected") boolean
isDirected()
Returns whether the edge is directed.@com.alibaba.fastffi.FFINameAlias("IsPrimaryKey"),@com.alibaba.fastffi.CXXValue boolean
isPrimaryKey(StdString propertyName)
Returns whether the specified property is a primary key.@com.alibaba.fastffi.FFINameAlias("IsValidated") boolean
isValidated()
Returns whether the edge info is validated.static Result<StdSharedPtr<EdgeInfo>>
load(StdSharedPtr<Yaml> yaml)
Status
save(StdString fileName)
Saves the edge info to a YAML file.
-
-
-
Method Detail
-
addAdjacentList
Result<StdSharedPtr<EdgeInfo>> addAdjacentList(StdSharedPtr<AdjacentList> adjList)
-
addPropertyGroup
Result<StdSharedPtr<EdgeInfo>> addPropertyGroup(StdSharedPtr<PropertyGroup> propertyGroup)
Add a property group to edge info for the given adjacency list type.
-
getSrcLabel
StdString getSrcLabel()
Get the label of the source vertex.- Returns:
- The label of the source vertex.
-
getEdgeLabel
StdString getEdgeLabel()
Get the label of the edge.- Returns:
- The label of the edge.
-
getDstLabel
StdString getDstLabel()
Get the label of the destination vertex.- Returns:
- The label of the destination vertex.
-
getChunkSize
@com.alibaba.fastffi.FFINameAlias("GetChunkSize"),@com.alibaba.fastffi.CXXValue long getChunkSize()
Get the number of edges in each edge chunk.- Returns:
- The number of edges in each edge chunk.
-
getSrcChunkSize
@com.alibaba.fastffi.FFINameAlias("GetSrcChunkSize"),@com.alibaba.fastffi.CXXValue long getSrcChunkSize()
Get the number of source vertices in each vertex chunk.- Returns:
- The number of source vertices in each vertex chunk.
-
getDstChunkSize
@com.alibaba.fastffi.FFINameAlias("GetDstChunkSize"),@com.alibaba.fastffi.CXXValue long getDstChunkSize()
Get the number of destination vertices in each vertex chunk.- Returns:
- The number of destination vertices in each vertex chunk.
-
getPrefix
StdString getPrefix()
Get the path prefix of the edge.- Returns:
- The path prefix of the edge.
-
isDirected
@com.alibaba.fastffi.FFINameAlias("IsDirected") boolean isDirected()
Returns whether the edge is directed.- Returns:
- True if the edge is directed, false otherwise.
-
getVersion
StdSharedPtr<InfoVersion> getVersion()
Get the version info of the edge.- Returns:
- The version info of the edge.
-
hasAdjacentListType
@com.alibaba.fastffi.FFINameAlias("HasAdjacentListType") boolean hasAdjacentListType(AdjListType adjListType)
Return whether the edge info contains the adjacency list information.- Parameters:
adjListType
- The adjacency list type.- Returns:
- True if the edge info contains the adjacency list information, false otherwise.
-
hasPropertyGroup
@com.alibaba.fastffi.FFINameAlias("HasPropertyGroup") boolean hasPropertyGroup(StdSharedPtr<PropertyGroup> propertyGroup)
Returns whether the edge info contains the given property group for the specified adjacency list type.- Parameters:
propertyGroup
- Property group to check.- Returns:
- True if the edge info contains the property group, false otherwise.
-
hasPropertyGroup
@com.alibaba.fastffi.FFINameAlias("HasProperty") boolean hasPropertyGroup(StdString property)
Returns whether the edge info contains the given property for any adjacency list type.- Parameters:
property
- Property name to check.- Returns:
- True if the edge info contains the property, false otherwise.
-
getAdjacentList
StdSharedPtr<AdjacentList> getAdjacentList(AdjListType adjListType)
-
getPropertyGroups
StdVector<StdSharedPtr<PropertyGroup>> getPropertyGroups()
Get the property groups.
-
getPropertyGroup
StdSharedPtr<PropertyGroup> getPropertyGroup(StdString property)
Get the property group containing the given property.- Parameters:
property
- Property name.- Returns:
- Property group may be nullptr if the property is not found.
-
getVerticesNumFilePath
Result<StdString> getVerticesNumFilePath(AdjListType adjListType)
Get the file path for the number of vertices.- Parameters:
adjListType
- The adjacency list type.- Returns:
- A Result object containing the file path for the number of edges, or a Status object indicating an error.
-
getEdgesNumFilePath
Result<StdString> getEdgesNumFilePath(@com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long vertexChunkIndex, AdjListType adjListType)
Get the file path for the number of edges.- Parameters:
vertexChunkIndex
- the vertex chunk indexadjListType
- The adjacency list type.- Returns:
- A Result object containing the file path for the number of edges, or a Status object indicating an error.
-
getAdjListFilePath
Result<StdString> getAdjListFilePath(@com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long vertexChunkIndex, @com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long edgeChunkIndex, AdjListType adjListType)
Get the file path of adj list topology chunk- Parameters:
vertexChunkIndex
- the vertex chunk indexedgeChunkIndex
- index of edge adj list chunk of the vertex chunkadjListType
- The adjacency list type.
-
getAdjListPathPrefix
Result<StdString> getAdjListPathPrefix(AdjListType adjListType)
Get the path prefix of the adjacency list topology chunk for the given adjacency list type.- Parameters:
adjListType
- The adjacency list type.- Returns:
- A Result object containing the directory, or a Status object indicating an error.
-
getAdjListOffsetFilePath
Result<StdString> getAdjListOffsetFilePath(@com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long vertexChunkIndex, AdjListType adjListType)
Get the adjacency list offset chunk file path of vertex chunk the offset chunks is aligned with the vertex chunks- Parameters:
vertexChunkIndex
- index of vertex chunkadjListType
- The adjacency list type.
-
getOffsetPathPrefix
Result<StdString> getOffsetPathPrefix(AdjListType adjListType)
Get the path prefix of the adjacency list offset chunk for the given adjacency list type.- Parameters:
adjListType
- The adjacency list type.- Returns:
- A Result object containing the path prefix, or a Status object indicating an error.
-
getPropertyFilePath
Result<StdString> getPropertyFilePath(StdSharedPtr<PropertyGroup> propertyGroup, AdjListType adjListType, @com.alibaba.fastffi.FFINameAlias("graphar::IdType") long vertexChunkIndex, @com.alibaba.fastffi.FFITypeAlias("graphar::IdType") long edgeChunkIndex)
Get the chunk file path of adj list property group the property group chunks is aligned with the adj list topology chunks- Parameters:
propertyGroup
- property groupadjListType
- adj list type that the property group belongs tovertexChunkIndex
- the vertex chunk indexedgeChunkIndex
- index of edge property group chunk of the vertex chunk
-
getPropertyGroupPathPrefix
Result<StdString> getPropertyGroupPathPrefix(StdSharedPtr<PropertyGroup> propertyGroup, AdjListType adjListType)
Get the path prefix of the property group chunk for the given adjacency list type.- Parameters:
propertyGroup
- property group.adjListType
- The adjacency list type.- Returns:
- A Result object containing the path prefix, or a Status object indicating an error.
-
getPropertyType
Result<StdSharedPtr<DataType>> getPropertyType(StdString propertyName)
Get the data type of the specified property.- Parameters:
propertyName
- The name of the property.- Returns:
- A Result object containing the data type of the property, or a KeyError Status object if the property is not found.
-
isPrimaryKey
@com.alibaba.fastffi.FFINameAlias("IsPrimaryKey"),@com.alibaba.fastffi.CXXValue boolean isPrimaryKey(StdString propertyName)
Returns whether the specified property is a primary key.- Parameters:
propertyName
- The name of the property.- Returns:
- A Result object containing a bool indicating whether the property is a primary key, or a KeyError Status object if the property is not found.
-
save
Status save(StdString fileName)
Saves the edge info to a YAML file.- Parameters:
fileName
- The name of the file to save to.- Returns:
- A Status object indicating success or failure.
-
dump
Result<StdString> dump()
Returns the edge 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 edge info is validated.- Returns:
- True if the edge info is valid, False otherwise.
-
load
static Result<StdSharedPtr<EdgeInfo>> load(StdSharedPtr<Yaml> yaml)
-
-