cypher - Neo4J query to join multiple matches to return results -
when run query below query 1 producing result returning categories label document documents. note document can have multiple categories hence collecting them in on go.
start doc = node:entities(type = "document-link") match category-[:category]-doc<-[:`document-link`]-id return doc.title title, collect(coalesce(category.category, "")) categories
query 2 producing result returning language of document documents. document can have 1 language type.
start doc = node:entities(type = "document-link") match lan-[:language]-doc<-[:`document-link`]-id return doc.title title, lan.language language
query 3 join of 1 , 2 producing empty result. can highlight doing wrong?
start doc = node:entities(type = "document-link") match category-[:category]-lan-[:language]-doc<-[:`document-link`]-id return doc.title title, lan.language language, collect(coalesce(category.category, "")) categories
in third query match on relation between category , language, don't in first 2 queries. how this:
start doc = node:entities(type = "document-link") match category-[:category]-doc<-[:`document-link`]-id match doc-[:language]-lan return doc.title title, lan.language language, collect(coalesce(category.category, "")) categories
Comments
Post a Comment