Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Implement Info class for GraphAr spark tool to construct and access the meta information of graph #32

Closed
acezen opened this issue Dec 12, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@acezen
Copy link
Contributor

acezen commented Dec 12, 2022

Is your feature request related to a problem? Please describe.
Implement info classes for GraphAr spark tool. the Info include GraphInfo, VertexInfo and EdgeInfo and align to the classes of c++ SDK.

Describe the solution you'd like
Here is a proposal of the Info classes api:

class Property () {
  @BeanProperty var name: String = ""
  @BeanProperty var data_type: String = ""
  @BeanProperty var is_primary: Boolean = false
}

//methods of Property:
// -- getName: String
// -- getData_type: String
// -- getData_type_in_gar: GarType.Value
// -- getIs_primary: Boolean

class PropertyGroup () {
  @BeanProperty var prefix: String = ""
  @BeanProperty var file_type: String = ""
  @BeanProperty var properties = new java.util.ArrayList[Property]()
}

//methods of PropertyGroup:
// -- getPrefix: String
// -- getFile_type: String
// -- getFile_type_in_gar: FileType.Value
// -- getProperties:  ArrayList[Property]

class AdjList () {
  @BeanProperty var ordered: Boolean = false
  @BeanProperty var aligned_by: String = "src"
  @BeanProperty var prefix: String = ""
  @BeanProperty var file_type: String = ""
  @BeanProperty var property_groups = new java.util.ArrayList[PropertyGroup]()
}

//methods of AdjList:
// -- getOrdered: Boolean
// -- getAligned_by: String
// -- getPrefix: String
// -- getFile_type: String
// -- getFile_type_in_gar: FileType.Value
// -- getAdjList_type: String
// -- getAdjList_type_in_gar: AdjListType.Value
// -- getPropertyGroups: ArrayList[PropertyGroup]

class GraphInfo() {
  @BeanProperty var name: String = ""
  @BeanProperty var prefix: String = ""
  @BeanProperty var vertices = new java.util.ArrayList[String]()
  @BeanProperty var edges = new java.util.ArrayList[String]()
  @BeanProperty var version: String = ""
}

//methods of GraphInfo:
// -- getName: String
// -- getPrefix: String
// -- getVertices: ArrayList[String]
// -- getEdges: ArrayList[String]
// -- getVersion: String

class VertexInfo() {
  @BeanProperty var label: String = ""
  @BeanProperty var chunk_size: Long = 0
  @BeanProperty var prefix: String = ""
  @BeanProperty var property_groups = new java.util.ArrayList[PropertyGroup]()
  @BeanProperty var version: String = ""
}

//methods of VertexInfo:
// -- getLabel: String
// -- getChunk_size: Long
// -- getPrefix: String
// -- getProperty_groups: ArrayList[PropertyGroup]
// -- getVersion: String
// -- containPropertyGroup(property_group: PropertyGroup) : Boolean
// -- containProperty(property_name: String) : Boolean
// -- getPropertyGroup(property_name: String):PropertyGroup
// -- getPropertyType(property_name: String): GarType.Value
// -- isPrimaryKey(property_name: String): Boolean
// -- getPrimaryKey(): String
// -- isValidated(): Boolean
// -- getVerticesNumFilePath(): String
// -- getFilePath(property_group: PropertyGroup, chunk_index: Long): String
// -- getDirPath(property_group: PropertyGroup): String

class EdgeInfo() {
  @BeanProperty var src_label: String = ""
  @BeanProperty var edge_label: String = ""
  @BeanProperty var dst_label: String = ""
  @BeanProperty var chunk_size: Long = 0
  @BeanProperty var src_chunk_size: Long = 0
  @BeanProperty var dst_chunk_size: Long = 0
  @BeanProperty var directed: Boolean = false
  @BeanProperty var prefix: String = ""
  @BeanProperty var adj_lists = new java.util.ArrayList[AdjList]()
  @BeanProperty var version: String = ""
}

//methods of EdgeInfo:
// -- getSrc_label: String
// -- getEdge_label: String
// -- getDst_label: String
// -- getChunk_size: Long
// -- getSrc_chunk_size: Long
// -- getDst_chunk_size: Long
// -- getDirected: Boolean
// -- getPrefix: String
// -- getAdj_lists: ArrayList[AdjList]
// -- containAdjList(adj_list_type: AdjListType.Value): Boolean
// -- getAdjListPrefix(adj_list_type: AdjListType.Value): String
// -- getAdjListFileType(adj_list_type: AdjListType.Value): FileType.Value
// -- containPropertyGroup(property_group: PropertyGroup, adj_list_type: AdjListType.Value) : Boolean
// -- containProperty(property_name: String) : Boolean
// -- getPropertyGroups(adj_list_type: AdjListType.Value): java.util.ArrayList[PropertyGroup]
// -- getPropertyType(property_name: String): GarType.Value
// -- getPropertyGroup(property_name: String, adj_list_type: AdjListType.Value): PropertyGroup 
// -- isPrimaryKey(property_name: String): Boolean
// -- getPrimaryKey(): String
// -- isValidated(): Boolean
// -- getAdjListOffsetFilePath(chunk_index: Long, adj_list_type: AdjListType.Value) : String
// -- getAdjListOffsetDirPath(adj_list_type: AdjListType.Value) : String
// -- getAdjListFilePath(vertex_chunk_index: Long, chunk_index: Long, adj_list_type: AdjListType.Value) : String
// -- getAdjListDirPath(adj_list_type: AdjListType.Value) : String
// -- getPropertyFilePath(property_group: PropertyGroup, adj_list_type: AdjListType.Value, vertex_chunk_index: Long, chunk_index: Long): String
// -- getPropertyDirPath(property_group: PropertyGroup, adj_list_type: AdjListType.Value) : String
// -- getVersion: String
@acezen acezen added the enhancement New feature or request label Dec 12, 2022
@acezen acezen moved this to Todo in alibaba/GraphAr Dec 13, 2022
@acezen acezen added this to the Release 0.1.0 milestone Dec 13, 2022
@acezen acezen moved this from Todo to In Progress in alibaba/GraphAr Dec 13, 2022
@acezen acezen self-assigned this Dec 14, 2022
@acezen acezen moved this from In Progress to Done in alibaba/GraphAr Dec 16, 2022
@acezen
Copy link
Contributor Author

acezen commented Dec 19, 2022

The issue has been solved by #45

@acezen acezen closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant