We are talking about TinkerPop3. TinkerPop is graph computing framework offering 3 parts. 3 packaged downloads includes Gremlin Console, Gremlin Server and the source distribution. TinkerPop is slightly confusing to understand to get started. Here is how to install Apache TinkerPop (Gremlin Server) with PHP client on server. Implementations of TinkerPop are Sqlg, Blaze Graph, TinkerGraph, Elastic Gremlin, Hadoop Giraph, IBM Graph, Neo4j, Stardog, TinkerGraph, Titan, Unipop, DuctileDB, hgraphdb, JanusGraph. Obviously there are many clients in different languages. The guides on the web are for specific purposes.
These resources can help you to get started :
1 2 | http://tinkerpop.apache.org/docs/current/tutorials/getting-started/ https://github.com/tinkerpop/gremlin |
Obviously, who is going to use Apache TinkerPop at least seriously used Apache Spark at least once. We are pointing towards the possibility to develop WordPress Plugin with such backend. WordPress can be used as such or WordPress can be used as application backend.
---
Install Apache TinkerPop (Gremlin Server) With PHP Client
We can use Neo4J, Elastic Search, Spark as database backend. It is actually easy to get started with Gremlin Server, latest TinkerPop is here :
1 | http://tinkerpop.apache.org/downloads.html |
TinkerPop needs Maven and Java 1.8.0_40+ for proper building and proper operations. You can follow our other any major Big Data tutorial to install Maven and Java. Apart from official Apache repo, we will find TinkerPop on Github :
1 | https://github.com/apache/tinkerpop |
Official way is to install in this way :
1 2 3 4 | cd ~ wget https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.5/apache-tinkerpop-gremlin-server-3.2.5-bin.zip unzip apache-tinkerpop-gremlin-server-3.2.5-bin.zip ls -al |
You can clone the git :
1 | git clone https://github.com/apache/tinkerpop.git |
and run with :
1 | mvn clean install |
In either way, you have to execute the bin/gremlin.sh
script which will give this output :
1 2 3 4 5 6 | \,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities plugin activated: tinkerpop.tinkergraph |
Gremlin PHP client is on Github :
1 | https://github.com/PommeVerte/gremlin-php |
You will get good examples on that repo. You can download Composer :
1 2 3 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" |
Then run :
1 | php composer.phar require brightzone/gremlin-php "2.*" |
For PHP 7.x, you’ll need to give the SSL certificate information (in case you are directly handling PHP) :
1 2 3 4 5 6 7 8 9 10 11 | $db = new Connection([ 'host' => 'localhost', 'graph' => 'graph', 'ssl' => [ "ssl"=> [ "cafile" => "/path/to/bundle/ca-bundle.crt", "verify_peer"=> true, "verify_peer_name"=> true, ] ] ]); |