Skip to content

Instantly share code, notes, and snippets.

@deevis
Created May 25, 2018 01:12
Show Gist options
  • Save deevis/24f7492e0ba0ce5bd8d6ee6a8bb7bff6 to your computer and use it in GitHub Desktop.
Save deevis/24f7492e0ba0ce5bd8d6ee6a8bb7bff6 to your computer and use it in GitHub Desktop.
NEO4J CQL Query
match (npi:Registration{label:'NPI:1407098122'}), (m) where (m:Sanction or m:License or m:Registration or m:Ssn) with npi,m match p=allShortestPaths((npi)-[:FOUND_IN*0..6]-(m)) where NONE( x in nodes(p) where labels(x) = ['ExternalDatum'] and x.source = 'piidat' and x.source_id <> '61474244') unwind (nodes(p)) as node match(node)-[found_in:FOUND_IN]->(datum) where not (node:ExternalDatum) return distinct labels(node), node, collect(distinct found_in.payload) order by labels(node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment