cozo icon indicating copy to clipboard operation
cozo copied to clipboard

ls it possible to move data between graphs and relations

Open ntangldev opened this issue 1 year ago • 1 comments

I am working my way through the datalog tutorial, I have completed the relations/queries and graphs sections.

I have some questions related to my use case that I'm unable to answer yet, are the following complex operations possible?

The use case is to sync a graph between multiple nodes, a node extracts any parts of the graph that match a local schema and stores them as rows in a local relation DB. When updates are made to the local relational DB, the new/deleted rows are reflected back to the graph and the graph is sync'd with the other networked nodes.

  1. The graph example shows a graph stored in a single relation, is it possible to treat the results of joining relations as a graph.

I envisage the resulting graph having Subjects nodes generated from the primary key of selected rows in a table, property edges with a value object for each selected dependent column in that row and connection edges with an Object node which is the primary key of a selected row in a joined table. The Object node might itself become a Subject with its own properties.

  1. Given a graph, is it be possible to identify and extract a node and edges matching a specific pattern and add those as rows in a relation.

ntangldev avatar Nov 23 '23 21:11 ntangldev

add is possible depends how you model a graph . I use naive model of nodes and triples . it works well will graph algorithms maybe you have concrete examples

Volland avatar Dec 02 '23 14:12 Volland