ExposuresProvider / cam-pipeline

Data loading pipeline for CAM database
https://exposuresprovider.github.io/cam-pipeline/
MIT License
2 stars 4 forks source link

Modify the frontend to sort models by descending number of nodes #134

Open gaurav opened 3 months ago

gaurav commented 3 months ago

That would allow us to find the richest models.

gaurav commented 1 month ago

This would require either a second query (that asks for the number of nodes per model) or a second search method (to retrieve all the models sorted by the number of nodes or something).

The Cypher query we want would be something like:

MATCH (s)-[p]-(o) WITH s, p, o, TYPE(p) AS pred_type UNWIND p.xref AS url WITH url, s, p, o, pred_type RETURN url, COUNT(p) AS numberOfEdges, COLLECT(DISTINCT {s: s, o: o, pred_type: pred_type}) AS edges LIMIT 100;
gaurav commented 1 month ago

The other option is that we could pre-calculate the number of edges per model, and then load that into JavaScript.