4

Blazegraph を使用して ConceptNet でグラフ アルゴリズムを実行する実験を行っていますが、まずデータをインポートする必要があります。データはWrite Once, Read Manyになるため、インクリメンタル書き込みは必要ありません。

Blazegraph 2.1.1 を .deb ファイルからインストールしました。blazegraph.jarまた、blazegraph.jar でのコマンドの実行に関する指示に従うことができるようにダウンロードしました。

このファイルassoc.ntは、約 2500 万のエッジを含む N-Triples 形式です。最初からいくつかを次に示します。

</c/af/a_foei_tog/r> </r/SenseOf> </c/af/a_foei_tog> .
</c/af/a_foei_tog/r> </r/Synonym> </c/af/jammer> .
</c/af/a_foei_tog/r> </r/Synonym> </c/af/ongelukkig> .
</c/af/a_foei_tog/r> </r/RelatedTo> </c/fr/malheureusement> .
</c/af/a_foe%C4%B1_tog/r> </r/SenseOf> </c/af/a_foe%C4%B1_tog> .
</c/af/a_foe%C4%B1_tog/r> </r/Synonym> </c/af/jammer> .
</c/af/a_foe%C4%B1_tog/r> </r/Synonym> </c/af/ongelukk%C4%B1g> .
</c/af/a_foe%C4%B1_tog/r> </r/RelatedTo> </c/fr/malheureusement> .
</c/af/a_ja_a/r> </r/SenseOf> </c/af/a_ja_a> .
</c/af/a_ja_a/r> </r/Synonym> </c/af/seker> .
</c/af/a_ja_a/r> </r/Synonym> </c/af/sekerlik> .

GitHubfastload.propertiesの Blazegraph サンプルから取得しましたが、末尾を変更しました。

  • com.bigdata.journal.AbstractJournal.file=blazegraph.jnlそうしないと、プロパティが見つからないことがわかります。

  • bufferModeをからDiskRWに変更したのはDisk誰かのプロパティ ファイルが、これにより Write-Once-Read-Many セマンティクスが得られることを示していたためです。これはまさに私が望んでいるものです。

ここに私の最終的なものがありfastload.propertiesます:

# This configuration turns off incremental inference for load and retract, so
# you must explicitly force these operations if you want to compute the closure
# of the knowledge base.  Forcing the closure requires punching through the SAIL
# layer.  Of course, if you are not using inference then this configuration is
# just the ticket and is quite fast.

# set the initial and maximum extent of the journal
com.bigdata.journal.AbstractJournal.initialExtent=209715200
com.bigdata.journal.AbstractJournal.maximumExtent=209715200

# turn off automatic inference in the SAIL
com.bigdata.rdf.sail.truthMaintenance=false

# don't store justification chains, meaning retraction requires full manual
# re-closure of the database
com.bigdata.rdf.store.AbstractTripleStore.justify=false

# turn off the statement identifiers feature for provenance
com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=false

# turn off the free text index
com.bigdata.rdf.store.AbstractTripleStore.textIndex=false

com.bigdata.journal.AbstractJournal.bufferMode=Disk
com.bigdata.journal.AbstractJournal.file=blazegraph.jnl

コマンドを実行しました:

java -cp blazegraph.jar com.bigdata.rdf.store.DataLoader -namespace conceptnet fastload.properties ~/conceptnet5/data/assoc/assoc.nt

数分間 CPU を回転させましたが、最終的には何も追加されていないようです。私が得た出力は次のとおりです。

WARN : ServiceProviderHook.java:171: Running.
INFO: com.bigdata.util.config.LogUtil: Configure: jar:file:/home/rspeer/src/blazegraph/blazegraph.jar!/log4j.properties

BlazeGraph(TM) Graph Engine

                   Flexible
                   Reliable
                  Affordable
      Web-Scale Computing for the Enterprise

Copyright SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.

[my hostname appeared here]
Mon Jun 13 13:36:05 EDT 2016
Linux/3.13.0-83-generic amd64
Intel(R) Xeon(R) CPU E5-2640 v2 @ 2.00GHz Family 6 Model 62 Stepping 4, GenuineIntel #CPU=4
Oracle Corporation 1.8.0_74
freeMemory=1002354744
buildVersion=2.1.1
gitCommit=90d9e8232969a8afdc830e856643e5416bb50d0a

Dependency         License                                                                 
ICU                http://source.icu-project.org/repos/icu/icu/trunk/license.html          
bigdata-ganglia    http://www.apache.org/licenses/LICENSE-2.0.html                         
blueprints-core    https://github.com/tinkerpop/blueprints/blob/master/LICENSE.txt         
colt               http://acs.lbl.gov/software/colt/license.html                           
commons-codec      http://www.apache.org/licenses/LICENSE-2.0.html                         
commons-fileupload http://www.apache.org/licenses/LICENSE-2.0.html                         
commons-io         http://www.apache.org/licenses/LICENSE-2.0.html                         
commons-logging    http://www.apache.org/licenses/LICENSE-2.0.html                         
dsiutils           http://www.gnu.org/licenses/lgpl-2.1.html                               
fastutil           http://www.apache.org/licenses/LICENSE-2.0.html                         
flot               http://www.opensource.org/licenses/mit-license.php                      
high-scale-lib     http://creativecommons.org/licenses/publicdomain                        
httpclient         http://www.apache.org/licenses/LICENSE-2.0.html                         
httpclient-cache   http://www.apache.org/licenses/LICENSE-2.0.html                         
httpcore           http://www.apache.org/licenses/LICENSE-2.0.html                         
httpmime           http://www.apache.org/licenses/LICENSE-2.0.html                         
jackson-core       http://www.apache.org/licenses/LICENSE-2.0.html                         
jetty              http://www.apache.org/licenses/LICENSE-2.0.html                         
jquery             https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt            
jsonld             https://raw.githubusercontent.com/jsonld-java/jsonld-java/master/LICENCE
log4j              http://www.apache.org/licenses/LICENSE-2.0.html                         
lucene             http://www.apache.org/licenses/LICENSE-2.0.html                         
nanohttp           http://elonen.iki.fi/code/nanohttpd/#license                            
rexster-core       https://github.com/tinkerpop/rexster/blob/master/LICENSE.txt            
river              http://www.apache.org/licenses/LICENSE-2.0.html                         
semargl            https://github.com/levkhomich/semargl/blob/master/LICENSE               
servlet-api        http://www.apache.org/licenses/LICENSE-2.0.html                         
sesame             http://www.openrdf.org/download.jsp                                     
slf4j              http://www.slf4j.org/license.html                                       
zookeeper          http://www.apache.org/licenses/LICENSE-2.0.html                         

Reading properties: fastload.properties
Will load from: /home/rspeer/conceptnet5/data/assoc/assoc.nt
Journal file: blazegraph.jnl
Load: 0 stmts added in 171.173 secs, rate= 0, commitLatency=0ms, {failSet=0,goodSet=1}
Total elapsed=172015ms
4

1 に答える 1