Skip to content

Instantly share code, notes, and snippets.

@danmichaelo
Last active October 3, 2022 14:05
Show Gist options
  • Save danmichaelo/5603f0af8eaff61b9c495fd9bc8464fa to your computer and use it in GitHub Desktop.
Save danmichaelo/5603f0af8eaff61b9c495fd9bc8464fa to your computer and use it in GitHub Desktop.
Neo4j: Concept with Subject and Manifestation counts
// Concept with Subject and Manifestation counts
MATCH (c:Concept)
OPTIONAL MATCH (c)--(s:Subject)
OPTIONAL MATCH (s)--(m:Manifestation)
RETURN
c.label AS Label,
c.uri AS URI,
'=LINK("neo4j-desktop://graphapps/neo4j-browser?cmd=edit&arg=' + apoc.text.urlencode(
'MATCH (c:Concept{uri:"' + c.uri + '"}) OPTIONAL MATCH (c)--(x) RETURN *' + '"; "Link")'
) AS Neo4JLink,
COUNT(DISTINCT s) AS SubjectStrings,
COUNT(DISTINCT m) AS Manifestations
ORDER BY c.label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment