I am trying to find out the specific node type root in the graph database. In Gremlin query I can find count the root node.
query = """g.V().hasLabel("A")
.filter(
out().hasLabel("A").count().is(gt(1))
.and()
.in().hasLabel("A").count().is(eq(0))
)
.values("title")"""
This above query will return the root node title. How can we find the root node of the node type in the cypher query.