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

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": ""
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


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

Hi @contzero ,

This may be a good start for you:

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


It works perfectly, thanks a lot @agudeloharold13 !