2016-10-30 55 views
1

如何從JSON文件導入到泰坦DB,當我使用地理位置屬性?泰坦DB 1.0.0:無法導入JSON文件到泰坦TinkerPop 3.x

我與泰坦DB TP3工作 - 3.0.1版,孵化

gremlin> Gremlin.version() 
==>3.0.1-incubating 
gremlin> 

,並使用GeoShape index屬性(地理位置), 嘗試導出和導入到新的數據庫。

我的步驟如下:

//export : 
     tg = TitanFactory.open(‘../conf/titan-db.properties’) 
     tg.io(IoCore.graphson()).writeGraph('/var/backups/PRODUCTION_DATA_27_10_16.json'); 



    //import to new DB: 
     tg.io(IoCore.graphson()).readGraph('/var/backups/PRODUCTION_DATA_27_10_16.json'); 

但不幸得了例外:

gremlin> tg.io(IoCore.graphson()).readGraph('/var/backups/PRODUCTION_DATA_27_10_16.json'); 
Property value [{type=Point, coordinates=[33.0, 32.0]}] is of type class java.util.LinkedHashMap is not supported 
Display stack trace? [yN] y 
java.lang.IllegalArgumentException: Property value [{type=Point, coordinates=[33.0, 32.0]}] is of type class java.util.LinkedHashMap is not supported 
    at org.apache.tinkerpop.gremlin.structure.Property$Exceptions.dataTypeOfPropertyValueNotSupported(Property.java:159) 
    at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.verifyAttribute(StandardTitanTx.java:564) 
    at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.addProperty(StandardTitanTx.java:716) 
    at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.property(AbstractVertex.java:142) 
    at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.property(AbstractVertex.java:23) 
    at org.apache.tinkerpop.gremlin.structure.util.Attachable$Method.lambda$createVertex$26(Attachable.java:296) 

請任何解決方案...。?

回答

2

它看起來像你遇到了這個Issue 1183泰坦1.0.0 GraphSONWriter.writeGraph JsonMappingException,它已經被修復。嘗試從源代碼構建titan11分支。如果你需要建設它的方向,請查看這個Titan mailing list post中的步驟。

如果你想用serialization fix修補泰坦1.0.0構建,而不是拉昇至titan11,試試這個,而不是(discussed here):

git clone https://github.com/thinkaurelius/titan.git 
cd titan 
git checkout 1.0.0 
git cherry-pick 6dfc816d821a7739398e5cebc1e999d75c866c19 
mvn clean install -DskipTests=true -Dgpg.skip=true -Paurelius-release 
unzip titan-dist/titan-dist-hadoop-1/target/titan-1.0.0-hadoop1.zip 
+0

題外話:什麼是1.1版本的ETA ?你碰巧知道嗎? – Ralf

+0

Datastax(誰收購奧勒留)沒有時間表。您可以在Titan郵件列表中看到這條消息:「構建TitanDB的Aurelius團隊已經開始使用DataStax來開發DSE Graph,TitanDB的後繼者。請聯繫支持以獲取有關DSE Graph或使用StackOverflow的幫助。 –

+0

但是,作爲一個開放項目,泰坦社區的復興工作正在進行中。 –