cozo
cozo copied to clipboard
ls it possible to move data between graphs and relations
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.
- 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.
- 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.
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