src/snac/server/ServerExecutor.php
/**
     * Add Constellation SameAs
     *
     * Adds External Links to a constellation
     *
     * @param integer $constellationID
     * @param string[] $sameAsUris Array of uris to link this constellation to
     * @return string[] The response to send to the client
     */
Add Constellation SameAs
Adds External Links to a constellation

@param integer $constellationID
@param string[] $sameAsUris Array of uris to link this constellation to
@return string[] The response to send to the client
Add Constellation SameAs Adds External Links to a constellation @param integer $constellationID @param string [] $sameAsUris Array of uris to link this constellation to @return string [] The response to send to the client
public function addConstellationSameAs($constellationID, $sameAsUris) {
        $term = new \snac\data\Term;
        $term->setID(28225); 
        $sameAs = new \snac\data\SameAs;
        $sameAs->setType($term);
        $sameAs->setOperation(\snac\data\AbstractData::$OPERATION_INSERT);
        $sameAsList = [];
        foreach ($sameAsUris  as $uri) {
            $newSameAs = clone $sameAs;
            $newSameAs->setURI($uri);
            $sameAsList[] = $newSameAs;
        }
        $input = [];
        $input["constellationid"] = $constellationID;
        $editedConstellation = $this->editConstellation($input);
        $newVersion = $editedConstellation["constellation"]["version"];
        $constellation = new \snac\data\Constellation;
        $constellation->setID($constellationID);
        $constellation->setVersion($newVersion);
        foreach ($sameAsList as $sameAs) {
            $constellation->addOtherRecordID($sameAs);
        }
        $input["constellation"] = $constellation->toArray();
        $this->logger->addDebug("going to write constellation: ", $constellation->toArray());
        $writtenResult = $this->writeConstellation($input);
        $result = $this->publishConstellation($writtenResult);
        return $result;
    }
public function addConstellationSameAs ( $ constellationID , $ sameAsUris ) { $ term = new \ snac \ data \ Term ; $ term -> setID ( 28225 ) ; $ sameAs = new \ snac \ data \ SameAs ; $ sameAs -> setType ( $ term ) ; $ sameAs -> setOperation ( \ snac \ data \ AbstractData :: $ OPERATION_INSERT ) ; $ sameAsList = [ ] ; foreach ( $ sameAsUris as $ uri ) { $ newSameAs = clone $ sameAs ; $ newSameAs -> setURI ( $ uri ) ; $ sameAsList [ ] = $ newSameAs ; } $ input = [ ] ; $ input [ " constellationid " ] = $ constellationID ; $ editedConstellation = $ this -> editConstellation ( $ input ) ; $ newVersion = $ editedConstellation [ " constellation " ] [ " version " ] ; $ constellation = new \ snac \ data \ Constellation ; $ constellation -> setID ( $ constellationID ) ; $ constellation -> setVersion ( $ newVersion ) ; foreach ( $ sameAsList as $ sameAs ) { $ constellation -> addOtherRecordID ( $ sameAs ) ; } $ input [ " constellation " ] = $ constellation -> toArray ( ) ; $ this -> logger -> addDebug ( " going to write constellation:  " , $ constellation -> toArray ( ) ) ; $ writtenResult = $ this -> writeConstellation ( $ input ) ; $ result = $ this -> publishConstellation ( $ writtenResult ) ; return $ result ; }
Add Constellation SameAs
 Adds External Links to a constellation
Add Constellation SameAs Adds External Links to a constellation
// TODO: query vocab for the 'sameAs' term id // Make sameAs for each uri //  Check out constellation and get updated version. // Add SameAs objects // Set input for writing SameAs to constellation // Publish