PHP Interface GraphAware\Reco4PHP\Engine\DiscoveryEngine

Inheritance: extends GraphAware\Reco4PHP\Transactional\CypherAware
Show file Open project: graphaware/reco4php Interface Usage Examples

Public Methods

Method Description
buildScore ( GraphAware\Common\Type\Node $input, GraphAware\Common\Type\Node $item, GraphAware\Common\Result\Record $record, GraphAware\Reco4PHP\Context\Context $context ) : SingleScore Returns the score produced by the recommended item.
defaultScore ( ) : float
discoveryQuery ( GraphAware\Common\Type\Node $input, GraphAware\Reco4PHP\Context\Context $context ) : GraphAware\Common\Cypher\StatementInterface The statement to be executed for finding items to be recommended.
name ( ) : string
produceRecommendations ( GraphAware\Common\Type\Node $input, GraphAware\Common\Result\ResultCollection $resultCollection, GraphAware\Reco4PHP\Context\Context $context ) : Recommendations Returns a collection of Recommendation object produced by this discovery engine.
recoResultName ( ) : string
scoreResultName ( ) : string

Method Details

buildScore() public method

Returns the score produced by the recommended item.
public buildScore ( GraphAware\Common\Type\Node $input, GraphAware\Common\Type\Node $item, GraphAware\Common\Result\Record $record, GraphAware\Reco4PHP\Context\Context $context ) : SingleScore
$input GraphAware\Common\Type\Node
$item GraphAware\Common\Type\Node
$record GraphAware\Common\Result\Record
$context GraphAware\Reco4PHP\Context\Context
return GraphAware\Reco4PHP\Result\SingleScore A single score produced for the recommended item

defaultScore() public method

public defaultScore ( ) : float
return float The default score to be given to the discovered recommended item

discoveryQuery() public method

The statement to be executed for finding items to be recommended.
public discoveryQuery ( GraphAware\Common\Type\Node $input, GraphAware\Reco4PHP\Context\Context $context ) : GraphAware\Common\Cypher\StatementInterface
$input GraphAware\Common\Type\Node
$context GraphAware\Reco4PHP\Context\Context
return GraphAware\Common\Cypher\StatementInterface

name() public method

public name ( ) : string
return string The name of the discovery engine

produceRecommendations() public method

Returns a collection of Recommendation object produced by this discovery engine.
public produceRecommendations ( GraphAware\Common\Type\Node $input, GraphAware\Common\Result\ResultCollection $resultCollection, GraphAware\Reco4PHP\Context\Context $context ) : Recommendations
$input GraphAware\Common\Type\Node
$resultCollection GraphAware\Common\Result\ResultCollection
$context GraphAware\Reco4PHP\Context\Context
return GraphAware\Reco4PHP\Result\Recommendations

recoResultName() public method

public recoResultName ( ) : string
return string The column identifier of the row result representing the recommended item (node)

scoreResultName() public method

public scoreResultName ( ) : 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 defaultScore() or the score logic if the concrete class override the buildScore method.