Hongli Bu
Hongli Bu

Reputation: 561

db.schema() didn't show correctly after bulk import through neo4j admin

Hi I download our db to csv, then import the data to neo4jDB through bulk import method: neo4j-admin import. It works, and data can be seen in neo4j browser. but we I typed 'call db.schema()', the schema is wrong.schema error

this is the relative table: enter image description here

it seems event Node became relationships in this query. then I tried to call "call db.schema.nodeTypeProperties()" and "call db.schema.relTypeProperties()", it looks good, like this: enter image description here

Also, if i tried to do some queries and expand relationships in neo4j browser it works.

So any body have any idea what happened? or any hints to debug this??

Upvotes: 0

Views: 530

Answers (1)

Dmitry Arestov
Dmitry Arestov

Reputation: 1678

The db.schema() procedure and its successor db.schema.visualization() have their limitations (that look like bugs). The issue exists since about v3.0 and does not seem to be fixed anytime soon. Instead, you can use apoc.meta.graph() procedure from the APOC library. It works properly but not so fast.

Please see this to install APOC using Neo4j Desktop. If you're using standalone Community Edition, you need to:

  1. Download APOC .jar file (https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases)
  2. Copy it to the plugins directory inside your Neo4j installation. On Windows, unblock the file.
  3. In the neo4j.conf file, enable loading APOC functions by inserting this line: dbms.security.procedures.unrestricted=apoc.*
  4. Restart the server.

Upvotes: 2

Related Questions