# Getting node type from Java Query

**URL:** <https://community.neo4j.com/t/getting-node-type-from-java-query/40219>\
**Category:** Java\
**Tags:** querying, java-api, java-driver\
**Created:** [June 22, 2021, 11:51am UTC](https://community.neo4j.com/t/getting-node-type-from-java-query/40219 "2021-06-22T11:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![loucas.andrew97](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/loucas.andrew97/32/18335_2.png) [@loucas.andrew97](https://community.neo4j.com/u/loucas.andrew97)\
**Post date:** [June 22, 2021, 11:51am UTC](https://community.neo4j.com/t/getting-node-type-from-java-query/40219/1 "2021-06-22T11:51:05Z")

</div>

Hey everyone, i using a java driver to query a graph database in java and get their values. I am working on transforming the data structure of the result to suitable data structure to apply my own algorithms.

So i am applying a query now : "Match (n) - [r] -\> (m) Return n,r,m"  
Is there a way when i get the results and iterate through the result List to know what type n is in each record? In the database i have 50 different labels. I want to know what label each node is.Any help is appreciated.

Thank you for the help,

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [June 23, 2021, 11:33pm UTC](https://community.neo4j.com/t/getting-node-type-from-java-query/40219/2 "2021-06-23T23:33:53Z")

</div>

DId you look at the java driver api docs?

[https://neo4j.com/docs/api/java-driver/current/org/neo4j/driver/types/Node.html#labels--](https://neo4j.com/docs/api/java-driver/current/org/neo4j/driver/types/Node.html#labels--)

---

<div class="post-metadata">

**Author:** ![loucas.andrew97](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/loucas.andrew97/32/18335_2.png) [@loucas.andrew97](https://community.neo4j.com/u/loucas.andrew97)\
**Post date:** [June 24, 2021, 6:52am UTC](https://community.neo4j.com/t/getting-node-type-from-java-query/40219/3 "2021-06-24T06:52:15Z")

</div>

Yes, i struggled to find it at first. But u have managed to fix it.  
Thanks
