Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discovering node properties in neo4j grap db

I'm discovering a new graph data model in Neo4j and I was wondering how to list all the possible node properties but not their value if possible.

For the relations, I found this very handy generic cypher query :

start n=node(*)
match n-[r]-m
return distinct type(r)

which return a useful list of properties you can start to use to query more specifically the graph:

==> +------------+
==> | type(r)    |
==> +------------+
==> | "RATED"    |
==> | "FRIEND"   |
==> | "DIRECTED" |
==> | "ACTS_IN"  |
==> +------------+
==> 4 rows
==> 0 ms
==>

Is there any function/expression that allows to do this but for the node properties ?

Thanks

like image 687
Jonathan vE Avatar asked Jan 17 '13 16:01

Jonathan vE


1 Answers

type() does not return relationship properties, but the relationship type.

Both nodes and relationships can have properties, but only relationships can have a type.

like image 70
Werner Kvalem Vesterås Avatar answered Oct 08 '22 18:10

Werner Kvalem Vesterås