Comments (4)
Hi @d33bs , this is a good topic. I've got one input here: One work around we have right now is REL TABLE GROUP, which can life some limitation of "each REL table in Kuzu may only contain one node type for the FROM and TO specification".
Edit: Oh wasn't aware that @andyfengHKU has a more detailed answer. Pleaser refer to his one for more details. 😄
from kuzu.
Hi @d33bs, thanks for trying us out!
Indeed for some graph databases, a relationship (REL table) can be defined over multiple node tables, e.g. the following is doable in Neo4j
CREATE (:A)-[e:R]->(:B);
CREATE (:C)-[e:R]->(:D);
MATCH ()-[e:R]->() RETURN e;
Here we define a relationship R over FROM A TO B and FROM C TO D. The above statements can also be rewritten as with multi-label query which is exactly the same as your second workaround suggestion.
CREATE (:A)-[e:R_AB]->(:B);
CREATE (:C)-[e:R_CD]->(:D);
MATCH ()-[e:R_AB|:R_CD]->() RETURN e;
Back in the day, we thought since there was a workaround, we could just go for a simpler modelling which also benefits bulk-loading performance, data compression and other system level optimizations. So we chose to constraint REL table to be defined over one pair of FROM TO node tables.
Though slowly we indeed receive feedbacks about the limitation of this constraint in practice. So we introduced REL GROUP as an experimental feature where you can define a rel group and use it as a union of multiple relationship tables during querying.
CREATE REL TABLE GROUP R (FROM A TO B, FROM C TO D);
MATCH ()-[e:R]->() RETURN e;
This feature is quite experimental so it comes with many limitations, e.g. you can not bulk-load into a rel group. Any feedback over this feature is highly appreciated.
As for the workarounds
Generalize all NODE types to a single table of type
I don't recommend this one because it will definitely hurt performance because a node table scan will be a lot more costly.
Create specific REL tables for each kind of relationship by distinct FROM, TO node pairs
This idea aligns with our initial thoughts and I believe it will work fine.
from kuzu.
Thank you so much @ray6080 and @andyfengHKU ! I'll give REL GROUP's a try and follow up with any feedback.
from kuzu.
I'm closing this issue for now assuming RelGroup will do for now. Please re-open if your feedback has a request for a feature we should consider.
from kuzu.
Related Issues (20)
- RDF SPB test fails on multiple platforms
- Truncation on Hub Vertices
- Interactive V1 Scale Factor 10 Bug
- SHORTEST path restriction HOT 10
- RuntimeError: Parameters must be a dict HOT 2
- "Did you mean" type error messages in CLI
- FSST-based string compression
- Buffer manager exception: Failed to claim a frame: Python API: Bulk Load kuzu==0.0.12 v kuzu==0.2.0 HOT 5
- Rdf.StrictMode Test Likely Produces Undefined Behaviour HOT 1
- LDBCSF01CreateReadRelTest.CreateLikeComment fails sanityCheck assertion randomly
- Elements in Empty List Resolving to STRING by Default Causes Issues HOT 1
- Add `IF NOT EXISTS` option to node and edge table creation. HOT 1
- Build CLI binary as executable prior to zip/release HOT 5
- CopyTo and CopyFrom do not align with interval datatype
- Outline best practices for sharing Kuzu databases HOT 2
- Multiple BEGIN TRANSACTION rolls back the active transaction
- Creating 2 nodes and an edge between them in a single transaction fails.
- Extension loading on apis HOT 2
- Master test open too many files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kuzu.