SciGraph
SciGraph copied to clipboard
Add an endpoint allowing to retrieve entities defined in an ontology
In addition to the endpoint /scigraph/vocabulary/curies (requested here #159) allowing to retrieve the list of curies in a scigraph instance, it would be nice to have an endpoint allowing to retrieve the list of entities (classes, instances, ...) defined within a given ontology. When no specific term is targeted, the combination of these two endpoints gives an entry point for getting all entities along with the ontology in which they are defined.
You can use scigraph's /scigraph/dynamic api endpoint which can be configured in the services yaml file to accomplish this by selecting triples that match (*, rdf:type, owl:Class). For pagination I think you can use:http://neo4j.com/docs/stable/query-limit.html, http://neo4j.com/docs/stable/query-skip.html but I don't actually know the best practices for pagination using cypher.
@atorr
Could you add an offset using the SKIP cypher keyword here please (will need to include orderby). The rest API should use offset as the parameter name to match the other endpoints.
Could you also add another endpoint that returns all nodes with limit and offset but not filtered by curie? The arbitrary cypher execution endpoint seems like it might be able to do this as well, but it seems like this will be a quick copy and paste. Thanks!
Sure thing.
@tgbugs For the endpoint that doesn't filter by curie should the query still specify to order the nodes by curie? If not, what should I order them by?
@tgbugs I pushed the changes to my branch. The offset parameter seems to be working. For the endpoint where I don't filter by curie I still have it ordered by curie for the skip. Let me know if this all checks out.