1

https://github.com/jexp/neo4j-shell-toolsのツールを使用して neo4j-shell を実行すると、 http://validator.w3.org/checkで検証された私の graphml ファイルが読み込まれません。

Neo4j は、OpenJDK IcedTea 2.3.9 を使用する KDE の下の Ubuntu で実行されます。

コマンドとメッセージは次のとおりです。

neo4j-sh (0)$ import-graphml -i /home/larsj/Prosjekt/neograf/bigram_graph.xml -t bigram
GraphML-Import file /home/larsj/Prosjekt/neograf/bigram_graph.xml 
rel-type bigram batch-size 40000 use disk-cache false
0. 100%: nodes = 1 rels = 0 properties = 0 time 6 ms
null

どのように機能させることができますか?これが私のgraphmlファイルのスニペットです:

<?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">

<key id = "form0" for = "node" attr.name = "label" attr.type = "string"/>
<key id = "freq0" for = "all" attr.name = "frequency" attr.type = "int"/>
<key id = "mi0" for = "edge" attr.name = "mi" attr.type = "float"/>
<key id = "label0" for = "edge" attr.name = "label" attr.type = "string">
   <default>bigram</default>
</key><graph id="nb.no/bigrams" edgedefault="directed">    <node id="1512655">
    <data key = "form0">barn</data>
    <data key = "freq0">526136</data>
</node>
<node id="1781558">
    <data key = "form0">fattige</data>
    <data key = "freq0">49089</data>
</node>
<edge  source = "2305969" target = "3070510">
    <data key = "freq0">86421</data>
    <data key = "mi0">71.57629973392675</data>
</edge>
<edge  source = "3070510" target = "3070510">
    <data key = "freq0">22</data>
    <data key = "mi0">-9.818479721124337</data>
</edge>

4

1 に答える 1

0

neo4j shell-tools の import-graphml コマンドの落とし穴の 1 つは、すべてのキーがドキュメントのグラフ タグの前にキー ID を持つようにすることです。key id セクションで定義されていないキーを持つノードまたはエッジは、shell-tools によってインポートされません。ファイル全体が表示されない場合、XML キー ID が定義されていないノード/エッジ プロパティである可能性があります。

キー ID の不一致を確認するには、XML ツールと呼ばれる Notepad++ 用の XML プラグインを使用します。インストールしたら、[プラグイン] > [XML ツール] > [今すぐ検証] に移動します。定義されていないキー ID を含むダイアログ ボックスが表示されます。

「データ」フィールドのすべてのプロパティに「グラフ」タグの前にキー ID が定義されている限り、インポート コマンドは機能します。Neo4j shell-tools コンソールに次のように入力します。

import-graphml -i [name of input graphml file]

Neo4j から GraphML にエクスポートするときにこれらのキー ID を含めたい場合は、shell-tools コンソールでこのコマンドを使用します。データベースをダンプしてから Neo4j の形式にロードし直す場合に便利です。

$ export-graphml -o [name of output graphml file] -t

于 2014-04-07T18:33:25.327 に答える