Here's how to create a simple property graph in Supabase
Property graphs are a great way to model highly relational data. They make relationships easy to understand and, therefore, easy to build queries. Down the road, you can use the data for graph-powered machine learning.
For example, you could query the data and load them into python libraries like networkx and stellargraph. Or, if the data is more extensive, use graph databases like neo4j or memgraph.
Although you can use graph databases natively as a standalone backend, graph databases can be expensive to use, and for many day-to-day query operations, they can be overkill.
Ok, so let’s get to it. First, you’ll need to create a supabase account and a Postgres database.
Then you’ll need to turn on the store extension; this is for storing key, value pairs. Turning on the extension is accessible on the Database Extensions page.
Now let’s model this simple property graph with two tables: Node and Relationship.
We are starting with the Node table. We’ll add an id column as a primary key, a text column as the name/type of node, and finally, the hstore column with the name properties.
Now for the relationship table. Like the node table, the table will have a text column for the name/type of relationship.
We’ll assume these relationships represent a single direction or “predicate” in a graph. For that reason, we’ll add two ID columns with the names source_node_id and target_node_id
After creating the two tables, all we need to do is create indexes for the hstore columns.
And that’s it! You have a simple property graph that can store nodes, the relationship between the nodes, and properties for both nodes and relationships.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Manual labeling is expensive. It often requires the time of engineers and subject matter experts (SMEs). Or the cost of using custom labeling platforms and crowdsourcing.
Unlabeled data, in contrast, is usually cheap and easy to obtain. Finding ways to reduce the amount of manual labeling can reduce costs and speed up the iterative ML development workflow.
1. One approach to reducing manual labeling is called Semi-supervised learning