dqwh1202 2017-01-04 04:11
浏览 52
已采纳

连接IBM Graph和php

I am a beginner with IBM Graph db as well as IBM Bluemix. I need to make entry to the db using php.

Have tried making connection using this library https://github.com/PommeVerte/gremlin-php hosted in official tinkerpop but it doesnt work.

After debugging got to know that whenever it encounters

require_once('vendor/autoload.php'); 
use Brightzone\GremlinDriver\Connection;

$db = new Connection([
'host' => 'localhost',
'graph'=>'g',
'ssl' => [
            "ssl"=>[
                    "verify_peer"=>false,
                    "verify_peer_name"=>false,
            ]
        ]
]);

$db->open(); 

it stops execution. It does not show any error and its just an empty page.

Can somebody guide me in solving this issue?

Thanks

  • 写回答

1条回答 默认 最新

  • douhuo1738 2017-01-04 13:47
    关注

    @Radhika, eventhough IBM Graph supports Tinkerpop 3, it doesn't give you direct access to the gremlin server as it's a multi-tenant hosted service. That being said, connecting to IBM Graph as easy as calling an HTTP API. You can use cURL for example to do that http://codular.com/curl-with-php. The full API doc is right here https://ibm-graph-docs.ng.bluemix.net/api.html.

    There is example code, no php yet, right here https://ibm-graph-docs.ng.bluemix.net/examples.html#node.js. Hopefully, We will add php examples soon.

    So head to bluemix.net, goto to the catalog and look for IBM Graph. Create an instance of IBM Graph and take note of the credentials.

    {
      apiURL:""
      username:""
      password:""
    }
    

    Use those credentials to call the http API's

    I hope that helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器