jberzy opened a new pull request, #1735:
URL: https://github.com/apache/age/pull/1735
Hello,
This is a minimal POC for vertices and edges backed by views. I'm new to
contributing to this repo, and there is still a lot to do, so thought I'd get
feedback early in case this is not such a good idea...
There are a few use cases for this feature that come to mind:
- Creating labels backed by other data sources without explicitly loading
the data into the graph
- Pre-computing complex queries in materialized views but still have a
uniform way to query that data
- Ad-hoc categorization of multiple labels
- Filtered labels
- Labels derived from FDWs?
here is a little example that works so far:
`
CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
SELECT create_graph('graphdb');
SELECT * FROM cypher('graphdb', $$
CREATE (:Person {name: 'Daedalus'})-[:FATHER_OF]->(:Person {name: 'Icarus'})
$$) AS (a agtype);
CREATE VIEW graphdb.filtered_person as
SELECT p.* from graphdb."Person" p
Where p.properties ->> 'name'::text = 'Daedalus'
SELECT create_computed_vlabel('graphdb', 'FilteredPerson',
'filtered_person');
SELECT * FROM cypher('graphdb', $$
match (a:FilteredPerson)
return a
$$) AS (a agtype);
`
There was really not that many changes to get the above working. But quite a
bit more needs to get done such as validating the view's schema, error messages
when attempting to write, handling dropping computed label, testing, etc.
Thanks,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]