久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='IKDQd'><style id='IKDQd'><dir id='IKDQd'><q id='IKDQd'></q></dir></style></legend>
  • <small id='IKDQd'></small><noframes id='IKDQd'>

    1. <tfoot id='IKDQd'></tfoot>

    2. <i id='IKDQd'><tr id='IKDQd'><dt id='IKDQd'><q id='IKDQd'><span id='IKDQd'><b id='IKDQd'><form id='IKDQd'><ins id='IKDQd'></ins><ul id='IKDQd'></ul><sub id='IKDQd'></sub></form><legend id='IKDQd'></legend><bdo id='IKDQd'><pre id='IKDQd'><center id='IKDQd'></center></pre></bdo></b><th id='IKDQd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IKDQd'><tfoot id='IKDQd'></tfoot><dl id='IKDQd'><fieldset id='IKDQd'></fieldset></dl></div>

        • <bdo id='IKDQd'></bdo><ul id='IKDQd'></ul>

        Neo4j - Graphaware reco4php - 命名空間問題

        Neo4j - Graphaware reco4php - Problem with namespaces(Neo4j - Graphaware reco4php - 命名空間問題)

        • <small id='BA6IQ'></small><noframes id='BA6IQ'>

          <i id='BA6IQ'><tr id='BA6IQ'><dt id='BA6IQ'><q id='BA6IQ'><span id='BA6IQ'><b id='BA6IQ'><form id='BA6IQ'><ins id='BA6IQ'></ins><ul id='BA6IQ'></ul><sub id='BA6IQ'></sub></form><legend id='BA6IQ'></legend><bdo id='BA6IQ'><pre id='BA6IQ'><center id='BA6IQ'></center></pre></bdo></b><th id='BA6IQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BA6IQ'><tfoot id='BA6IQ'></tfoot><dl id='BA6IQ'><fieldset id='BA6IQ'></fieldset></dl></div>
          <legend id='BA6IQ'><style id='BA6IQ'><dir id='BA6IQ'><q id='BA6IQ'></q></dir></style></legend>
            <tbody id='BA6IQ'></tbody>

              <bdo id='BA6IQ'></bdo><ul id='BA6IQ'></ul>

                  <tfoot id='BA6IQ'></tfoot>
                  本文介紹了Neo4j - Graphaware reco4php - 命名空間問題的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試從 Neo4j 運行演示 - reco4php 頁面位于 此鏈接我非常仔細地遵循了每個步驟,但最后卻出現了一個奇怪的錯誤.

                  I'm trying to run the demo from Neo4j - reco4php page at This Link I followed every steps very carefully but i'm getting a strange error at the end.

                  讓我更詳細地解釋一下:

                  let me explain in more details :

                  這是我要運行的代碼:

                  require 'vendor/autoload.php';
                  
                  use GraphAwareCommonCypherStatement;
                  use GraphAwareCommonTypeNode;
                  use GraphAwareReco4PHPContextContext;
                  use GraphAwareReco4PHPEngineSingleDiscoveryEngine;
                  
                  class RatedByOthers extends SingleDiscoveryEngine
                  {
                  public function discoveryQuery(Node $input, Context $context)
                  {
                      $query = 'MATCH (input:User) WHERE id(input) = {id}
                      MATCH (input)-[:RATED]->(m)<-[:RATED]-(o)
                      WITH distinct o
                      MATCH (o)-[:RATED]->(reco)
                      RETURN distinct reco LIMIT 500';
                  
                      return Statement::create($query, ['id' => $input->identity()]);
                  }
                  
                  public function name()
                  {
                      return "rated_by_others";
                  }
                  }
                  

                  上面的代碼擴展了類SingleDiscoveryEngine":

                  This above code extends the class "SingleDiscoveryEngine" :

                  declare (strict_types = 1);
                  
                  namespace GraphAwareReco4PHPEngine;
                  
                  use GraphAwareCommonResultRecord;
                  use GraphAwareCommonResultResultCollection;
                  use GraphAwareCommonTypeNode;
                  use GraphAwareReco4PHPContextContext;
                  use GraphAwareReco4PHPResultRecommendations;
                  use GraphAwareReco4PHPResultSingleScore;
                  
                  abstract class SingleDiscoveryEngine implements DiscoveryEngine
                  {
                  private static $DEFAULT_RECO_NAME = 'reco';
                  private static $DEFAULT_SCORE_NAME = 'score';
                  private static $DEFAULT_REASON_NAME = 'reason';
                  
                  
                  public function buildScore(Node $input, Node $item, Record $record, Context 
                  $context) : SingleScore
                  {
                      $score = $record->hasValue($this->scoreResultName()) ? $record- >value($this->scoreResultName()) : $this->defaultScore();
                      $reason = $record->hasValue($this->reasonResultName()) ? $record- >value($this->reasonResultName()) : null;
                  
                      return new SingleScore($score, $reason);
                  }
                  
                  
                  final public function produceRecommendations(Node $input, ResultCollection 
                  $resultCollection, Context $context) : Recommendations
                  {
                      $result = $resultCollection->get($this->name());
                      $recommendations = new Recommendations($context);
                  
                      foreach ($result->records() as $record) {
                          if ($record->hasValue($this->recoResultName())) {
                              $recommendations->add($record->get($this->recoResultName()), $this->name(), $this->buildScore($input, $record->get($this->recoResultName()), 
                  $record, $context));
                          }
                      }
                  
                      return $recommendations;
                  }
                  
                  /**
                   * {@inheritdoc}
                   */
                  public function recoResultName() : string
                  {
                      return self::$DEFAULT_RECO_NAME;
                  }
                  
                  /**
                   * {@inheritdoc}
                   */
                  public function scoreResultName() : string
                  {
                      return self::$DEFAULT_SCORE_NAME;
                  }
                  
                  /**
                   * {@inheritdoc}
                   */
                  public function reasonResultName() : string
                  {
                      return self::$DEFAULT_REASON_NAME;
                  }
                  
                  /**
                   * {@inheritdoc}
                   */
                  public function defaultScore() : float
                  {
                      return 1.0;
                  }
                  }
                  

                  上面的類還實現了下面的類:

                  and the above class is also implements the following class :

                  namespace GraphAwareReco4PHPEngine;
                  
                  use GraphAwareCommonCypherStatementInterface;
                  use GraphAwareCommonResultRecord;
                  use GraphAwareCommonTypeNode;
                  use GraphAwareCommonResultResultCollection;
                  use GraphAwareReco4PHPContextContext;
                  use GraphAwareReco4PHPResultRecommendations;
                  use GraphAwareReco4PHPResultSingleScore;
                  
                  interface DiscoveryEngine
                  {
                  /**
                   * @return string The name of the discovery engine
                   */
                  public function name() : string;
                  
                  /**
                   * The statement to be executed for finding items to be recommended.
                   *
                   * @param Node    $input
                   * @param Context $context
                   *
                   * @return GraphAwareCommonCypherStatement
                   */
                  public function discoveryQuery(Node $input, Context $context) : StatementInterface;
                  
                  /**
                   * Returns the score produced by the recommended item.
                   *
                   * @param Node    $input
                   * @param Node    $item
                   * @param Record  $record
                   * @param Context $context
                   *
                   * @return GraphAwareReco4PHPResultSingleScore A single score produced for the recommended item
                   */
                  public function buildScore(Node $input, Node $item, Record $record, Context $context) : SingleScore;
                  
                  /**
                   * Returns a collection of Recommendation object produced by this discovery engine.
                   *
                   * @param Node             $input
                   * @param ResultCollection $resultCollection
                   * @param Context          $context
                   *
                   * @return Recommendations
                   */
                  public function produceRecommendations(Node $input, ResultCollection $resultCollection, Context $context) : Recommendations;
                  
                  /**
                   * @return string The column identifier of the row result representing the recommended item (node)
                   */
                  public function recoResultName() : string;
                  
                  /**
                   * @return string The column identifier of the row result representing the score to be used, note that this
                   *                is not mandatory to have a score in the result. If empty, the score will be the float value returned by
                   *                <code>defaultScore()</code> or the score logic if the concrete class override the <code>buildScore</code>
                   *                method.
                   */
                  public function scoreResultName() : string;
                  
                  /**
                   * @return float The default score to be given to the discovered recommended item
                   */
                  public function defaultScore() : float;
                  }
                  

                  當我運行代碼時出現以下錯誤:

                  And when I run the code I'm getting the following error :

                  致命錯誤:RatedByOthers::name() 的聲明必須與 GraphAwareReco4PHPEngineDiscoveryEngine::name() 兼容:第 9 行/Applications/XAMPP/xamppfiles/htdocs/reco/index.php 中的字符串

                  Fatal error: Declaration of RatedByOthers::name() must be compatible with GraphAwareReco4PHPEngineDiscoveryEngine::name(): string in /Applications/XAMPP/xamppfiles/htdocs/reco/index.php on line 9

                  我檢查了幾個小時的代碼,我認為它應該可以正常工作,但我不知道問題出在哪里.

                  I checked the code for hours and I think it should works fine and I have no idea where the problem comes from.

                  推薦答案

                  我自己找到了答案.

                  通過在函數啟動后立即聲明返回類型解決的問題:

                  The problem solved by declaring the type of return right after function starts :

                  public function discoveryQuery(Node $input, Context $context) : GraphAwareCommonCypherStatementInterface   {
                  $query = 'MATCH (input:User) WHERE id(input) = {id}
                  MATCH (input)-[:RATED]->(m)<-[:RATED]-(o)
                  WITH distinct o
                  MATCH (o)-[:RATED]->(reco)
                  RETURN distinct reco LIMIT 500';
                  
                  return Statement::create($query, ['id' => $input->identity()]);
                  }
                  
                  public function name() : string 
                  {
                  return "rated_by_others";
                  }
                  

                  希望它可以在未來幫助其他人.

                  hope it can help someone else in the future.

                  這篇關于Neo4j - Graphaware reco4php - 命名空間問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                  • <small id='DIq0l'></small><noframes id='DIq0l'>

                    1. <legend id='DIq0l'><style id='DIq0l'><dir id='DIq0l'><q id='DIq0l'></q></dir></style></legend>

                        <tbody id='DIq0l'></tbody>

                      1. <i id='DIq0l'><tr id='DIq0l'><dt id='DIq0l'><q id='DIq0l'><span id='DIq0l'><b id='DIq0l'><form id='DIq0l'><ins id='DIq0l'></ins><ul id='DIq0l'></ul><sub id='DIq0l'></sub></form><legend id='DIq0l'></legend><bdo id='DIq0l'><pre id='DIq0l'><center id='DIq0l'></center></pre></bdo></b><th id='DIq0l'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DIq0l'><tfoot id='DIq0l'></tfoot><dl id='DIq0l'><fieldset id='DIq0l'></fieldset></dl></div>
                          <bdo id='DIq0l'></bdo><ul id='DIq0l'></ul>

                          <tfoot id='DIq0l'></tfoot>
                          • 主站蜘蛛池模板: 国产一区二区三区精品久久久 | 欧美一区二区三区在线观看 | 午夜一级黄色片 | 欧美成人免费在线视频 | 一区二区三区四区av | 免费在线观看成人 | av中文字幕在线观看 | 久久高清| 亚洲精品视频导航 | 天天av综合 | 亚洲男人天堂av | 精精国产视频 | 99热最新网址 | 天天曰夜夜操 | www.蜜桃av | 国产亚洲欧美在线 | 亚洲成人久久久 | 亚洲视频一区在线观看 | 99资源| 亚洲精品自在在线观看 | 日韩h | 欧美日韩久久精品 | 中文字幕一区二区三区四区五区 | 国产伦精品一区二区三区在线 | 精品视频在线播放 | 精品一区二区三区在线观看国产 | 影音先锋久久 | 国产精品久久久精品 | 99久久精品一区二区成人 | 精品三级在线观看 | 国产三区在线观看视频 | 日本成人在线观看网站 | 日韩免| 91亚洲国产亚洲国产 | 日韩中文字幕 | 日韩看片| www狠狠干| 一区二区三区在线观看视频 | 国产精品精品久久久 | 欧美激情一区 | 99这里只有精品 |