http endpoint query

8 views
Skip to first unread message

Marwa Elabri

unread,
Sep 1, 2015, 4:29:50 AM9/1/15
to Neo4j
please
i want to do a http query using cypher language and neo4j console and the result of this query is just the properties names of a node or relationship stored in my graph data base
all i find on the neo4j site is a query that returns the values of properties of a node :(
can some one help me please
thank you in advance

Michael Hunger

unread,
Sep 1, 2015, 4:49:59 AM9/1/15
to ne...@googlegroups.com, Marwa Elabri
MATCH (n)-[r]-()
RETURN keys(n),keys(r)

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marwa Elabri

unread,
Sep 1, 2015, 6:08:43 AM9/1/15
to Neo4j, marwa...@gmail.com


thank you
but your query retun the properties of each node and relationship 
please i want to make the union of all properties that are contained in entities(nodes) that have the same type or relationship
for exmple i have 2 nodes  their type is student
for student 1 their properties are: name, age
student 2 their properties are: name, average, grade
so i want to show for the node student {name,age,average,grade} without repetition

Michael Hunger

unread,
Sep 1, 2015, 8:39:24 AM9/1/15
to ne...@googlegroups.com, Marwa Elabri, Stefan Plantikow
As there is no toSet in Cypher you'll have to do something like this:

MATCH (n)
WITH head(labels(n)) as label, keys(n) as keys
UNWIND keys as key
RETURN label, collect(distinct key);


--
Reply all
Reply to author
Forward
0 new messages