Titan DB 1.0.0:无法将 Json 文件导入 titan TinkerPop 3.x
Titan DB 1.0.0 : Cannot import Json file into titan TinkerPop 3.x
当我使用地理定位 属性 时,如何从 JSON 文件导入 titan DB ??
我正在使用 Titan DB TP3 - 版本 3.0.1-incubating
gremlin> Gremlin.version()
==>3.0.1-incubating
gremlin>
并使用 GeoShape 索引 属性(地理定位),
尝试导出和导入新数据库。
我的步骤如下:
//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(Attachable.java:296)
请问任何解决方案.. .?
看起来您 运行 喜欢这个 Issue 1183: Titan 1.0.0 GraphSONWriter.writeGraph JsonMappingException, which has already been fixed. Try building the titan11
branch from source code. If you need directions for building it, review the steps in this Titan mailing list post。
如果您想使用 serialization fix and not move up to titan11
, try this instead (discussed here 修补 Titan 1.0.0 版本):
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
当我使用地理定位 属性 时,如何从 JSON 文件导入 titan DB ??
我正在使用 Titan DB TP3 - 版本 3.0.1-incubating
gremlin> Gremlin.version()
==>3.0.1-incubating
gremlin>
并使用 GeoShape 索引 属性(地理定位), 尝试导出和导入新数据库。
我的步骤如下:
//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(Attachable.java:296)
请问任何解决方案.. .?
看起来您 运行 喜欢这个 Issue 1183: Titan 1.0.0 GraphSONWriter.writeGraph JsonMappingException, which has already been fixed. Try building the titan11
branch from source code. If you need directions for building it, review the steps in this Titan mailing list post。
如果您想使用 serialization fix and not move up to titan11
, try this instead (discussed here 修补 Titan 1.0.0 版本):
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