Schema management tools


Robert Dale <rob...@...>
 

With so many high-profile companies and others out there with Titan/Janus in production, I can only imagine that most, if not all, have written some higher-level tools for managing the database and, in particular, the schema.

This is a call to publish your tools.  I'll go first.  I whipped up a little 'describe' command to help make it easier to see the schema and statuses.

https://gist.github.com/robertdale/ad4c63910009dd1118abe67b33ce41e1

This shows the output after loading GraphOfTheGods and running through some of the examples in the docs.


./bin/gremlin.sh -i describe.groovy

gremlin
> graph = JanusGraphFactory.open('conf/janusgraph-cassandra-es.properties')
==>standardjanusgraph[cassandrathrift:[127.0.0.1]]
gremlin
> GraphOfTheGodsFactory.load(graph)
gremlin
> :schema
Usage: must provide command: describe [ vertex | edge | propertykey | index ]
Unknown command: null
gremlin
>
gremlin
> :schema describe
Vertex Label                   | Partitioned | Static
------------                   | ----------- | ------
titan                          
|       false |  false
location                      
|       false |  false
god                            
|       false |  false
demigod                        
|       false |  false
human                          
|       false |  false
monster                        
|       false |  false
person                        
|       false |  false
------------                   | ----------- | ------


Edge Name                      |            Type |        Directed |     Unidirected |    Multiplicity
---------                      |            ---- |        -------- |     ----------- |    ------------
brother                        
|            Edge |            true |           false |           MULTI
follow                        
|            Edge |            true |           false |           MULTI
father                        
|            Edge |            true |           false |        MANY2ONE
mother                        
|            Edge |            true |           false |        MANY2ONE
battled                        
|            Edge |            true |           false |           MULTI
lives                          
|            Edge |            true |           false |           MULTI
pet                            
|            Edge |            true |           false |           MULTI
---------                      |            ---- |        -------- |     ----------- |    ------------


PropertyKey Name               |            Type |     Cardinality |            Data Type
----------------               |            ---- |     ----------- |            ---------
birthDate                      
|     PropertyKey |          SINGLE | class java.lang.Long
rating                        
|     PropertyKey |          SINGLE | class java.lang.Double
name                          
|     PropertyKey |          SINGLE | class java.lang.String
age                            
|     PropertyKey |          SINGLE | class java.lang.Integer
time                          
|     PropertyKey |          SINGLE | class java.lang.Integer
reason                        
|     PropertyKey |          SINGLE | class java.lang.String
location                      
|     PropertyKey |          SINGLE | class org.janusgraph.core.attribute.Geoshape
----------------               |            ---- |     ----------- |            ---------


Graph Index                    |      Type |          Element | Unique |       Backing |     PropertyKey |               Status
-----------                    |      ---- |          ------- | ------ |       ------- |     ----------- |               ------
name                          
| Composite | JanusGraphVertex |   true | internalindex |                 |                    
                               
|           |                  |        |               |            name |              ENABLED
vertices                      
|     Mixed | JanusGraphVertex |  false |        search |                 |                    
                               
|           |                  |        |               |             age |              ENABLED
byNameComposite                
| Composite | JanusGraphVertex |  false | internalindex |                 |                    
                               
|           |                  |        |               |            name |              ENABLED
byNameAndAgeComposite          
| Composite | JanusGraphVertex |  false | internalindex |                 |                    
                               
|           |                  |        |               |            name |              ENABLED
                               
|           |                  |        |               |             age |              ENABLED
byNameUnique                  
| Composite | JanusGraphVertex |   true | internalindex |                 |                    
                               
|           |                  |        |               |            name |              ENABLED
nameAndAge                    
|     Mixed | JanusGraphVertex |  false |        search |                 |                    
                               
|           |                  |        |               |            name |              ENABLED
                               
|           |                  |        |               |             age |              ENABLED
byNameAndLabel                
| Composite | JanusGraphVertex |  false | internalindex |                 |                    
                               
|           |                  |        |               |            name |            INSTALLED
edges                          
|     Mixed |   JanusGraphEdge |  false |        search |                 |                    
                               
|           |                  |        |               |          reason |              ENABLED
                               
|           |                  |        |               |        location |              ENABLED
----------                     |      ---- |          ------- | ------ |       ------- |     ----------- |               ------


Relation Index                 |                 Type |  Direction |   Sort Key | Sort Order |               Status
--------------                 |                 ---- |  --------- | ---------- |   -------- |               ------
battlesByTime                  
|              battled |       BOTH |       time |       decr |              ENABLED
battlesByRatingAndTime        
|              battled |        OUT |     rating |       decr |            INSTALLED
                               
|                      |            |       time |            |                    
--------------                 |                 ---- |  --------- | ---------- |   -------- |               ------


gremlin
>



Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.