neo4j - How to classify the attributes according to the attribute -
i have entity class this:
@nodeentity public class patent { @graphid private long patentid; private string patentname; //2016-02-01 private string authorizedtime; private string patentnumber; @fetch @relatedto(type = "authorizedperson") private set<researcher> authorizedpersons = new hashset<researcher>(); private string createtime; private string description;
i want result this:
year total
2013 6
2014 7
i try use cypher query:
match (n1:patent) collect( distinct substring(n1.authorizedtime,0,4)) coll,substring(n1.authorizedtime,0,4) val return coll, reduce(s=0, val in coll | s + 1) numbyy ;
but no success.
how classify attributes according attribute?
thanks lot!
this query should return each year , number of nodes year, ordered year:
match (n1:patent) return left(n1.authorizedtime, 4) year, count(*) total order year;
Comments
Post a Comment