src/snac/server/neo4j/Neo4JUtil.php
/**
     * List in-edges for constellation
     *
     * Lists the Constellation-Constellation relationships that point into the given constellation
     *
     * @param  \snac\data\Constellation $constellation Constellation to search
     * @return string[]                 The list of results
     */
List in-edges for constellation
Lists the Constellation-Constellation relationships that point into the given constellation

@param  \snac\data\Constellation $constellation Constellation to search
@return string[]                 The list of results
List in - edges for constellation Lists the Constellation - Constellation relationships that point into the given constellation @param \ snac \ data \ Constellation $constellation Constellation to search @return string [] The list of results
public function listConstellationInEdges(&$constellation) {
        $results = array();
        $this->logger->addDebug("Reading relationships from Neo4J");
        $result = $this->connector->run("MATCH p=(a:Identity)-[r:ICRELATION]->(b:Identity {id: {icid}}) return p;",
            [
                'icid' => $constellation->getID()
            ]
        );
        $rels = array();
        foreach ($result->getRecords() as $record) {
            $path = $record->pathValue("p");
            $target = new \snac\data\Constellation();
            $target->setID($path->start()->value("id"));
            $target->setArkID($path->start()->value("ark"));
            $target->setVersion($path->start()->value("version"));
            $targetName = new \snac\data\NameEntry();
            $targetName->setOriginal($path->start()->value("name"));
            $target->addNameEntry($targetName);
            $relation = new \snac\data\ConstellationRelation();
            if ($path->relationships()[0]->hasValue('id'))
                $relation->setID($path->relationships()[0]->value('id'));
            if ($path->relationships()[0]->hasValue('version'))
                $relation->setVersion($path->relationships()[0]->value('version'));
            $type = new \snac\data\Term();
            $type->setTerm($path->relationships()[0]->value('arcrole'));
            $relation->setType($type);
            array_push($rels, [
                "constellation" => $target,
                "relation" => $relation
            ]);
        }
        usort($rels,
                function ($a, $b) {
                    return $a['constellation']->getPreferredNameEntry()->getOriginal() <=> $b['constellation']->getPreferredNameEntry()->getOriginal();
                });
        return $rels;
    }
public function listConstellationInEdges ( & $ constellation ) { $ results = array ( ) ; $ this -> logger -> addDebug ( " Reading relationships from Neo4J " ) ; $ result = $ this -> connector -> run ( " MATCH p=(a:Identity)-[r:ICRELATION]->(b:Identity {id: {icid}}) return p; " , [ 'icid' => $ constellation -> getID ( ) ] ) ; $ rels = array ( ) ; foreach ( $ result -> getRecords ( ) as $ record ) { $ path = $ record -> pathValue ( " p " ) ; $ target = new \ snac \ data \ Constellation ( ) ; $ target -> setID ( $ path -> start ( ) -> value ( " id " ) ) ; $ target -> setArkID ( $ path -> start ( ) -> value ( " ark " ) ) ; $ target -> setVersion ( $ path -> start ( ) -> value ( " version " ) ) ; $ targetName = new \ snac \ data \ NameEntry ( ) ; $ targetName -> setOriginal ( $ path -> start ( ) -> value ( " name " ) ) ; $ target -> addNameEntry ( $ targetName ) ; $ relation = new \ snac \ data \ ConstellationRelation ( ) ; if ( $ path -> relationships ( ) [ 0 ] -> hasValue ( 'id' ) ) $ relation -> setID ( $ path -> relationships ( ) [ 0 ] -> value ( 'id' ) ) ; if ( $ path -> relationships ( ) [ 0 ] -> hasValue ( 'version' ) ) $ relation -> setVersion ( $ path -> relationships ( ) [ 0 ] -> value ( 'version' ) ) ; $ type = new \ snac \ data \ Term ( ) ; $ type -> setTerm ( $ path -> relationships ( ) [ 0 ] -> value ( 'arcrole' ) ) ; $ relation -> setType ( $ type ) ; array_push ( $ rels , [ " constellation " => $ target , " relation " => $ relation ] ) ; } usort ( $ rels , function ( $ a , $ b ) { return $ a [ 'constellation' ] -> getPreferredNameEntry ( ) -> getOriginal ( ) <=> $ b [ 'constellation' ] -> getPreferredNameEntry ( ) -> getOriginal ( ) ; } ) ; return $ rels ; }
List in-edges for constellation
 Lists the Constellation-Constellation relationships that point into the given constellation
List in - edges for constellation Lists the Constellation - Constellation relationships that point into the given constellation
// List out relations // Sort the in edges by preferred name