React-based web application that enables users to visualize both property graph and RDF data and explore connections between data without having to write graph queries.
When expanding a node in openCypher Graph Explorer was executing two queries to the database.
The first would get all the node and edge neighbors to the expanded node that match the filter criteria using the query below.
MATCH (v)-[e]-(tgt:airport)
WHERE ID(v) = "247"
WITH
collect(DISTINCT tgt)[..12] AS vObjects,
collect({edge: e, sourceType: labels(v), targetType: labels(tgt)})[..12] AS eObjects
RETURN
vObjects, eObjects
Then it would extract only the edge IDs from the results of the query above. It would send those edge IDs to another query that uses the exact same filter logic, but adds a new filter for those edge IDs specifically.
MATCH (v)-[e]-(tgt:airport)
WHERE
ID(v) = "247" AND
ID(e) IN [
"25753",
"9253",
"9700",
"10000",
"17120",
"17542",
"19868",
"20428",
"33362",
"24309",
"25618",
"25610"
]
WITH
collect(DISTINCT tgt)[..12] AS vObjects,
collect({edge: e, sourceType: labels(v), targetType: labels(tgt)})[..12] AS eObjects
RETURN
vObjects, eObjects
It then uses the results from the second query to render the nodes.
I can not figure out why the two queries are necessary. The return the exact same information. Except the second query is way more likely to fail due to large ID(e) IN [...] filters.
So I removed the second edge filtered query. Graph Explorer seems to work much better now and is less likely to fail.
Validation
Tested in Neptune with openCypher
Related Issues
Possibly addresses #389
Check List
[x] I confirm that my contribution is made under the terms of the Apache 2.0
license.
[x] I have run pnpm checks to ensure code compiles and meets standards.
[x] I have run pnpm test to check if all tests are passing.
[ ] I have covered new added functionality with unit tests if necessary.
Description
When expanding a node in openCypher Graph Explorer was executing two queries to the database.
The first would get all the node and edge neighbors to the expanded node that match the filter criteria using the query below.
Then it would extract only the edge IDs from the results of the query above. It would send those edge IDs to another query that uses the exact same filter logic, but adds a new filter for those edge IDs specifically.
It then uses the results from the second query to render the nodes.
I can not figure out why the two queries are necessary. The return the exact same information. Except the second query is way more likely to fail due to large
ID(e) IN [...]
filters.So I removed the second edge filtered query. Graph Explorer seems to work much better now and is less likely to fail.
Validation
Related Issues
Check List
pnpm checks
to ensure code compiles and meets standards.pnpm test
to check if all tests are passing.Changelog.md
.