# Filter node properties to get only Data properties, and not uri or annotations

**URL:** https://community.neo4j.com/t/filter-node-properties-to-get-only-data-properties-and-not-uri-or-annotations/42529
**Category:** Cypher
**Tags:** cypher
**Created:** [August 6, 2021, 12:05pm UTC](https://community.neo4j.com/t/filter-node-properties-to-get-only-data-properties-and-not-uri-or-annotations/42529 "2021-08-06T12:05:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![contzero](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/contzero/32/5398_2.png) [@contzero](https://community.neo4j.com/u/contzero)
#### Post date: [August 6, 2021, 12:05pm UTC](https://community.neo4j.com/t/filter-node-properties-to-get-only-data-properties-and-not-uri-or-annotations/42529/1 "2021-08-06T12:05:04Z")

</div>

Hello all,

I am trying to get all data properties associated with a Named Individual and their respective values using "properties(n) " command. But this also display the node's uri and associated annotations.  
I would like to only get the data properties, without the uri and annotation properties  
Here is the query I am using:

match (n:NamedIndividual)  
return properties(n)

The kind of result I get:  
{  
"Man\_Hour": 2,  
"label": "M\_Assembly\_1",  
"uri": "[http://www.semanticweb.org/xxxx/ontologies/2021/0/MBOM#M\_Workstation\_Assembly\_1](http://www.semanticweb.org/xxxx/ontologies/2021/0/MBOM#M_Workstation_Assembly_1)"  
}  
Here for example I would like to only display "Man\_Hour": 2  
Is there a way to filter the results this way?

Thanks a lot for your help

Mehdi

[EDIT]  
I also tried the following:  
WITH [0,1,2] as NbKey  
UNWIND NbKey as NbreKey  
MATCH (n:NamedIndividual)  
WHERE keys(n)[NbreKey]\<\>'uri' and keys(n)[NbreKey]\<\>'label'  
RETURN n.label as Instance, keys(n)[NbreKey] as DataProp,  
This query gives me the label of data properties that are not "uri" or "label"  
I then tried to display the value of this data property using "n.keys(n)[NbreKey]" but it doesn't seem like Neo4J can process variable dataproperties

---

<div class="post-metadata">

### Author: ![Bennu](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bennu/32/11659_2.png) [@Bennu](https://community.neo4j.com/u/Bennu)
#### Post date: [August 6, 2021, 12:55pm UTC](https://community.neo4j.com/t/filter-node-properties-to-get-only-data-properties-and-not-uri-or-annotations/42529/2 "2021-08-06T12:55:21Z")

</div>

Hi @contzero ,

This may be a good start for you:

```auto
WITH ['uri', 'label'] as bl
MATCH (n:NamedIndividual)
WITH n, [a in keys(n) WHERE not a in bl] as props
UNWIND props as key
return ID(n) as identifier, key, n[key] as val, key + ":" + n[key] as expected

```

H

---

<div class="post-metadata">

### Author: ![contzero](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/contzero/32/5398_2.png) [@contzero](https://community.neo4j.com/u/contzero)
#### Post date: [August 6, 2021, 1:06pm UTC](https://community.neo4j.com/t/filter-node-properties-to-get-only-data-properties-and-not-uri-or-annotations/42529/3 "2021-08-06T13:06:00Z")

</div>

It works perfectly, thanks a lot @agudeloharold13 !
