Purpose

This section deals with the database used by the CAST Imaging system - Neo4j.  It provides some assistance in  the configuration of  Neo4j database.

Imaging Version


Release

Yes/No

2.x(tick)
Details
  1. Please see the following for Neo4j Access: CAST Imaging System - Information - How to access Neo4j

  2. Neo4j basic queries
    1. Specify database scope
      1. Use  <database name>
    2. List users and access (in Imaging database scope)
      1. MATCH (r:Role {Name: 'Super Admin'})<-[:HAS_ROLE]-(k) RETURN k.Name, labels(k)

        MATCH (r:Role {Name: 'Super Admin'})<-[:HAS_ROLE]-(k:User)<-[:CONTAINS_USER]-(sm:SecurityMode) RETURN k.Name, sm.Name

    3. List all databases
      1. SHOW DATABASES
  3. Neo4j advanced queries
    1. Top 5 tables with most reads

      1. MATCH (o:<object>)-[r:USE]->(t:Object:<object>) WHERE t.Type CONTAINS "Table"

        and (o:Object or o:SubObject)

        WITH DISTINCT r.aipLinkType as linkTypes, o, t

        UNWIND linkTypes as lt WITH lt,linkTypes, o, t

        MATCH(o1:<object>) where lt = "select" and (o1:Object or o1:SubObject)

        RETURN DISTINCT lt as `Link Type`,COUNT(DISTINCT o) as `No. of Reads`, t.Type as `Target Type`, t.FullName as `Target FullName`, t.Name as `Target Name`order by `No. of Reads` desc limit 5

    2. Top 5 tables with most updates

      1. MATCH (o:<object>)-[r:USE]->(t:Object:<object>) WHERE t.Type CONTAINS "Table"

        and (o:Object or o:SubObject)

        WITH DISTINCT r.aipLinkType as linkTypes, o, t

        UNWIND linkTypes as lt WITH lt,linkTypes, o, t

        MATCH(o1:<object>) where lt = "update" and (o1:Object or o1:SubObject)

        RETURN DISTINCT lt as `Link Type`,COUNT(DISTINCT o) as `No. of Updates`, t.Type as `Target Type`, t.FullName as `Target FullName`, t.Name as `Target Name`order by `No. of Updates` desc limit 5

  4. Please see the following for Neo4jNeo4j memory optimization:
    https://doc.castsoftware.com/display/IMAGING/Optimize+Neo4j+memory+allocation
  5. Please see the following for Neo4j Buffer size configuration:
    https://doc.castsoftware.com/display/IMAGING/Configuring+Neo4j+buffer+size
  6. Please see the following for Neo4j Disk usage optimization:
    https://doc.castsoftware.com/display/IMAGING/Optimize+Neo4j+disk+usage+-+cleanup+and+disable+JVM+crash+dumps
    https://doc.castsoftware.com/display/IMAGING/Optimize+Neo4j+disk+usage+-+transaction+log+retention
  7. Select the page you are interested in:
  8. If you do not find the information you are looking for or solution for your problem, please contact CAST Technical Support
Notes/comments


Related Pages