Open Sahasrara opened 8 years ago
What does the keys section at the beginning of the file look like. What type is declared there?
I don't see a keys section, but before the nodes section, I see this:
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="directed">
... nodes ...
...edges...
</graph>
</graphml>
Ah! Looks like I forgot to add the -t option. Sorry about that. Thanks!
Actually, even after adding in -t, some of the fields on some of the nodes don't have corresponding keys to specify their type. Here are two examples, both of them are Integers. I'm looking for others.
private Integer id;
private Integer requiredQuantity;
I see other type="int" keys, so i don't think it's specific to the integers. Still digging.
OK, so we have multiple nodes representing domain objects. These object have the same field names, but with different types. It appears that the keys use a global namespace for the typing. I don't know if this was a design choice reflecting something fundamental to the way neo4j works, or if maybe it just require more specificity.
I dumped our neo4j database with export-graphml to a file. Then, in an empty database on another machine, I imported the file with import-graphml. We store dates as longs, and those were converted to strings during the import.