0

How do I store arrays/lists in edge/vertex property values ?

Thanks,

munx
  • 11
  • 2
  • Is it possible to write a custom serializer ? I would like to store a java.util.LinkedHashMap Object. – munx Feb 08 '16 at 03:30

1 Answers1

0

Are you trying this in IBM Graph ? As of now, the types that are supported in IBM Graph are the primitive data types : string , long, double and boolean. Your best option would be to convert/serialize that object into a string and store that as a property of your edge/vertex.

Alaa Mahmoud
  • 743
  • 3
  • 18
  • Hi Mahmoud, Can you elaborate a bit on the serialization ttechnique. Can you give me link to the tutorial. Yes I am using IBM graph database. Thanks – munx Feb 11 '16 at 20:00
  • The idea is converting the object to JSON format and store that JSON object as a string in a vertex or edge property. If you're using org.json for example , you can do `String jsonString = new JSONObject(data).toString()`. [Check this question in SO](http://stackoverflow.com/questions/22870584/convert-from-linkedhashmap-to-json-string) and this one for [ordered JSON](http://stackoverflow.com/questions/29491281/building-ordered-json-string-from-linkedhashmap) – Alaa Mahmoud Feb 12 '16 at 14:12