JanusGraph .graphml file schema issue while creating in Cassandra

Author: AnD

I am trying to create schema from .graphml file and using Cassandra as backend storage. I am getting below issue when trying to load data into the schema created for the attached .graphml file. The schema definition is following.

    private static void setAirRouteSchema(JanusGraphManagement mgmt, JanusGraph graph) throws IOException {

//        System.out.println("Inside setAirRouteSchema  "+mgmt);
        // Define edge labels and usage
        mgmt = graph.openManagement();
        mgmt.makeEdgeLabel("Frederick Douglass Boulevard").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("West Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("North Moore Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Nagle Avenue").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Broadway").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Rivington Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("West 144th Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("[u'River Terrace', u'Vesey Place']").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Avenue C").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Division Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Eldridge Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("East 79th Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Madison Avenue").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("East 27th Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("Hester Street").multiplicity(MULTI).make();
        mgmt.makeEdgeLabel("East 81st Street").multiplicity(MULTI).make();
        mgmt.commit();

// Define vertex labels
        mgmt = graph.openManagement();
        mgmt.makeVertexLabel("traffic_signals").make();
        mgmt.commit();

// Define vertex property keys
        mgmt = graph.openManagement();
        mgmt.makePropertyKey("ref").dataType(String.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("highway").dataType(String.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("osmid").dataType(String.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("x").dataType(String.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("y").dataType(String.class).cardinality(Cardinality.SINGLE).make();
        mgmt.commit();

// Define edge property keys
        mgmt = graph.openManagement();
        mgmt.makePropertyKey("service").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("access").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("width").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("tunnel").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("bridge").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
//        mgmt.makePropertyKey("ref").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("geometry").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("maxspeed").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("lanes").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
//        mgmt.makePropertyKey("key").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("oneway").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
//        mgmt.makePropertyKey("highway").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
//        mgmt.makePropertyKey("osmid").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("length").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.makePropertyKey("name").dataType(Integer.class).cardinality(Cardinality.SINGLE).make();
        mgmt.commit();

}

GraphMl file loaded from here : https://www.kaggle.com/crailtap/street-network-of-new-york-in-graphml

Error :

Exception in thread "main" java.lang.IllegalArgumentException: Name cannot be in protected namespace: edge
    at org.janusgraph.graphdb.types.system.SystemTypeManager.throwIfSystemName(SystemTypeManager.java:72)
    at org.janusgraph.graphdb.types.StandardRelationTypeMaker.name(StandardRelationTypeMaker.java:181)
    at org.janusgraph.graphdb.types.StandardRelationTypeMaker.<init>(StandardRelationTypeMaker.java:53)

Also Schema is being created but data is not getting entered. Printing the schema created:

------------------------------------------------------------------------------------------------
Vertex Label Name              | Partitioned | Static                                             |
---------------------------------------------------------------------------------------------------
traffic_signals                | false       | false                                              |
---------------------------------------------------------------------------------------------------
Edge Label Name                | Directed    | Unidirected | Multiplicity                         |
---------------------------------------------------------------------------------------------------
East 81st Street               | true        | false       | MULTI                                |
Frederick Douglass Boulevard   | true        | false       | MULTI                                |
West Street                    | true        | false       | MULTI                                |
North Moore Street             | true        | false       | MULTI                                |
Nagle Avenue                   | true        | false       | MULTI                                |
Broadway                       | true        | false       | MULTI                                |
Rivington Street               | true        | false       | MULTI                                |
West 144th Street              | true        | false       | MULTI                                |
[u'River Terrace', u'Vesey Place'] | true        | false       | MULTI                                |
Avenue C                       | true        | false       | MULTI                                |
Division Street                | true        | false       | MULTI                                |
Eldridge Street                | true        | false       | MULTI                                |
East 79th Street               | true        | false       | MULTI                                |
Madison Avenue                 | true        | false       | MULTI                                |
East 27th Street               | true        | false       | MULTI                                |
Hester Street                  | true        | false       | MULTI                                |
---------------------------------------------------------------------------------------------------
Property Key Name              | Cardinality | Data Type                                          |
---------------------------------------------------------------------------------------------------
ref                            | SINGLE      | class java.lang.String                             |
highway                        | SINGLE      | class java.lang.String                             |
osmid                          | SINGLE      | class java.lang.String                             |
x                              | SINGLE      | class java.lang.String                             |
y                              | SINGLE      | class java.lang.String                             |
service                        | SINGLE      | class java.lang.Integer                            |
access                         | SINGLE      | class java.lang.Integer                            |
width                          | SINGLE      | class java.lang.Integer                            |
tunnel                         | SINGLE      | class java.lang.Integer                            |
bridge                         | SINGLE      | class java.lang.Integer                            |
geometry                       | SINGLE      | class java.lang.Integer                            |
maxspeed                       | SINGLE      | class java.lang.Integer                            |
lanes                          | SINGLE      | class java.lang.Integer                            |
oneway                         | SINGLE      | class java.lang.Integer                            |
length                         | SINGLE      | class java.lang.Integer                            |
name                           | SINGLE      | class java.lang.Integer                            |
---------------------------------------------------------------------------------------------------
Vertex Index Name              | Type        | Unique    | Backing        | Key:           Status |
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Edge Index (VCI) Name          | Type        | Unique    | Backing        | Key:           Status |
----------------------------------

-----------------------------------------------------------------

Relation Index | Type | Direction | Sort Key | Order | Status |

Originally Sourced from: https://stackoverflow.com/questions/57881140/janusgraph-graphml-file-schema-issue-while-creating-in-cassandra