How to install sqlg on Tinkerpop

$ su -
암호:
[root:/root]#su -l postgres

-bash-4.1$ psql postgres
psql (10.7)
도움말을 보려면 "help"를 입력하십시오.

postgres=# create database sqlgraphdb owner agraph;
CREATE DATABASE
postgres=# \q
-bash-4.1$ exit
logout

[root:/root]#exit
logout

$ psql -h localhost -U agraph sqlgraphdb
agraph 사용자의 암호:
psql (10.7)
도움말을 보려면 "help"를 입력하십시오.

sqlgraphdb=> \q
$
$ bin/gremlin.sh
3월 06, 2019 3:35:55 오후 java.util.prefs.FileSystemPreferences$1 run
정보: Created user preferences directory.

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> :install org.umlg sqlg-postgres 2.0.1
==>Conflicting module versions. Module [groovy-swing is loaded in version 2.4.16 and you are trying to load version 2.4.15
gremlin> :quit
$

https://github.com/blazegraph/tinkerpop3/issues/4#issuecomment-281932805

https://github.com/blazegraph/tinkerpop3/issues/4#issuecomment-281932805

$ mkdir temp
$ mv gremlin-console/lib/groovy-swing-2.4.16.jar temp/
$ mv gremlin-console/lib/groovy-jsr223-2.4.16-indy.jar temp/
$ mv gremlin-console/lib/groovy-xml-2.4.16.jar temp/
$ vi ~/.groovy/grapeConfig.xml
<ivysettings>
  <settings defaultResolver="downloadGrapes"/>
  <resolvers>
    <chain name="downloadGrapes">
      <filesystem name="cachedGrapes">
        <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
        <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
      </filesystem>
      <ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/>
      <ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
      <ibiblio name="central" root="http://central.maven.org/maven2/" m2compatible="true"/>
      <ibiblio name="jitpack" root="https://jitpack.io" m2compatible="true"/>
      <ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
     </chain>
  </resolvers>
</ivysettings>

$ cd gremlin-console/
$ bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> :install org.umlg sqlg-postgres 2.0.1
==>a module with the name sqlg-postgres is already installed
gremlin> :plugin list
==>tinkerpop.server[active]
==>tinkerpop.gephi
==>tinkerpop.utilities[active]
==>tinkerpop.sugar
==>tinkerpop.credentials
==>sqlg.postgres
==>tinkerpop.tinkergraph[active]
gremlin> :plugin use sqlg.postgres
==>sqlg.postgres activated
gremlin> :quit
$
jdbc.url=jdbc:postgresql://localhost:5432/sqlgraphdb
jdbc.username=agraph
jdbc.password=********
</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre class="wp-block-code"><code>
$ bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: sqlg.postgres
plugin activated: tinkerpop.tinkergraph
gremlin&gt; graph = SqlgGraph.open('conf/sqlg.properties')
==&gt;sqlggraph[SqlGraph] (jdbc:postgresql://localhost:5432/sqlgraphdb) (user = agraph)
gremlin&gt; g = graph.traversal()
==&gt;sqlggraphtraversalsource[sqlggraph[SqlGraph] (jdbc:postgresql://localhost:5432/sqlgraphdb) (user = agraph), standard]
gremlin&gt; graph.io(GraphSONIo.build(GraphSONVersion.V3_0)).readGraph("data/grateful-dead.json")
==&gt;null
gremlin&gt; g.V().groupCount().by(label)
==&gt;[song:584,artist:224]
gremlin&gt; g.E().groupCount().by(label)
==&gt;[followedBy:7047,sungBy:501,writtenBy:501]
gremlin&gt; g.V().limit(1).properties()
==&gt;vp[name-&gt;HEY BO DIDDLEY]
==&gt;vp[songType-&gt;cover]
==&gt;vp[performances-&gt;5]
gremlin&gt; :quit
$

답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Google photo

Google의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

%s에 연결하는 중

%d 블로거가 이것을 좋아합니다: