apache / apache/incubator-graphar

[Feat] Support multi-labels for a single vertex/edge

Open
#96 4 comments 0 reactions 1 assignee Claimed by @Elssky View on GitHub
Component:C++ enhancement
Dominant language
C++
Stars
373
Forks
93
Avg merge
7d 21h
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**
For the graphs in Neo4j or NebulaGraph, a single vertex or edge can have multiple labels. For example, a vertex in Neo4j graph could be labeled as a person as well as a student, thus it has two labels: `person` and `student`. While currently, in GraphAr, a vertex or an edge can have only one label. GraphAr needs to support multi-labels for aligning with Neo4j and Nebula.

**Describe the solution you'd like**
- replace the label definition of GraphAr with `vertex type`/`edge type`. and
- storing each label as one separate column (together, all labels of a vertex/edge table form a sparse matrix, see the [GraphAr paper](https://arxiv.org/abs/2312.09577) for more detail)

more detail:
use `Parquet` as example, we can storing each label as one separate column and use [Run Length encoding](https://parquet.apache.org/docs/file-format/data-pages/encodings/#run-length-encoding--bit-packing-hybrid-rle--3) as the encoding of label column. When you want to check a vertex is label person or not, just check that encoding is 0 or not in the `person` column. It is convenient and fast to use this method to filter vertices of specific label.

**Describe alternatives you've considered**
Storing a label list (which is complex Array type) as a property on vertices/edges.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.