Sumit,

yes it works, but if I want to order the results for instance on the basis
of the first label, i need to access nrms[0][0] . and that's where it fails.




Met vriendelijke groet / With kind regards



Ir. T. Zeppenfeldt
van der Waalsstraat 30
6706 JR  Wageningen
The Netherlands

Mobile: +31 6 23 28 78 06
Phone: +31 3 17 84 22 17
E-mail: t.zeppenfe...@ophileon.com
<t.zeppenfe...@ophileon.com>Web: www.ophileon.com
Twitter: tomzeppenfeldt
Skype: tomzeppenfeldt

2015-05-14 3:03 GMT+02:00 Sumit Gupta <sumit1...@gmail.com>:

> Hi Tom,
>
> your query works fine without "Limit 1" too. it shows all the unique
> combinations of "labelsn, labelm and typer", which is exactly your scope.
>
> And that's true that lablesn is not a collection, so what is the problem?
> or what is not working?
>
> Thanks,
> Sumit
>
>
> On Wednesday, 13 May 2015 03:47:12 UTC+5:30, Tom Zeppenfeldt wrote:
>>
>> In order to make a meta-model, i'd like to know what kind of nodes , rels
>> are present in a db, as well as counts.
>>
>> Doing this
>>
>>
>> *MATCH (n)-[r]->(m)*
>> *WITH DISTINCT [labels(n),labels(m),type(r)] AS nrms, count(*) AS  countr*
>> *WITH nrms[0] AS labelsn, nrms[1] AS labelsm, nrms[2] AS typer, countr*
>> *RETURN labelsn,labelsm,typer,countr*
>>
>>
>> works fine. with a LIMIT 1, the API returns this
>>
>>
>> {
>>     "columns": [
>>         "labelsn",
>>         "labelsm",
>>         "typer",
>>         "countr"
>>     ],
>>     "data": [
>>         [
>>             [
>>                 "Somelabel",
>>                 "Diagram"
>>             ],
>>             [
>>                 "View"
>>             ],
>>             "CONTAINS",
>>             2
>>         ]
>>     ]
>> }
>>
>> However, the "labelsn" and  "labelsm" in the RETURN don't seem to be
>> collections. At least, I cannot do labelsn[0] or  length(labelsn)
>>
>> Accessing nrms[0][0] also produces an error.
>>
>> Running version 2.1.2
>>
>>
>>
>>
>>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to