Search code examples
amazon-web-servicesgremlinamazon-neptune

AWS Neptune unable to load with Single cardinality


I’m encountering an issue with the Neptune loader and as far as I can see I’m following the documentation correctly but I can’t get the Neptune Loader to load vertex information from CSVs correctly.

Gremlin Neptune CSV Loader format

I’m using the latest version of Neptune and I’m setting the column data type and cardinality correctly but for some reason Neptune considers that all the properties on the loaded vertexes are SETs. Edge information is loaded correctly.

Please see below an example of how the headers/data look like. I’ve also tried quoting the headers and fields but to no avail. All the properties on the created vertexes are SETs.

enter image description here

As you can see below the loaded data does not have SINGLE cardinality.

enter image description here

Any ideas on how to convince Neptune to load data with the correct cardinality?


Solution

  • By default Apache TinkerPop returns values in a valueMap as lists even if the cardinality is single. If you want to get rid of the list syntax you can do valueMap().by(unfold())

    Edited to add text below:

    If some of the values really are sets of values then you can selectively unfold only the ones that are not as in

    g.V('1').valueMap('myset','myint').by().by(unfold())

    There are more examples here: http://tinkerpop.apache.org/docs/current/reference/#valuemap-step