Order group count result alphabetically

Hi! Given the following query and results in the enclosed image: how would I sort the labels alphabetically? Air routes dataset for illustration.
5 Replies
Shush
Shush•15mo ago
have you tried order().by(label)?
Shush
Shush•15mo ago
Stack Overflow
Alphanumeric sorting in Gremlin
I have a database and am trying to find a safe way to read this data into an XML file. Reading the verticies is not the problem. But with the edges the app runs since a while into a HeapSpace-Excep...
kelvinl2816
kelvinl2816•15mo ago
If you want to sort after creating the group, you can do
order(local).by(keys)
order(local).by(keys)
gremlin> g.V().group().by(label).by(count())
==>[continent:7,country:237,version:1,airport:3502]
gremlin> g.V().group().by(label).by(count()).order(local).by(keys)
==>[airport:3502,continent:7,country:237,version:1]
gremlin> g.V().group().by(label).by(count())
==>[continent:7,country:237,version:1,airport:3502]
gremlin> g.V().group().by(label).by(count()).order(local).by(keys)
==>[airport:3502,continent:7,country:237,version:1]
Blonde Maybe
Blonde Maybe•15mo ago
Thank you for the quick response! This worked excellently in G.V() and I now found the chapter in your book. 🙌 Do you happen to know how local or keys are utilised in Gremlin.Net? I cannot seem to find an Enum-type (like T.Label for local or keys).
kelvinl2816
kelvinl2816•15mo ago
In general it's going to be Scope.local and Column.keys / Column.values the casing varies a little bit by client as the clients try to be somewhat idiomatic for any given language.
Want results from more Discord servers?
Add your server
More Posts
Transactions - tx.commit vs tx.closeI have a question related to transactions. I'm having issues with tx.commit() hanging locally when rExtracting the ProjectStep of a GraphTraversal instance during unit testing**Tl;dr** Given an instance of `GraphTraversal<?, Map<String, Object>>`, is it possible to extract tWhen can we get a non-RC release for Python 3.11 support in Production Envs?There was a bug where the version of aiohttp was too strict and blocked Python 3.11 support. ( httpsSubgraph query returns String instead of TinkerGraph Object in Fluent Java APIHi guys. I am running the following query in the console and it works fine: `g.V().has('user', 'id'Multiple Graphs in Gremlin Server?How do I manage multiple graphs? Is there an option where I can select which graph to use for query Has anyone else encountered "NoSuchElementException" when calling getLeafTrees() on a tree objectDid a little bit of debugging and it seems that the issue has to do with a cast to Tree before calliThe query gets slower as the number of vertices that already exist in JanusGraph gets bigger and bigWhen i start JanusGraph and perform any query like : - g.V().has(properties).limit(10).toList() - g.Is there a limitation on Neptune HTTP API endpoint compatibility when using a proxy and IAM Auth?Hi, Got a weird one today. I'm working on bringing full compatibility for the use of proxies frontiPreventing Janusgraph crash on timeoutAccording to this: https://stackoverflow.com/questions/61985018/janusgraph-image-stop-responding-aftWay to update static vertexhttps://docs.janusgraph.org/schema/advschema/#static-vertices I read document about TTL vertex. And