Search code examples
databasejanusgraph

How to check if schema already created in JanusGraph?


Trying to check if schema in JanusGraph installed, so I checked JanusGraph docs "Schema and Data Modeling" as I can see I can print schema, but I don't know if there flag as "schema installed" or "modified". So how do I check if schema in JanusGraph installed?


Solution

  • From "mgmt" object we can check "getRelationTypes", if it there then schema exists

    mgmt.getRelationTypes(RelationType.class).iterator().hasNext()