Oracle PGXでERROR: org.apache.commons.vfs2.FileNotFoundExceptionが出た時の対処法
Oracle PGXを動かす
こちらの記事のチュートリアルを実行しようと思い、Oracle PGXを動かしてみました。
また、チュートリアルについて詳しく知りたい方はこちらの記事をご覧ください!今回は、チュートリアル実践中に出てきたエラーについて書いていきます。
以前構築したWindows環境で実行します。
手順通りにPGXを動かす
記事にある手順通りに進めてみます。
1. データの入手
Exposedata.comにあるHero Social Network Data
をダウンロードします。
2. JSON形式に加工
1で入手したデータをPGXに読み込んでもらうため、データの定義づけをします。今回はjsonファイルで記述します。
hero-network.csv.json
{
"uri": "hero-network.csv" #どのデータかを教えてあげる
, "format": "edge-list" #形式を指定
, "node_id_type": "string" #ノード番号のデータ型を指定
, "separator": "," #どこで区切るかを指定
}
3. データの保存
上記2つのデータをpgx-server.zipを保存したディレクトリと同じディレクトリに保存し、PGXシェルにグラフをロードします。
pgx> G=session.readGraphWithProperties("hero-network.csv.json")
ERROR: org.apache.commons.vfs2.FileNotFoundException: Could not read from "file:///work/hero-network.csv.json" because it is not a file.
・・・ん???
ファイルが読めない??
(このエラーを解決することだけに2日注力しました笑)
解決法
1. 上記2つのファイルを保存してあるディレクトリに移動する
> chdir 上記2つのファイルを保存してあるディレクトリ
2. 以下のコマンドを実行
> docker run -it --rm -v %cd%:/work pgx:19.1.0 pgx
3. グラフをロードする
pgx> G=session.readGraphWithProperties("hero-network.csv.json")
==> PgxGraph[name=hero-network,N=6426,E=574467,created=1560123745814]
ロードできました!
終わりに
他にもこういう解決策あるよ~などとご存じの方がいらっしゃいましたら、ご教授頂けると幸いです。
Author And Source
この問題について(Oracle PGXでERROR: org.apache.commons.vfs2.FileNotFoundExceptionが出た時の対処法), 我々は、より多くの情報をここで見つけました https://qiita.com/kk31108424/items/cf4fe920053c200746f9著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .